Skip to content

milldr/crono

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

57 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🍎 crono

ko-fi

CLI for Cronometer automation via Kernel.sh.

Cronometer has no public API, so crono automates the web UI through Kernel.sh browser automation. Log macros from your terminal in seconds.

crono quick-add demo

Quickstart

1. Install

npm install -g @milldr/crono

2. Log in

crono login

You'll be prompted for three things:

  • Kernel API key β€” get one at kernel.sh
  • Cronometer email β€” your Cronometer account email
  • Cronometer password β€” stored securely in your system keychain
β”Œ  crono login
β”‚
β—‡  Kernel API key
β”‚  sk-abc...
β”‚
β—’  Validating API key...
β—‡  API key valid.
β”‚
β—‡  Cronometer email
β”‚  you@example.com
β”‚
β—‡  Cronometer password
β”‚  ****
β”‚
β””  Credentials saved.

3. Log a meal

crono quick-add -p 30 -c 100 -f 20 -a 14 -m Dinner -d yesterday
β”Œ  crono quick-add
β”‚
β—’  Logging into Cronometer...
β—‡  Done.
β”‚
β””  Added: 30g protein, 100g carbs, 20g fat, 14g alcohol β†’ Dinner on 2026-02-15

Commands

crono login

Set up or update your Kernel API key and Cronometer credentials. If credentials already exist, pressing Enter keeps the current value.

crono login

crono quick-add

Add a quick macro entry to your Cronometer diary.

crono quick-add [options]

Options:

Flag Long Description
-p --protein <g> Grams of protein
-c --carbs <g> Grams of carbohydrates
-f --fat <g> Grams of fat
-a --alcohol <g> Grams of alcohol
-m --meal <name> Meal category (Breakfast, Lunch, Dinner, Snacks)
-d --date <date> Date (YYYY-MM-DD, yesterday, -1d)

At least one macro flag (-p, -c, -f, or -a) is required.

Examples:

# Log 30g protein
crono quick-add -p 30

# Log full meal macros
crono quick-add -p 30 -c 100 -f 20

# Log to Dinner category
crono quick-add -p 30 -c 50 -f 15 --meal Dinner

# Log to yesterday
crono quick-add -p 30 -d yesterday -m Dinner

# Log alcohol
crono quick-add -a 14 -m Dinner

# Combine everything
crono quick-add -p 30 -c 50 -f 10 -a 14 -d -3d -m Dinner

crono add custom-food

Create a custom food in Cronometer with specified macros.

crono add custom-food <name> [options]

Options:

Flag Long Description
-p --protein <g> Grams of protein
-c --carbs <g> Grams of carbohydrates
-f --fat <g> Grams of fat
--log [meal] Also log to diary (optionally specify meal)

At least one macro flag (-p, -c, or -f) is required.

Examples:

# Create a custom food with all macros
crono add custom-food "Wendy's Chicken Sandwich" -p 50 -c 100 -f 50

# Just protein and carbs
crono add custom-food "Post-Workout Shake" -p 40 -c 60

# Create and immediately log to Uncategorized
crono add custom-food "Wendy's Chicken Sandwich" -p 50 -c 100 -f 50 --log

# Create and immediately log to Dinner
crono add custom-food "Wendy's Chicken Sandwich" -p 50 -c 100 -f 50 --log Dinner

crono log

Log a saved food to your diary by name. Works with custom foods, custom recipes, and database items.

crono log <name> [options]

Options:

Flag Long Description
-m --meal <name> Meal category (Breakfast, Lunch, Dinner, Snacks)
-s --servings <count> Number of servings (default: 1)

Examples:

# Log a custom food
crono log "Wendy's Chicken Sandwich"

# Log to a specific meal
crono log "Wendy's Chicken Sandwich" -m Dinner

# Log multiple servings
crono log "Post-Workout Shake" -s 2 -m Snacks

crono weight

Check your weight from Cronometer. Defaults to today if no date or range is specified.

crono weight [options]

Options:

