{"id":18950388,"url":"https://github.com/axodotdev/axocli","last_synced_at":"2025-06-16T05:03:58.304Z","repository":{"id":150510684,"uuid":"623124577","full_name":"axodotdev/axocli","owner":"axodotdev","description":"🚃 lib for CLI utilities, printing, and error handling","archived":false,"fork":false,"pushed_at":"2024-09-23T10:14:58.000Z","size":145,"stargazers_count":13,"open_issues_count":12,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-09T23:58:56.603Z","etag":null,"topics":["builder","cli","error-handling","utils"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/axodotdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE-APACHE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-03T18:41:21.000Z","updated_at":"2024-11-26T06:33:21.000Z","dependencies_parsed_at":"2024-06-25T17:37:21.683Z","dependency_job_id":"1387bac2-a14a-48ba-8b49-c9544673fc88","html_url":"https://github.com/axodotdev/axocli","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/axodotdev/axocli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axodotdev%2Faxocli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axodotdev%2Faxocli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axodotdev%2Faxocli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axodotdev%2Faxocli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/axodotdev","download_url":"https://codeload.github.com/axodotdev/axocli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axodotdev%2Faxocli/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260101784,"owners_count":22959037,"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":["builder","cli","error-handling","utils"],"created_at":"2024-11-08T13:22:47.496Z","updated_at":"2025-06-16T05:03:58.258Z","avatar_url":"https://github.com/axodotdev.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# axocli\n\n[![crates.io](https://img.shields.io/crates/v/axocli.svg)](https://crates.io/crates/axocli)\n[![docs](https://docs.rs/axocli/badge.svg)](https://docs.rs/axocli)\n[![Rust CI](https://github.com/axodotdev/axocli/workflows/Rust%20CI/badge.svg?branch=main)](https://github.com/axodotdev/axocli/actions/workflows/ci.yml)\n\nCommon code for setting up a CLI App and handling errors/printing.\n\n\n## Example\n\nSee [examples/axoapp.rs](https://github.com/axodotdev/axocli/blob/main/examples/axoapp.rs) for a walkthrough/example.\n\nSome various interesting example invocations to play with: \n\n```sh\n# clap help\ncargo run --example axoapp -- --help\n\n# success\ncargo run --example axoapp -- 5\ncargo run --example axoapp -- 5 --output-format=json\n\n# normal error\ncargo run --example axoapp -- 2\ncargo run --example axoapp -- 2 --output-format=json\n\n# panic (setting RUST_BACKTRACE=1 here is also interesting)\ncargo run --example axoapp -- 0\ncargo run --example axoapp -- 0 --output-format=json\n\n# clap error\ncargo run --example axoapp --\n```\n\n\n## What Does It Do?\n\nFirst off, it handles setting up:\n\n* a tracing subscriber (currently the kind that cargo-dist uses, more work needed for oranda's use)\n* a miette formatter (so we can have a shared Look And Feel)\n* a panic handler (to get more control over output if the app panics)\n* (not implemented but likely in the future) a tokio runtime\n\nIt also handles printing top-level errors, notably including a json_errors mode where the error gets formatted to json and printed to stdout, while still printing a human-friendly version to stderr. This is done for both an error returned from real_main and panics. So anything expecting machine-readable output from our apps will not freak out and get something unparseable when things error/panic. It will also set the process exit code on error (with std::process::exit, on the assumption that all cleanup was done when we returned/panicked out of real_main).\n\nIt also exposes the json diagnostic formatting machinery so you can Write them wherever or turn them into serde_json::Values. This is useful for\nreturning a larger result with diagnostics nested inside of it (say, for reporting warnings).\n\n\n## License\n\nLicensed under either of\n\n* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or [apache.org/licenses/LICENSE-2.0](https://www.apache.org/licenses/LICENSE-2.0))\n* MIT license ([LICENSE-MIT](LICENSE-MIT) or [opensource.org/licenses/MIT](https://opensource.org/licenses/MIT))\n\nat your option.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxodotdev%2Faxocli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faxodotdev%2Faxocli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxodotdev%2Faxocli/lists"}