/code-stats-bash

Code::Stats plugin for bash

Primary LanguageShellMIT LicenseMIT

Code::Stats plugin for bash

pre-commit.ci status

github/downloads github/downloads/latest github/issues github/issues-closed github/issues-pr github/issues-pr-closed github/discussions github/milestones github/forks github/stars github/watchers github/contributors github/commit-activity github/last-commit github/release-date

github/license github/languages github/languages/top github/directory-file-count github/code-size github/repo-size github/v

Code-stats-bash hooks onto bash, counts characters as you type and saves your statistics in Code::Stats. You'll receive XP for the language Terminal (Bash) for each character, backspace/delete and enter you type.

Installation

  1. Ensure you have curl.
  2. Get your personal API key from https://codestats.net/my/machines and set environment variable in e.g. .bashrc.
  3. Install and source the script in one of the following ways (in .bashrc after the environment variable):
yay -S codestats-bash

Manual installation

Clone this git repo and source the script directly. Please source it after any customization of $PROMPT_COMMAND, such as gitstatus:

source codestats.sh

Options

  • CODESTATS_API_KEY: the API key used when submitting pulses. Required.
  • CODESTATS_API_URL: the base URL to the Code::Stats API. Only set this if you know what you're doing! :)
  • CODESTATS_LOG_FILE: a log file for debugging. Must exist and be writable.