{"id":50645430,"url":"https://github.com/cirious-studio/cirious_codex_cli","last_synced_at":"2026-06-07T12:02:14.194Z","repository":{"id":363019918,"uuid":"1261669891","full_name":"cirious-studio/cirious_codex_cli","owner":"cirious-studio","description":"💻 A powerful framework for scaffolding rapid, highly-modular Command Line Interfaces with declarative argument parsing and seamless Codex ecosystem integration.","archived":false,"fork":false,"pushed_at":"2026-06-07T02:26:47.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-06-07T04:13:11.596Z","etag":null,"topics":["argument-parser","cli","command-line","command-line-interface","developer-tools","framework","routing","rust","scaffolding","terminal"],"latest_commit_sha":null,"homepage":"https://github.com/cirious-studio","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/cirious-studio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","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":null,"dco":null,"cla":null}},"created_at":"2026-06-07T02:08:47.000Z","updated_at":"2026-06-07T02:32:57.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/cirious-studio/cirious_codex_cli","commit_stats":null,"previous_names":["cirious-studio/cirious_codex_cli"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/cirious-studio/cirious_codex_cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cirious-studio%2Fcirious_codex_cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cirious-studio%2Fcirious_codex_cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cirious-studio%2Fcirious_codex_cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cirious-studio%2Fcirious_codex_cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cirious-studio","download_url":"https://codeload.github.com/cirious-studio/cirious_codex_cli/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cirious-studio%2Fcirious_codex_cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34020187,"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-07T02:00:07.652Z","response_time":124,"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":["argument-parser","cli","command-line","command-line-interface","developer-tools","framework","routing","rust","scaffolding","terminal"],"created_at":"2026-06-07T12:02:12.365Z","updated_at":"2026-06-07T12:02:14.176Z","avatar_url":"https://github.com/cirious-studio.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# 🚀 Cirious Codex CLI\n\n**Rapid Command Line Application Scaffolding for the Cirious Ecosystem**\n\n[![CI](https://github.com/cirious-studio/cirious_codex_cli/actions/workflows/ci.yml/badge.svg)](https://github.com/cirious-studio/cirious_codex_cli/actions/workflows/ci.yml) [![Crates.io](https://img.shields.io/crates/v/cirious_codex_cli.svg)](https://crates.io/crates/cirious_codex_cli) [![Docs.rs](https://docs.rs/cirious_codex_cli/badge.svg)](https://docs.rs/cirious_codex_cli) [![Language](https://img.shields.io/badge/Language-Rust-black?logo=rust)](https://www.rust-lang.org/) [![License](https://img.shields.io/badge/License-MIT%2FApache-blue.svg)](#-license)\n\n\u003c/div\u003e\n\n---\n\n## 📖 Overview\n\n**Cirious Codex CLI** is the premier entrypoint library for building powerful, production-ready Command Line Interfaces (CLIs) and microservices within the Cirious ecosystem.\n\nInstead of writing boilerplate code to parse arguments, instantiate loggers, and load environment configurations, `cirious_codex_cli` automates the entire bootstrapping process. It seamlessly connects `cirious_codex_config` and `cirious_codex_logger` out of the box, allowing you to focus purely on your business logic.\n\n---\n\n## ✨ Features\n\n- **Argument Parsing \u0026 Sub-command Routing**: Elegant, type-safe CLI definition via `clap` derive macros with automatic `--help` generation and strict validation.\n- **Automated Logger Bootstrapping**: The `--verbose` flag automatically switches the `cirious_codex_logger` between `Info` and `Debug` levels, with styled terminal output via `cirious_codex_term`.\n- **Automated Configuration Loading**: The `--config \u003cpath\u003e` flag triggers `cirious_codex_config` to read, parse, and merge the configuration file with environment variables, delivering a strongly-typed struct to your handler.\n- **CLI Override Pattern**: Arguments passed directly in the terminal can seamlessly override values from the configuration file, following the standard 12-factor app methodology.\n- **Ecosystem Integration**: Built to leverage the full power of the `cirious_codex` facade, including `CodexError` and `CodexOk`.\n\n---\n\n## 🚀 Quick Start\n\nAdd the following to your `Cargo.toml`:\n\n```toml\n[dependencies]\ncirious_codex_cli = \"0.1.1\"\nclap = { version = \"4.5\", features = [\"derive\"] }\nserde = { version = \"1.0\", features = [\"derive\"] }\n```\n\n### Example 1: Basic Routing\n\nDefine your CLI, implement the `CodexCommand` contract, and let the engine bootstrap everything.\n\n```rust\nuse cirious_codex_cli::{execute_cli_with_config, CodexCommand, GlobalArgs};\nuse clap::{Parser, Subcommand};\nuse serde::Deserialize;\n\n#[derive(Deserialize, Debug)]\nstruct MyConfig {\n    database_url: String,\n}\n\n#[derive(Parser, Debug)]\n#[command(name = \"my_app\")]\nstruct AppCLI {\n    #[command(flatten)]\n    global: GlobalArgs,\n\n    #[command(subcommand)]\n    command: Commands,\n}\n\n#[derive(Subcommand, Debug)]\nenum Commands {\n    Start { port: u16 },\n    Ping,\n}\n\nimpl CodexCommand for AppCLI {\n    fn global_args(\u0026self) -\u003e \u0026GlobalArgs {\n        \u0026self.global\n    }\n}\n\nfn main() {\n    execute_cli_with_config::\u003cAppCLI, MyConfig, _\u003e(|parsed_cli, app_config| {\n        if let Some(cfg) = app_config {\n            println!(\"Connecting to database: {}\", cfg.database_url);\n        }\n        match parsed_cli.command {\n            Commands::Start { port } =\u003e println!(\"Starting server on port {}\", port),\n            Commands::Ping =\u003e println!(\"Pong!\"),\n        }\n    });\n}\n```\n\nRun it:\n```bash\n# Standard mode (Info level logging)\ncargo run --example 01_basic_usage -- --config examples/resources/config.json start 8080\n\n# Verbose mode (Debug level logging)\ncargo run --example 01_basic_usage -- --verbose --config examples/resources/config.json start 8080\n```\n\n---\n\n### Example 2: Production Microservice (CLI Override Pattern)\n\n```rust\nuse cirious_codex_cli::{execute_cli_with_config, CodexCommand, GlobalArgs};\nuse clap::{Parser, Subcommand};\nuse serde::Deserialize;\n\n#[derive(Deserialize, Debug)]\nstruct MicroserviceConfig {\n    pub server_port: u16,\n    pub database_url: String,\n    pub worker_threads: usize,\n}\n\n#[derive(Parser, Debug)]\n#[command(name = \"auth_service\", version = \"1.0\", about = \"Cirious Authentication Microservice\")]\nstruct AuthCLI {\n    #[command(flatten)]\n    global: GlobalArgs,\n\n    #[command(subcommand)]\n    command: AuthCommands,\n}\n\n#[derive(Subcommand, Debug)]\nenum AuthCommands {\n    /// Starts the HTTP server\n    Serve {\n        /// Overrides the server port from the configuration file\n        #[arg(short, long)]\n        port: Option\u003cu16\u003e,\n    },\n    /// Runs database migrations\n    Migrate {\n        /// Drop all tables before migrating (DANGEROUS)\n        #[arg(long)]\n        reset: bool,\n    },\n    /// Starts a background worker\n    Worker,\n}\n\nimpl CodexCommand for AuthCLI {\n    fn global_args(\u0026self) -\u003e \u0026GlobalArgs {\n        \u0026self.global\n    }\n}\n\nfn main() {\n    execute_cli_with_config::\u003cAuthCLI, MicroserviceConfig, _\u003e(|cli, config_opt| {\n        let config = config_opt.expect(\"CRITICAL: A valid configuration file is required!\");\n\n        match cli.command {\n            AuthCommands::Serve { port } =\u003e {\n                // CLI argument overrides configuration file value\n                let active_port = port.unwrap_or(config.server_port);\n                println!(\"Starting HTTP Server on port {} ({} threads)\", active_port, config.worker_threads);\n            }\n            AuthCommands::Migrate { reset } =\u003e {\n                if reset { println!(\"WARNING: Dropping all tables!\"); }\n                println!(\"Executing SQL migrations...\");\n            }\n            AuthCommands::Worker =\u003e println!(\"Starting background job processor...\"),\n        }\n    });\n}\n```\n\nWith a `microservice.json` configuration file:\n```json\n{\n    \"server_port\": 3000,\n    \"database_url\": \"postgres://admin:pass@localhost:5432/cirious_auth\",\n    \"worker_threads\": 16\n}\n```\n\nRun it:\n```bash\n# Serve using port from config (3000)\ncargo run --example 02_robust_microservice -- --config examples/resources/microservice.json serve\n\n# Serve overriding port via CLI (8080 takes precedence)\ncargo run --example 02_robust_microservice -- --config examples/resources/microservice.json serve --port 8080\n\n# Run destructive migrations with verbose logging\ncargo run --example 02_robust_microservice -- --verbose --config examples/resources/microservice.json migrate --reset\n```\n\n---\n\n## 🚧 Current Status \u0026 Roadmap\n\n### ✅ v0.1.0 — Completed\n- [x] Design the argument parsing and sub-command routing API.\n- [x] Implement automatic initialization of `cirious_codex_logger` dispatchers based on CLI flags.\n- [x] Implement automated configuration loading bridging with `cirious_codex_config`.\n- [x] Create robust examples demonstrating rapid application scaffolding.\n- [x] Publish `cirious_codex_cli` to `crates.io` as a standalone crate.\n\n### 🔭 v0.2.0 — Planned\n\n- [ ] Add a global `init_cli!` macro for zero-boilerplate entrypoints.\n- [ ] Implement a `Result`-aware handler variant (`execute_cli_result`) that integrates with `CodexError`.\n- [ ] Add support for `APP_*` environment variable overrides via `cirious_codex_config`'s env prefix API.\n\n---\n\n## 📜 License\n\nLicensed under either of the following, at your option:\n\n* **[MIT License](LICENSE-MIT)**\n* **[Apache License 2.0](LICENSE-APACHE)**\n\n---\n\n\u003cdiv align=\"center\"\u003e\n  \u003ci\u003eMinimalist by design. Consistent in execution.\u003c/i\u003e\u003cbr\u003e\n  \u003csub\u003eEngineered by Cirious Studio\u003c/sub\u003e\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcirious-studio%2Fcirious_codex_cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcirious-studio%2Fcirious_codex_cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcirious-studio%2Fcirious_codex_cli/lists"}