Skip to main content

CLI tool for Fatsecret API - track nutrition, meals, and fitness goals

Project description

fatcli

A CLI tool for Fatsecret API - track your nutrition, meals, and fitness goals from the command line.

Features

  • Authentication - OAuth flow with Fatsecret API
  • Profile - View your profile, weight, BMI, and goals
  • Meals - View, search, add, and delete food entries
  • Agent-friendly - Designed for LLM agent integration

Installation

pip install fatcli

Or from source:

git clone https://github.com/nimitbhardwaj/fatcli.git
cd fatcli
uv pip install -e .

Setup

  1. Get your Fatsecret API credentials from platform.fatsecret.com

  2. Create a .env file or export variables:

export FATSECRET_CONSUMER_KEY=your_consumer_key
export FATSECRET_CONSUMER_SECRET=your_consumer_secret
export FATSECRET_CONFIG_DIR=~/.config/fatsecret  # optional
  1. Authenticate:
fatcli init --url-only
# Visit the URL, get PIN, then:
fatcli init --pin 123456

Or interactive mode:

fatcli init

Usage

View Profile

fatcli profile

Output:

Profile
  Height:        173 cm
  Current Weight: 84.0 kg (as of 2026-04-03)
  Goal Weight:    74.0 kg
  Difference:     +10.0 kg
  BMI:            28.1
  Status:         Overweight

Log Weight

fatcli profile --weight 83.5 --goal 74

View Meals

# Today's meals
fatcli meals get --date 2026-04-04

# With macro summary
fatcli meals get --date 2026-04-04 --summary

Search Foods

fatcli meals search chicken

Get Food Details

fatcli meals info 1641

Add Food Entry

fatcli meals add 1641 --serving 50321 --units 1 --meal lunch

Delete Food Entry

# First get the entry ID from meals get
fatcli meals delete 23112601131

Help

fatcli                    # Show main help
fatcli -h                 # Same as --help
fatcli meals              # Show meals subcommands
fatcli meals get --help   # Help for specific command

Environment Variables

Variable Required Default Description
FATSECRET_CONSUMER_KEY Yes - API consumer key
FATSECRET_CONSUMER_SECRET Yes - API consumer secret
FATSECRET_CONFIG_DIR No ~/.config/fatsecret Config directory

Agent Integration

This CLI is designed for LLM agent use:

# Get authorization URL
fatcli init --url-only

# Complete with PIN (from human)
fatcli init --pin 123456

# View meals for analysis
fatcli meals get --date 2026-04-04 --summary

# Check profile
fatcli profile

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fatcli-0.1.0.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fatcli-0.1.0-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

Details for the file fatcli-0.1.0.tar.gz.

File metadata

  • Download URL: fatcli-0.1.0.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fatcli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 af0f65df57e0bd38b0123619da9ddde74a4aa104fa349e3a2d2f202674a0f5cb
MD5 d1337bd3786aa0a02cb742cb1beb9c5c
BLAKE2b-256 d27b4fbc7d4b5ee60e262634a57ff9e963a5d2154d1d53f1492b41934f107b5b

See more details on using hashes here.

Provenance

The following attestation bundles were made for fatcli-0.1.0.tar.gz:

Publisher: release.yml on nimitbhardwaj/fatcli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fatcli-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: fatcli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fatcli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5cef499faad24025aa60fc2285dd81daf08fff8f988d70fe936cba2c26e1644c
MD5 10c67de3714464598d928172b4496226
BLAKE2b-256 5cb9dfe0a4464e693fa4e9d927cda685e2173ca3029674f51a51e0d9f465a48f

See more details on using hashes here.

Provenance

The following attestation bundles were made for fatcli-0.1.0-py3-none-any.whl:

Publisher: release.yml on nimitbhardwaj/fatcli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page