Flag Long Description
-d --date <date> Date (YYYY-MM-DD)
-r --range <range> Range (7d, 30d, or YYYY-MM-DD:YYYY-MM-DD)
--json Output as JSON

-d and -r are mutually exclusive.

Examples:

# Today's weight
crono weight
# β†’ 212.5 lbs

# Specific date
crono weight -d 2026-02-05

# Last 7 days
crono weight -r 7d
# β†’ 2026-02-11: 212.5
# β†’ 2026-02-10: 212.7
# β†’ 2026-02-09: 215.5
# β†’ ...

# JSON output for scripting
crono weight --json
# β†’ {"date":"2026-02-11","weight":212.5,"unit":"lbs"}

# Range as JSON
crono weight -r 7d --json
# β†’ [{"date":"2026-02-11","weight":212.5,"unit":"lbs"}, ...]

crono diary

View daily nutrition totals (calories, protein, carbs, fat) from Cronometer. Defaults to today if no date or range is specified.

crono diary [options]

Options:

Flag Long Description
-d --date <date> Date (YYYY-MM-DD)
-r --range <range> Range (7d, 30d, or YYYY-MM-DD:YYYY-MM-DD)
--json Output as JSON

-d and -r are mutually exclusive.

Examples:

# Today's nutrition
crono diary
# β†’ 1847 kcal | P: 168g | C: 142g | F: 58g

# Specific date
crono diary -d 2026-02-05

# Last 7 days
crono diary -r 7d
# β†’ 2026-02-11: 1847 kcal | P: 168g | C: 142g | F: 58g
# β†’ 2026-02-10: 2103 kcal | P: 155g | C: 200g | F: 72g
# β†’ ...

# JSON output for scripting
crono diary --json
# β†’ {"date":"2026-02-11","calories":1847,"protein":168,"carbs":142,"fat":58}

# Range as JSON
crono diary -r 7d --json
# β†’ [{"date":"2026-02-11","calories":1847,"protein":168,"carbs":142,"fat":58}, ...]

crono export

Export data directly from Cronometer's API β€” no browser automation, much faster than diary or weight.

crono export <type> [options]

Types:

Type Description
nutrition Daily nutrition totals (macros)
exercises Exercise entries with duration/cals
biometrics Biometric measurements (weight, BP)

Options:

Flag Long Description
-d --date <date> Date (YYYY-MM-DD)
-r --range <range> Range (7d, 30d, or YYYY-MM-DD:YYYY-MM-DD)
--csv Output as raw CSV
--json Output as JSON

-d and -r are mutually exclusive. --csv and --json are mutually exclusive.

Examples:

# Today's nutrition
crono export nutrition
# β†’ 1847 kcal | P: 168g | C: 142g | F: 58g

# Last 7 days of nutrition as JSON
crono export nutrition -r 7d --json

# Today's exercises
crono export exercises
# β†’ Running: 30 min, 350 kcal

# Biometrics for last 30 days
crono export biometrics -r 30d
# β†’ 2026-02-11: Weight: 212.5 lbs
# β†’ 2026-02-09: Blood Pressure: 120/80 mmHg

# Raw CSV export
crono export nutrition -r 30d --csv

GWT overrides: If Cronometer updates break the export, override GWT values in ~/.config/crono/config.json or via environment variables:

export CRONO_GWT_PERMUTATION=<new-value>
export CRONO_GWT_HEADER=<new-value>

Requirements

Development

git clone https://github.com/milldr/crono.git
cd crono
npm install

# Run in dev mode
npm run dev -- login
npm run dev -- quick-add -p 30
npm run dev -- weight -r 7d
npm run dev -- diary

# Run tests
npm test

# Build
npm run build

Support

I build and maintain projects like crono in my free time as personal hobbies. They're completely free and always will be. If you find this useful and want to show some support, feel free to buy me a coffee:

ko-fi

License

MIT

About

CLI for Cronometer automation via Kernel.sh

Resources

License

Stars

Watchers

Forks

Packages

No packages published