https://github.com/wbingli/zsh-wakatime
ZSH plugin for wakatime
https://github.com/wbingli/zsh-wakatime
Last synced: 8 months ago
JSON representation
ZSH plugin for wakatime
- Host: GitHub
- URL: https://github.com/wbingli/zsh-wakatime
- Owner: wbingli
- License: mit
- Created: 2015-08-27T03:48:17.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2023-12-08T05:28:28.000Z (almost 2 years ago)
- Last Synced: 2024-08-01T19:54:30.418Z (over 1 year ago)
- Language: Shell
- Homepage:
- Size: 30.3 KB
- Stars: 147
- Watchers: 8
- Forks: 14
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-zsh-plugins - wakatime (wbingli) - Automatic time tracking for commands in ZSH using [wakatime](https://wakatime.com/). (Plugins / ZSH on Windows)
- fucking-awesome-zsh-plugins - wakatime (wbingli) - Automatic time tracking for commands in ZSH using 🌎 [wakatime](wakatime.com/). (Plugins / ZSH on Windows)
- awesome-zsh-plugins - wakatime (wbingli) - Automatic time tracking for commands in ZSH using [wakatime](https://wakatime.com/). (Plugins / Zinit (née zplugin))
README
Zsh plugin for WakaTime
=======================
Automatic time tracking for commands in Zsh using [WakaTime](http://wakatime.com/).
Installation
---
Plugin requires [WakaTime CLI](https://github.com/wakatime/wakatime-cli) **6.0 or higher**.
Ensure your WakaTime API key is set up in your [~/.wakatime.cfg](https://github.com/wakatime/wakatime-cli/blob/develop/USAGE.md) file. If you use WakaTime in other editors, this file may already exist.
**1. Install WakaTime CLI**
- **Using a Python script**:
```
python3 -c "$(wget -q -O - https://raw.githubusercontent.com/wakatime/vim-wakatime/master/scripts/install_cli.py)"
```
- **For Arch users**:
```
sudo pacman -S wakatime
```
- **For Homebrew users**:
```
brew install wakatime-cli
```
**2. Install the Plugin**
- **For Oh-My-Zsh users**:
```
git clone https://github.com/wbingli/zsh-wakatime.git ${Zsh_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-wakatime
```
Then, edit your `.zshrc` file and add `zsh-wakatime` to the list of Oh-My-Zsh plugins.
- **For Antigen users**:
```
antigen bundle wbingli/zsh-wakatime
```
**3. Final Steps**
- Open a new terminal and run some commands to start tracking.
- Visit [WakaTime Dashboard](https://wakatime.com/project/Terminal) to see your stats.
Project Detection
---
By default all actions logged by the Zsh plugin for WakaTime are associated with the *Terminal* project, if you would like the plugin to attribute the project based on either git repository or the last accessed project then set `ZSH_WAKATIME_PROJECT_DETECTION` to true in your environment.
To enable:
1. Edit your `.zshrc`.
2. Add the line `export ZSH_WAKATIME_PROJECT_DETECTION=true` at the top of the file.
Screenshot
---

Configuration
---
WakaTime plugins share a common config file `.wakatime.cfg` located in your user home directory with [these options](https://github.com/wakatime/wakatime#configuring) available.
Troubleshooting
---
If you don't see any data while visiting https://wakatime.com/project/Terminal, trying below to find out the problem:
- Run `ps | grep wakatime` repeatedly as fast as possbile.
- You should notice process with command like `wakatime-cli --write --plugin zsh-wakatime/0.0.1 --entity-type app --project Terminal --entity ps`.
- Copy that full command and execute in the terminal.
- If any problem happens while running this command, please reference to https://github.com/wakatime/wakatime-cli/blob/develop/TROUBLESHOOTING.md for further troubleshootig.