Timewarrior is a command-line time tracker.
git clone --recursive https://github.com/GothenburgBitFactory/timewarrior.git
Taskwarrior focuses on managing tasks, and does not track time. But it does have a hook system that allows easy integration of a third-party time tracking solution.
Timewarrior fills that gap, and more. See the documenation for full details.