A scriptable Go CLI for the unofficial YAZIO API
Read, search, add, and remove YAZIO diary data from your terminal.
Authenticate with your YAZIO account, fetch daily summaries, search products, and automate food logging.
Warning
This project relies on YAZIO's unofficial/private API. Endpoints, payloads, or authentication flows may change without notice and break the CLI.
| Feature | Description | |
|---|---|---|
| π | Email/password login | Exchange YAZIO credentials for an API token and save it locally |
| β»οΈ | Token persistence | Persist and refresh API tokens automatically after login |
| π€ | User profile | Fetch the current YAZIO user profile |
| π | Daily summary | Read nutrition summary data for today or a specific date |
| π½οΈ | Diary entries | List consumed diary items for a date |
| π | Product search | Search products in the YAZIO database |
| β | Add diary items | Add consumed products with meal, serving, amount, and date metadata |
| ποΈ | Remove entries | Remove consumed diary entries by entry ID |
| βοΈ | Config bootstrap | Generate a starter config with yazio config init |
| π§Ύ | Scriptable output | Use table output for humans or JSON output for automation |
| π€ | Diary CSV export | Export one day or an inclusive date range of diary entries to CSV |
yazio config init
yazio auth login --email you@example.com --password 'your-password'
yazio auth statusOr provide credentials through environment variables:
export YAZIO_EMAIL=you@example.com
export YAZIO_PASSWORD='your-password'
yazio auth login| Command | Description |
|---|---|
yazio user profile |
Fetch the current user profile |
yazio summary |
Fetch today's daily summary |
yazio summary 2026-06-02 |
Fetch the daily summary for a date |
yazio consumed 2026-06-02 |
List consumed diary entries for a date |
yazio export diary 2026-06-02 |
Export one diary day as CSV to stdout |
yazio export diary --from 2026-06-01 --to 2026-06-07 --file diary.csv |
Export an inclusive diary date range to a CSV file |
yazio search banana |
Search products in the YAZIO database |
yazio --output json summary 2026-06-02 |
Emit JSON for scripting |
CSV exports write this header:
date,category,meal,entry_id,type,product_id,name,producer,amount,serving,serving_quantity,raw_json
If you pass --file, the CLI writes the CSV file and prints the exported entry count. Without --file, CSV goes to stdout for piping into other tools. Product rows use typed columns directly; recipe portions and simple products also include raw_json so unsupported YAZIO diary fields are not silently dropped.
yazio add \
--product-id 11111111-1111-1111-1111-111111111111 \
--meal breakfast \
--amount 100 \
--serving g \
--serving-quantity 1 \
--date 2026-06-02
yazio remove 22222222-2222-2222-2222-222222222222go install github.com/itzptk/yazio-go-cli/cmd/yazio@latestWhen releases are published, grab the latest platform archive and checksums.txt from the Releases page.
git clone https://github.com/itzptk/yazio-go-cli.git
cd yazio-go-cli
go build -o bin/yazio ./cmd/yazioDefault config path:
~/.config/yazio-go-cli/config.yaml
Generate a starter config:
yazio config initTo overwrite an existing config file:
yazio config init --forceYou can also copy the checked-in example manually:
mkdir -p ~/.config/yazio-go-cli
cp config.example.yaml ~/.config/yazio-go-cli/config.yamlOverride the config path per command:
yazio --config /path/to/config.yaml ...| Key | Description |
|---|---|
base_url |
Override the unofficial YAZIO API base URL |
output |
Default output format: table or json |
token |
Populated automatically after yazio auth login |
| Layer | Technology |
|---|---|
| Language | Go 1.24 |
| CLI Framework | Cobra |
| Config | Viper + YAML |
| API Client | Go net/http client for the unofficial YAZIO API |
| Identifiers | google/uuid |
| Testing | go test ./... |
| CI/CD | GitHub Actions β CI, build-only artifacts, beta/stable release flow |
git clone https://github.com/itzptk/yazio-go-cli.git
cd yazio-go-cli
make test
make build| Command | Description |
|---|---|
make fmt |
Format Go source with go fmt ./... |
make test |
Run go test ./... |
make build |
Build bin/yazio |
make docker-test |
Run tests in a Go 1.24 container |
make docker-build |
Build bin/yazio in a Go 1.24 container |
If you prefer direct Go commands:
go fmt ./...
go test ./...
go build -o bin/yazio ./cmd/yazioThe GitHub Actions release flow supports stable releases, beta releases, and build-only artifact checks.
| Trigger | Release Type |
|---|---|
workflow_dispatch stable with explicit version |
Latest release vX.Y.Z |
Schedule every 6h or workflow_dispatch beta |
Pre-release vX.Y.Z-beta.N when main changed since the last beta |
workflow_dispatch build-only |
CI artifact build without creating a GitHub Release |
Release artifacts are published as platform archives named yazio-go-cli_<version>_<os>_<arch> with a checksums.txt file.
Issues and pull requests are welcome.
When contributing:
- keep the command surface small and practical
- prefer narrow, well-tested endpoint coverage over broad speculative coverage
- document behavior changes in the README
- verify changes with real command output where possible
For usage questions, bugs, or API breakage reports, open an issue at https://github.com/itzptk/yazio-go-cli/issues. Include the CLI command, expected behavior, actual behavior, and whether the response came from the unofficial API.
This project was informed by existing reverse-engineered/community work:
controlado/go-yazioβ unofficial Go client with token/auth patternsjuriadams/yazioβ TypeScript client with endpoint shapes for summary, search, and consumed itemssaganos/yazio_public_apiβ older Swagger-style API description and OAuth token notes
Current limitations:
- Email/password auth is the only supported login flow
- Apple/Google web-session import is not implemented
- Because the API is unofficial, long-term compatibility is not guaranteed
The goal here is a focused, scriptable CLI rather than exhaustive API coverage.
MIT Β© itzptk