rust-cli-builder
यह क्या करती है
यह स्किल आपके AI एजेंट को Rust में कमांड-लाइन टूल बनाने में मदद करती है। यह उन डेवलपर्स के लिए है जो नया CLI बना रहे हैं या किसी मौजूदा CLI में सबकमांड, कॉन्फ़िग फ़ाइल और साफ़ आउटपुट जोड़ना चाहते हैं।
कब इस्तेमाल करें
- ✓जब आप शुरू से नया Rust कमांड-लाइन टूल बनाना चाहते हैं।
- ✓जब आपको किसी मौजूदा Rust CLI में सबकमांड जोड़ने हैं।
- ✓जब आप Rust टूल में कॉन्फ़िग फ़ाइल लोड करना या रंगीन आउटपुट चाहते हैं।
Skill का लिंक
https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/development/rust-cli-builder/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“एक Rust CLI बनाइए जो CSV फ़ाइलों को JSON में बदले, और डिफ़ॉल्ट विकल्पों के लिए एक कॉन्फ़िग फ़ाइल हो।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट पहले मौजूदा प्रोजेक्ट को देखता है, फिर कमांड, इनपुट-आउटपुट फ़ॉर्मेट और टूल को बाँटने के तरीके के बारे में सवाल पूछता है। उसके बाद वह clap, एरर हैंडलिंग और कॉन्फ़िग सपोर्ट के साथ कोड लिखता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Rust CLI Tool Builder
When to use
Use this skill when you need to:
- Scaffold a new Rust CLI tool from scratch with clap
- Add subcommands to an existing CLI application
- Implement config file loading (TOML/JSON/YAML)
- Set up proper error handling with anyhow/thiserror
- Add colored and formatted terminal output
- Structure a CLI project for distribution via cargo install or GitHub releases
Phase 1: Explore (Plan Mode)
Enter plan mode. Before writing any code, explore the existing project:
If extending an existing project
- Find
Cargo.tomland check current dependencies (clap version, serde, tokio, etc.) - Locate the CLI entry point (
src/main.rsorsrc/cli.rs) - Check if clap is using derive macros or builder pattern
- Identify existing subcommand structure
- Look for existing error types, config structs, and output formatting
- Check if there's a
src/lib.rsseparating library logic from CLI
If starting from scratch
- Check the workspace for any existing Rust projects or workspace
Cargo.toml - Look for a
.cargo/config.tomlwith custom settings - Check for
rust-toolchain.tomlto know the target Rust edition
Phase 2: Interview (AskUserQuestion)
Use AskUserQuestion to clarify requirements. Ask in rounds.
Round 1: Tool purpose and commands
Question: "What kind of CLI tool are you building?"
Header: "Tool type"
Options:
- "Single command (like ripgrep, curl)" — One main action with flags and arguments
- "Multi-command (like git, cargo)" — Multiple subcommands under one binary
- "Interactive REPL (like psql)" — Persistent session with a prompt loop
- "Pipeline tool (like jq, sed)" — Reads stdin, transforms, writes stdout
Question: "What will the tool operate on?"
Header: "Input"
Options:
- "Files/directories" — Read, process, or generate files
- "Network/API" — HTTP requests, TCP connections, API calls
- "System resources" — Processes, hardware info, OS config
- "Data streams (stdin/stdout)" — Pipe-friendly text/binary processing
Round 2: Subcommands (if multi-command)
Question: "Describe the subcommands you need (e.g., 'init', 'build', 'deploy')"
Header: "Commands"
Options:
- "2-3 subcommands (I'll describe them)" — Small focused tool
- "4-8 subcommands with groups" — Medium tool, may need command groups
- "I have a rough list, help me design the API" — Collaborative command design
Round 3: Configuration and output
Question: "How should the tool be configured?"
Header: "Config"
Options:
- "CLI flags only (Recommended)" — All config via command-line arguments
- "Config file (TOML)" — Load defaults from ~/.config/toolname/config.toml
- "Config file + CLI overrides" — Config file for defaults, flags override specific values
- "Environment variables + flags" — Env vars for secrets, flags for everything else
Question: "What output format does the tool need?"
Header: "Output"
Options:
- "Human-readable (colored text)" — Pretty terminal output with colors and formatting
- "Machine-readable (JSON)" — Structured output for piping to other tools
- "Both (--format flag)" — Default human, --json or --format=json for machines
- "Minimal (exit codes only)" — Success/failure via exit code, errors to stderr
Round 4: Async and error handling
Question: "Does the tool need async operations?"
Header: "Async"
Options:
- "No — synchronous is fine (Recommended)" — File I/O, computation, simple operations
- "Yes — tokio (network I/O)" — HTTP requests, concurrent connections, async file I/O
- "Yes — tokio multi-threaded" — Heavy parallelism, multiple concurrent tasks
Question: "How should errors be presented to users?"
Header: "Errors"
Options:
- "Simple messages (anyhow) (Recommended)" — Human-readable error chains, good for most CLIs
- "Typed errors (thiserror)" — Custom error enum with specific variants for each failure
- "Both (thiserror for lib, anyhow for bin)" — Library code is typed, CLI wraps with anyhow
Phase 3: Plan (ExitPlanMode)
Write a concrete implementation plan covering:
- Project structure —
Cargo.tomldependencies,src/file layout - CLI definition — clap derive structs for all commands, args, and flags
- Config loading — config file format and merge strategy with CLI args
- Core logic — main functions for each subcommand, separated from CLI layer
- Error types — error enum or anyhow usage, user-facing error messages
- Output formatting —
अक्सर पूछे जाने वाले सवाल
क्या कोड लिखने से पहले सवाल पूछे जाते हैं?
हाँ, स्किल पहले आपके साथ योजना बनाती है, जिसमें कमांड, फ़ॉर्मेट और वितरण शामिल हैं।
कौन-सी आर्गुमेंट लाइब्रेरी इस्तेमाल होती है?
यह कमांड-लाइन आर्गुमेंट पढ़ने के लिए clap इस्तेमाल करती है।
टूल को कैसे बाँटा जा सकता है?
स्किल cargo install या GitHub releases के ज़रिए वितरण को कवर करती है।
जानकारी
लेखक का मूल विवरण
Plan and build production-ready Rust CLI tools using clap for argument parsing, with subcommands, config file support, colored output, and proper error handling. Uses interview-driven planning to clarify commands, input/output formats, and distribution strategy before writing any code.
लोकप्रियता
- GitHub स्टार
- 33k
- रैंकिंग में स्थान
- #8795
- लाइसेंस
- MIT
- अपडेट की गई
- 2/11/2026
कमेंट
- …
इस repository की और skills
owasp-security
33kआपके एजेंट को वेब ऐप, API, मोबाइल, कंटेनर और AI एजेंट्स के लिए OWASP सुरक्षा मार्गदर्शन सिखाती है, ताकि वह आम कमज़ोरियाँ पहचान सके और सुधार सुझा सके।
agent-management
33kआपके एजेंट को AI Maestro कमांड-लाइन से AI एजेंट बनाने, सूची देखने, hibernate और wake करने, नाम बदलने और हटाने देती है, हर एजेंट के जीवन-चक्र को संभालते हुए।
agent-messaging
33kAgent Messaging Protocol का उपयोग करके AI एजेंट्स के बीच हस्ताक्षरित संदेश भेजने, प्राप्त करने और उनका जवाब देने देती है, ज़्यादातर आपकी अपनी मशीन पर।
docs-search
33kआपके एजेंट को फ़ंक्शन सिग्नेचर, क्लास परिभाषा और कमेंट के लिए ऑटो-जनरेटेड कोड डॉक्यूमेंटेशन खोजने देती है, ताकि कोड बदलने से पहले वह असली API जाँच सके।
मिलती-जुलती skills
diffs
394kयह आपके एजेंट को बदलावों का असली diff बनाने देती है, जिसे व्यूअर लिंक या इमेज फ़ाइल के रूप में साझा किया जा सकता है, हाथ से लिखे सारांश के बजाय।
coding-agent
394kयह आपके एजेंट को बड़े कोडिंग काम Codex, Claude Code या OpenCode को बैकग्राउंड वर्कर के रूप में सौंपने, फिर उसकी प्रगति जांचने में मदद करती है।
gh-issues
394kयह आपके एजेंट को GitHub issues खोजने, उनमें से काम करने लायक चुनने, और सुधार के साथ pull requests खोलने में मदद करती है, जिसमें समीक्षा टिप्पणियों का फ़ॉलो-अप भी शामिल है।