{"id":21292101,"url":"https://github.com/aquilax/hranoprovod-cli","last_synced_at":"2025-09-04T20:40:00.499Z","repository":{"id":37390604,"uuid":"140963852","full_name":"aquilax/hranoprovod-cli","owner":"aquilax","description":"Diet tracker for the command line","archived":false,"fork":false,"pushed_at":"2024-03-05T04:55:17.000Z","size":481,"stargazers_count":11,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-06-21T08:27:45.096Z","etag":null,"topics":["cli","command-line","command-line-tool","diet","go","golang","nutrition","quantified","quantified-self","tracking"],"latest_commit_sha":null,"homepage":"https://hranoprovod.readthedocs.io","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aquilax.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-14T17:09:41.000Z","updated_at":"2024-04-11T03:54:48.000Z","dependencies_parsed_at":"2024-01-12T10:24:49.607Z","dependency_job_id":"4c2c3f98-7d81-4b3e-a58e-889a45c74692","html_url":"https://github.com/aquilax/hranoprovod-cli","commit_stats":{"total_commits":265,"total_committers":4,"mean_commits":66.25,"dds":"0.12075471698113205","last_synced_commit":"ad58db676b44485c3dd380c196f25e50beb72661"},"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aquilax%2Fhranoprovod-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aquilax%2Fhranoprovod-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aquilax%2Fhranoprovod-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aquilax%2Fhranoprovod-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aquilax","download_url":"https://codeload.github.com/aquilax/hranoprovod-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225741248,"owners_count":17516895,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","command-line","command-line-tool","diet","go","golang","nutrition","quantified","quantified-self","tracking"],"created_at":"2024-11-21T13:47:37.580Z","updated_at":"2024-11-21T13:47:38.222Z","avatar_url":"https://github.com/aquilax.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hranoprovod-cli [![GoDoc](https://godoc.org/github.com/aquilax/hranoprovod-cli?status.svg)](https://godoc.org/github.com/aquilax/hranoprovod-cli) [![Go Report Card](https://goreportcard.com/badge/github.com/aquilax/hranoprovod-cli)](https://goreportcard.com/report/github.com/aquilax/hranoprovod-cli) [![Documentation Status](https://readthedocs.org/projects/hranoprovod/badge/?version=latest)](https://hranoprovod.readthedocs.io/en/latest/?badge=latest) [![hranoprovod-cli](https://snapcraft.io/hranoprovod-cli/badge.svg)](https://snapcraft.io/hranoprovod-cli)\n\n## Description\n\nHranoprovod is command line diet tracking tool. It supports nested recipes and is agnostic to the metrics you choose to track, which makes it perfect for tracking calories, nutrition data, exercises and any other measurement that is accumulated on daily basis.\n\n[![asciicast](https://asciinema.org/a/257200.svg)](https://asciinema.org/a/257200)\n\n## Installation\n\n### asdf\n\n[asdf](https://github.com/asdf-vm/asdf) is an extendable version manager for linux and macOS.\n\nhranoprovod can be installed using a plugin as follows:\n\n    asdf plugin add hranoprovod https://github.com/aquilax/asdf-hranoprovod.git\n    asdf install hranoprovod latest\n\n### from code\n\nFirst make sure you have go (golang) installed.\n\n    https://go.dev/\n\nClone the repository and build/install the tool:\n\n    git clone https://github.com/aquilax/hranoprovod-cli.git\n    cd hranoprovod-cli/cmd/hranoprovod-cli/\n    go install\n\n\n## Docker\n\nYou can run hranoprovod-cli from Docker too\n\n### Building the image\n\n```sh\ndocker build --pull --rm -f \"Dockerfile\" -t aquilax/hranoprovod-cli:latest .\n```\n\n### Running a balance report\n\n```sh\ndocker run --rm -it -v /path/to/data/files/:/data aquilax/hranoprovod-cli:latest -d /data/food.yaml -l /data/log.yaml bal\n```\n\n## Help\n\nRunning the `hranoprovod-cli` command will show you the command line options\n\n```sh\n$ ./hranoprovod-cli --help\nNAME:\n   hranoprovod-cli - Diet tracker for the command line\n\nUSAGE:\n   hranoprovod-cli [global options] command [command options] [arguments...]\n\nVERSION:\n   dev, commit none, built at unknown\n\nDESCRIPTION:\n   A command line tool to keep log of diet and exercise in text files\n\nAUTHOR:\n   aquilax \u003caquilax@gmail.com\u003e\n\nCOMMANDS:\n   register, reg  Shows the log register report\n   balance, bal   Shows food balance as tree\n   lint           Lints file for parsing errors\n   report         Generates various reports\n   csv            Generates csv exports\n   stats          Provide stats information\n   summary        Show summary for date\n   print          Print log\n   gen            Generate documentation\n   help, h        Shows a list of commands or help for one command\n\nGLOBAL OPTIONS:\n   --begin DATE, -b DATE      Beginning of period DATE\n   --end DATE, -e DATE        End of period DATE\n   --today DATE               Overwrite today's date DATE\n   --database FILE, -d FILE   optional database file name FILE (default: \"food.yaml\") [$HR_DATABASE]\n   --logfile FILE, -l FILE    log file name FILE (default: \"log.yaml\") [$HR_LOGFILE]\n   --config FILE, -c FILE     Configuration file FILE (default: \"/home/aquilax/.hranoprovod/config\") [$HR_CONFIG]\n   --date-format DATE_FORMAT  Date format for parsing and printing dates DATE_FORMAT (default: \"2006/01/02\") [$HR_DATE_FORMAT]\n   --maxdepth DEPTH           Resolve depth DEPTH (default: 10) [$HR_MAXDEPTH]\n   --no-color                 Disable color output (default: false)\n   --no-database              Disables loading the database (even if database filename is set) (default: false)\n   --help, -h                 show help (default: false)\n   --version, -v              print the version (default: false)\n\n```\n\n## Usage\n\nHranoprovod uses two files with very similar format to operate.\n\n### Database file (food.yaml)\n\nContains all the \"recipes\" in the following format:\n\n```sh\n$ cat examples/food.yaml\n# daily nutrition budget\nday/nonworking:\n  calories: -1200\n  fat: -124\n  carbohydrate: -50\n  protein: -104\n\nbread/rye/100g:\n  # barcode: 0000000000000\n  calories: 259\n  fat: 3.3\n  carbohydrate: 48\n  protein: 9\n\negg/boiled/100g:\n  # boiling time: 12 min\n  calories: 155\n  fat: 11\n  carbohydrate: 1.1\n  protein: 13\n\nvegetables/lettuce/romaine/100g:\n  calories: 15\n  fat: 0.5\n  carbohydrate: 1.7\n  protein: 0.9\n\nsauce/mayonnaise/100g:\n  calories: 680\n  fat: 7.5\n  carbohydrate: 0.6\n  protein: 1\n\nsandwich/egg/lettuce/100g:\n  bread/rye/100g: 0.40\n  egg/boiled/100g: 0.20\n  vegetables/lettuce/romaine/100g: 0.20\n  sauce/mayonnaise/100g: 0.20\n\ncandy/snickers/bar:\n  calories: 280\n  fat: 13.6\n  carbohydrate: 35.1\n  protein: 4.29\n\n\n```\n\nHranoprovod is measure agnostic and it's up to the user to use or state the measurements.\n\n### Log journal file (log.yaml)\n\nThe log file contains dated usage of the recipes, defined in the database file.\n\n```sh\n$ cat examples/log.yaml\n2021/01/24:\n  day/nonworking: 1\n  coffee/cup: 1\n  sandwich/egg/lettuce/100g: 1.20\n  candy/snickers/bar: 1\n\n2021/01/25:\n  day/nonworking: 1\n  coffee/cup: 1\n  sandwich/egg/lettuce/100g: 1.50\n  coffee/cup: 1\n\n```\n\nNote: it's not mandatory to have the elements in the database file. Elements which are not found will be represented as they are. They can always be added later to the database.\n\n#### Register\n\nGiven this example, the result will look like:\n\n```sh\n$ ./hranoprovod-cli -d examples/food.yaml -l examples/log.yaml --no-color reg\n2021/01/24\n\tday/nonworking              :      1.00\n\t\t            calories   -1200.00\n\t\t        carbohydrate     -50.00\n\t\t                 fat    -124.00\n\t\t             protein    -104.00\n\tcoffee/cup                  :      1.00\n\t\t          coffee/cup       1.00\n\tsandwich/egg/lettuce/100g   :      1.20\n\t\t            calories     328.32\n\t\t        carbohydrate      23.86\n\t\t                 fat       6.14\n\t\t             protein       7.90\n\tcandy/snickers/bar          :      1.00\n\t\t            calories     280.00\n\t\t        carbohydrate      35.10\n\t\t                 fat      13.60\n\t\t             protein       4.29\n\t-- TOTAL  ----------------------------------------------------\n\t\t            calories     608.32   -1200.00 =   -591.68\n\t\t        carbohydrate      58.96     -50.00 =      8.96\n\t\t          coffee/cup       1.00       0.00 =      1.00\n\t\t                 fat      19.74    -124.00 =   -104.26\n\t\t             protein      12.19    -104.00 =    -91.81\n2021/01/25\n\tday/nonworking              :      1.00\n\t\t            calories   -1200.00\n\t\t        carbohydrate     -50.00\n\t\t                 fat    -124.00\n\t\t             protein    -104.00\n\tcoffee/cup                  :      2.00\n\t\t          coffee/cup       2.00\n\tsandwich/egg/lettuce/100g   :      1.50\n\t\t            calories     410.40\n\t\t        carbohydrate      29.82\n\t\t                 fat       7.68\n\t\t             protein       9.87\n\t-- TOTAL  ----------------------------------------------------\n\t\t            calories     410.40   -1200.00 =   -789.60\n\t\t        carbohydrate      29.82     -50.00 =    -20.18\n\t\t          coffee/cup       2.00       0.00 =      2.00\n\t\t                 fat       7.68    -124.00 =   -116.32\n\t\t             protein       9.87    -104.00 =    -94.13\n\n```\n\n#### Balance tree\n\nYou can also generate balance tree for single nutrition value:\n\n```sh\n$ ./hranoprovod-cli -d examples/food.yaml -l examples/log.yaml --no-color bal -s calories\n    280.00 | candy\n    280.00 |   snickers\n    280.00 |     bar\n  -2400.00 | day\n  -2400.00 |   nonworking\n    738.72 | sandwich\n    738.72 |   egg\n    738.72 |     lettuce\n    738.72 |       100g\n-----------|\n  -1381.28 | calories\n\n```\n\nSame result in slightly more compact format:\n\n```sh\n$ ./hranoprovod-cli -d examples/food.yaml -l examples/log.yaml --no-color bal -s calories -c\n    280.00 | candy/snickers/bar\n  -2400.00 | day/nonworking\n    738.72 | sandwich/egg/lettuce/100g\n-----------|\n  -1381.28 | calories\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faquilax%2Fhranoprovod-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faquilax%2Fhranoprovod-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faquilax%2Fhranoprovod-cli/lists"}