hagit-cli
v2.1.1
Published
Git-style habit tracker CLI
Readme
haGIT CLI
haGIT CLI is a Git-inspired habit tracking tool designed for developers who prefer structured workflows.
Instead of traditional habit trackers with checkboxes and streak counters, haGIT models habits using familiar version control concepts such as branches, commits, logs, and pushes. This allows habit actions to be recorded in a structured workflow similar to Git.
The CLI records habit actions locally and synchronizes them with the haGIT server.
Installation
Install the CLI globally using npm.
npm install -g hagit-cliVerify installation:
hagit --versionOnce installed, the hagit command will be available globally.
Quick Start
Initialize haGIT in a directory where you want to track habits.
hagit initAuthenticate the CLI using your token.
hagit login -t <token>Create your first habit:
hagit branch -m exerciseSwitch to the habit:
hagit checkout exerciseRecord a habit action:
hagit commit -m "morning run"Push commits to the server:
hagit pushCommands
| Command | Description | Example |
| ---------------------------- | ------------------------------------ | --------------------------------- |
| hagit init | Initialize haGIT workspace | hagit init |
| hagit login -t <token> | Authenticate CLI with server | hagit login -t TOKEN |
| hagit branch | List habits (current marked with *) | hagit branch |
| hagit branch -m <habit> | Create a new habit | hagit branch -m exercise |
| hagit branch -d <habit> | Delete a habit | hagit branch -d exercise |
| hagit checkout <habit> | Switch to a habit | hagit checkout reading |
| hagit commit -m <message> | Record a habit action | hagit commit -m "read 20 pages" |
| hagit commit -d <commitId> | Delete a commit | hagit commit -d 123 |
| hagit log | Show commit history (per-habit numbered) | hagit log |
| hagit status | Show workspace state | hagit status |
| hagit reset | Clear local commits | hagit reset |
| hagit push | Sync commits with server | hagit push |
Example Workflow
A typical habit tracking workflow using the CLI:
hagit init
hagit login -t <token>
hagit branch -m exercise
hagit checkout exercise
hagit commit -m "morning run"
hagit commit -m "evening stretch"
hagit pushThis workflow:
- Initializes a habit workspace
- Authenticates the CLI
- Creates a habit
- Records habit actions as commits
- Synchronizes commits with the server
Local Storage
haGIT stores local configuration and commits in the user's home directory:
~/.hagitThis directory contains:
config.json
HEAD
commits.json| File | Purpose |
| -------------- | --------------------------------------- |
| config.json | Stores authentication token and API URL |
| HEAD | Current active habit |
| commits.json | Local commit history |
Commits are stored locally until they are pushed to the server.
Synchronization
Running:
hagit pushsends local commits to the haGIT server.
Once pushed, commits become available in the haGIT dashboard and extension.
Related Components
haGIT CLI is part of a larger ecosystem.
| Component | Purpose | | ---------------- | --------------------------------------------------------- | | Web Dashboard | Visualize habits, heatmaps, and statistics | | Chrome Extension | Quickly create commits and manage habits from the browser |
License
MIT License
