मुख्य सामग्री पर जाएँ
Skillpedia
सामान्य कोडिंग33k · #8795

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 पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/development/rust-cli-builder/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

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.toml and check current dependencies (clap version, serde, tokio, etc.)
  • Locate the CLI entry point (src/main.rs or src/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.rs separating 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.toml with custom settings
  • Check for rust-toolchain.toml to 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:

  1. Project structure — Cargo.toml dependencies, src/ file layout
  2. CLI definition — clap derive structs for all commands, args, and flags
  3. Config loading — config file format and merge strategy with CLI args
  4. Core logic — main functions for each subcommand, separated from CLI layer
  5. Error types — error enum or anyhow usage, user-facing error messages
  6. 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.

repo: davila7/claude-code-templates

लोकप्रियता

GitHub स्टार
33k
रैंकिंग में स्थान
#8795
लाइसेंस
MIT
अपडेट की गई
2/11/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

owasp-security

33k

आपके एजेंट को वेब ऐप, API, मोबाइल, कंटेनर और AI एजेंट्स के लिए OWASP सुरक्षा मार्गदर्शन सिखाती है, ताकि वह आम कमज़ोरियाँ पहचान सके और सुधार सुझा सके।

कोडिंगसिक्योरिटी

agent-management

33k

आपके एजेंट को AI Maestro कमांड-लाइन से AI एजेंट बनाने, सूची देखने, hibernate और wake करने, नाम बदलने और हटाने देती है, हर एजेंट के जीवन-चक्र को संभालते हुए।

AI और एजेंटएजेंट

agent-messaging

33k

Agent Messaging Protocol का उपयोग करके AI एजेंट्स के बीच हस्ताक्षरित संदेश भेजने, प्राप्त करने और उनका जवाब देने देती है, ज़्यादातर आपकी अपनी मशीन पर।

AI और एजेंटएजेंट

docs-search

33k

आपके एजेंट को फ़ंक्शन सिग्नेचर, क्लास परिभाषा और कमेंट के लिए ऑटो-जनरेटेड कोड डॉक्यूमेंटेशन खोजने देती है, ताकि कोड बदलने से पहले वह असली API जाँच सके।

कोडिंगसामान्य कोडिंग

मिलती-जुलती skills