Skip to content

User Guide: Command Line Usage

Sydefix edited this page Jun 12, 2025 · 3 revisions

This guide provides a complete reference for all commands available in the Habit Tracker CLI. All commands are run from your terminal using habit <command>.

Managing Habits

add

Adds a new habit to your database.

Syntax:

habit add <NAME> [OPTIONS]

Examples:

# Add a simple daily habit
habit add "Drink Water"

# Add a weekly habit with a description
habit add "Plan the Week" -d "Review goals and set schedule" -p weekly

update

Updates an existing habit's name, description, or periodicity.

Syntax:

habit update <IDENTIFIER> [OPTIONS]

<IDENTIFIER> can be the habit's unique ID or its name.

Examples:

# Change the description of a habit
habit update "Drink Water" -d "Drink at least 2 liters of water"

# Change the name of a habit (identified by its ID)
habit update 1 --new-name "Daily Hydration"

delete

Removes a habit from your database.

Syntax:

habit delete <IDENTIFIER>

Example:

habit delete "Daily Hydration"

checkoff

Marks a habit as completed for the current time.

Syntax:

habit checkoff <IDENTIFIER>

Example:

habit checkoff "Daily Hydration"

Viewing and Analyzing Habits

list

A shortcut to display all your habits in a simple list format.

Syntax:

habit list [OPTIONS]

Example:

# List all habits
habit list

# List only weekly habits
habit list -p weekly

analyze

The main command for viewing and analyzing habit data.

Syntax:

habit analyze [OPTIONS]

Options:

  • --show <VIEW>: Choose the analysis view.
    • table (default): A detailed, formatted table of all habits.
    • list: A simple list format (same as the list command).
    • summary: A high-level report of your progress.
    • streak: Calculates the longest completion streak.
    • struggle: Ranks habits by a "struggle score".
  • --periodicity <PERIOD>: Filter the view by daily, weekly, or monthly.
  • --habit <IDENTIFIER>: Specify a habit for streak analysis.

Examples:

# View the default table of all habits
habit analyze

# View the overall summary
habit analyze --show summary

# View the struggle scores
habit analyze --show struggle

# Find the longest streak for a specific habit
habit analyze --show streak --habit "Daily Hydration"

Next Step: Learn about the Using the Demo Environment to explore these features in a safe sandbox.

Clone this wiki locally