Terminal

WakaTime can track your Terminal usage if you use zsh, bash, iTerm2, or fish.

Installing for zsh

  1. sudo pip install wakatime.

  2. cd ~/.oh-my-zsh/custom/plugins && git clone https://github.com/wbinglee/zsh-wakatime.git or however you manage your zsh plugins.

  3. Edit your .zshrc file and add zsh-wakatime to oh-my-zsh plugins.

  4. Make sure your API key is in your ~/.wakatime.cfg file.

  5. Open a new terminal and type commands.

  6. Activity from the zsh plugin always goes in the Terminal project, so visit https://wakatime.com/project/Terminal to see your logged time.

Installing for bash

  1. sudo pip install wakatime.

  2. git clone https://github.com/gjsheep/bash-wakatime.git.

  3. Include the bash-wakatime.sh file in your ~/.bashrc file with this command:

    source path/to/bash-wakatime.sh

    But if you already have a PROMPT_COMMAND variable set, just merge your own pre_prompt_command with the following one.

  4. Make sure your API key is in your ~/.wakatime.cfg file.

  5. Open a new terminal and type commands.

  6. Activity from the bash plugin always goes in the Terminal project, so visit https://wakatime.com/project/Terminal to see your logged time.

Installing for iTerm2

  1. sudo pip install wakatime.

  2. Add a new iTerm2 Trigger with these settings:

    • Regular Expression: .*
    • Action: Run Command...
    • Parameters: wakatime --entity Terminal --entity-type app --plugin "iterm2-wakatime/0.0.1" --project "<<LAST_PROJECT>>"
  3. Make sure your API key is in your ~/.wakatime.cfg file.

  4. Open a new iTerm2 terminal and type commands.

  5. Activity from the iTerm2 trigger goes into whichever project you last coded in, so visit https://wakatime.com/dashboard to see your logged time.

Installing for fish

  1. sudo pip install wakatime.

  2. Make sure your API key is in your ~/.wakatime.cfg file.

  3. Copy the contents of fish-wakatime.sh into ~/.config/fish/functions/fish_prompt.fish.

  4. Fish should pick this up instantly.

  5. Activity from the fish plugin always goes in the Terminal project, so visit https://wakatime.com/project/Terminal to see your logged time.