📜 Cirious Codex Derive
Declarative CLI & Configuration Framework for the Cirious Ecosystem
Robust, type-safe, and high-performance argument parsing built on procedural macros.
📖 Overview
Cirious Codex Derive replaces complex, third-party CLI parsing crates with a custom, high-performance macro engine.
⚙️ Supported Attributes
| Attribute | Type | Description |
|---|---|---|
aliase |
String |
Short flag (e.g., "p" becomes /p) |
command |
String |
Long flag (e.g., "port" becomes /port) |
default_value |
String |
Fallback value if the flag is absent |
⚡ Quick Start
use ;
// 1. Define global arguments that will be injected into every command
// 2. Define a trait to access these global arguments (required by the derive)
// 3. Derive CodexParser and CodexCommand
Run it:
# Using short flags
# Using long flags
# Using defaults (missing flags get filled)
🚧 Development Roadmap
✅ v0.1.0 — Foundation & CLI Core
- Setup
proc-macroworkspace architecture (syn,quote,proc-macro2). - Implement foundational traits and attribute parsing logic.
- Develop
#[derive(CodexParser)]and#[derive(CodexCommand)]to replace third-party CLI parsing. - Strict terminal argument validation and custom compilation errors.
✅ v0.2.0 — Subcommands & Globals
- Implement
#[derive(CodexSubcommand)]for Enum routing. - Automatic injection and flattening of
GlobalArgs(--config,--verbose). - Implementation of custom error formatting tailored for the terminal.
🔭 v0.3.0 — Intelligent Developer Experience (DX)
- Fuzzy Suggestion Engine: Implement Levenshtein-based command correction to suggest valid commands upon typos (e.g., "Did you mean /build?").
- Automated Documentation (/help): Develop CodexHelp to automatically generate CLI interface manuals by harvesting doc comments (///) and metadata.
- Custom Validation Hooks: Create an extensible attribute system (e.g., #[codex(validate = "my_func")]) for custom logic like port ranges, path existence, or Regex patterns.
- Performance Optimization: Refactor TokenStream generation and procedural macro expansion to reduce compilation overhead and binary size.
- Exit-Code Idioms: Transition from std::process::exit to idiomatic std::process::ExitCode for better integration with shell scripting pipelines.
📜 License
Licensed under either of the following, at your option:
- MIT License
- Apache License 2.0
Minimalist by design. Consistent in execution.
Engineered by Cirious Studio