{"id":50844534,"url":"https://github.com/godaddy/cli-engine","last_synced_at":"2026-06-14T08:33:46.110Z","repository":{"id":359667204,"uuid":"1245085635","full_name":"godaddy/cli-engine","owner":"godaddy","description":"Rust framework for building consistent, domain-oriented CLI applications with command modules, middleware, auth, structured output, schemas, guides, search, and transport helpers.","archived":false,"fork":false,"pushed_at":"2026-06-12T19:58:53.000Z","size":365,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-14T08:33:45.237Z","etag":null,"topics":[],"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/godaddy.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-05-20T22:34:39.000Z","updated_at":"2026-06-12T19:58:49.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/godaddy/cli-engine","commit_stats":null,"previous_names":["godaddy/cli-engine"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/godaddy/cli-engine","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/godaddy%2Fcli-engine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/godaddy%2Fcli-engine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/godaddy%2Fcli-engine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/godaddy%2Fcli-engine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/godaddy","download_url":"https://codeload.github.com/godaddy/cli-engine/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/godaddy%2Fcli-engine/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34315072,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-14T02:00:07.365Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2026-06-14T08:33:46.015Z","updated_at":"2026-06-14T08:33:46.105Z","avatar_url":"https://github.com/godaddy.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cli-engine\n\n`cli-engine` is a Rust library for building consistent, domain-oriented CLI applications. It provides shared framework pieces for command registration, authentication, authorization hooks, middleware, structured output, schemas, guides, search, command tree rendering, and HTTP transport.\n\nConsumer CLIs bring their own binary entrypoint and domain modules. `cli-engine` owns the common\nexecution pipeline so teams can add commands by copying a nearby command and filling in the\ndomain-specific details.\n\n## Quick Start\n\n```rust\nuse std::process::ExitCode;\n\nuse clap::Arg;\nuse cli_engine::{\n    BuildInfo, Cli, CliConfig, CommandResult, CommandSpec, GroupSpec, Module, RuntimeCommandSpec,\n    RuntimeGroupSpec,\n};\nuse serde_json::json;\n\n#[tokio::main]\nasync fn main() -\u003e ExitCode {\n    let list = RuntimeCommandSpec::new(\n        CommandSpec::new(\"list\", \"List projects\")\n            .with_system(\"projects-api\")\n            .with_default_fields(\"id,name,status\")\n            .with_arg(Arg::new(\"team\").long(\"team\").required(true))\n            .no_auth(true),\n        async |_credential, args| {\n            let team = args\n                .get(\"team\")\n                .and_then(|value| value.as_str())\n                .unwrap_or_default();\n\n            Ok(CommandResult::new(json!([\n                { \"id\": \"project-1\", \"name\": \"Portal\", \"status\": \"active\", \"team\": team }\n            ])))\n        },\n    );\n\n    let module = Module::new(\"Platform Systems\", move |_context| {\n        RuntimeGroupSpec::new(GroupSpec::new(\"project\", \"Manage projects\"))\n            .with_command(list.clone())\n    });\n\n    let cli = Cli::new(\n        CliConfig::new(\"example\", \"Example cli-engine application\", \"example\")\n            .with_build(BuildInfo::new(env!(\"CARGO_PKG_VERSION\")))\n            .with_module(module),\n    );\n\n    cli.execute().await\n}\n```\n\nCommand paths are colon-separated, such as `project:list`, for policy, schema, audit, activity, and\nauthorization metadata.\n\n## Guide Embedding\n\nGuide markdown can be read from disk during development with `parse_guides(\"guides\")`, or embedded\nin the consumer CLI binary with standard Rust compile-time embedding:\n\n```rust\nuse cli_engine::Module;\n\nlet module = Module::new(\"Platform Systems\", register).with_guides_from_markdown([\n    (\"guides/deploy.md\", include_bytes!(\"../guides/deploy.md\").as_slice()),\n    (\"guides/operate.md\", include_bytes!(\"../guides/operate.md\").as_slice()),\n]);\n```\n\nFor large guide directories, applications can use an embedding crate or a `build.rs` generated\nmanifest that produces the same `(path, bytes)` pairs.\n\n## Output formats\n\nCommands render as `json`, `toon`, or `human`. The default is **context-aware**:\nan interactive terminal gets `human` output, while pipes, files, CI, and most\nagents (anything where stdout is not a TTY) get `json`. The resolved format is\nchosen by this precedence (highest first):\n\n1. An explicit flag on the invocation — `--output \u003cjson|toon|human\u003e`, or the\n   `--json` / `--toon` / `--human` shorthands.\n2. The `${APP_ID}_OUTPUT` environment variable (e.g. `GODADDY_OUTPUT=json`,\n   `GDX_OUTPUT=json`). The name is derived from the app id (upper-cased,\n   non-alphanumerics replaced with `_`). The value is case-insensitive; blank or\n   unrecognized values are ignored and fall through to the TTY policy.\n3. The TTY policy: `human` on an interactive terminal, `json` otherwise.\n\nThis keeps a human at a terminal from getting a wall of JSON while machine\ncallers still get JSON automatically. An agent running in a PTY (which reads as\ninteractive) can force machine output with either the env variable or an\nexplicit flag. Streaming commands always emit newline-delimited JSON regardless\nof the resolved format.\n\n## Documentation\n\n- [Concepts](docs/concepts.md)\n- [Design](docs/design.md)\n- [Authentication and transport](docs/auth.md)\n- [Basic example](examples/basic.rs)\n- [Agent instructions](AGENTS.md)\n\n## Cargo Features\n\n| Feature | Description |\n| --- | --- |\n| `pkce-auth` | Enables `auth::pkce::PkceAuthProvider`, a built-in browser-based OAuth 2.0 PKCE flow with system keychain storage via the `keyring` crate. Adds optional dependencies: `keyring`, `open`, `rand`, `sha2`, `url`. |\n\n## Verification\n\n```sh\ncargo fmt --all --check\ncargo check --all-targets\ncargo clippy --all-targets -- -D warnings\ncargo test --all-targets\nRUSTDOCFLAGS='-D warnings' cargo doc --no-deps\ncargo test --doc\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgodaddy%2Fcli-engine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgodaddy%2Fcli-engine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgodaddy%2Fcli-engine/lists"}