-
Notifications
You must be signed in to change notification settings - Fork 0
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>.
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 weeklyUpdates 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"Removes a habit from your database.
Syntax:
habit delete <IDENTIFIER>Example:
habit delete "Daily Hydration"Marks a habit as completed for the current time.
Syntax:
habit checkoff <IDENTIFIER>Example:
habit checkoff "Daily Hydration"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 weeklyThe 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 thelistcommand). -
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 bydaily,weekly, ormonthly. -
--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.