dev-cli-development

Implement AIDB dev-cli commands and services with Click framework best practices.

19|2|Updated Dec 1, 2025
One-click install
npx skills add https://github.com/ai-debugger-inc/aidb --skill dev-cli-development
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dev-cli-development
Source: https://github.com/ai-debugger-inc/aidb/tree/main/.claude/skills/dev-cli-development
Command: npx skills add https://github.com/ai-debugger-inc/aidb --skill dev-cli-development

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Developing new command-line interface (CLI) tools or extending existing ones can be complex, requiring knowledge of framework patterns, service architecture, and proper error handling. This Skill provides a comprehensive guide to developing AIDB's dev-cli commands and services using the Click framework, ensuring consistency, reusability, and robust error management. It helps developers quickly build powerful CLI tools.

Core Features & Use Cases

  • Command & Service Development: Learn to create new CLI commands and encapsulate business logic in reusable services.
  • Click Framework Best Practices: Master decorator stacking, custom parameter types, and context injection for robust CLI design.
  • Unified Error Handling: Implement consistent error management across all CLI commands using @handle_exceptions.
  • Use Case: When you need to automate a repetitive development task, such as building all language adapters or running a specific test suite with custom parameters, use this skill to create a new dev-cli command that simplifies the operation for yourself and other developers.

Quick Start

Show me how to add a new dev-cli command with an option and register it.

Frequently Asked Questions about dev-cli-development

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a new CLI command in AIDB's dev-cli?

Create a new CLI command by defining a function with Click decorators in src/aidb_cli/, use @click.command() to register it, add options with @click.option(), and wire it into your command group. Encapsulate business logic in a BaseService-derived service class for reusability and testability.

What's the best way to handle errors consistently across CLI commands?

Use the @handle_exceptions decorator on your command functions to implement unified error handling across all CLI commands. This ensures consistent error reporting, proper exit codes, and aligns with AIDB's error management patterns.

How do I pass data between Click commands using context?

Use Click's context injection via @click.pass_context and ctx.obj to store and retrieve shared data between commands. This pattern integrates service instances and configuration state without coupling commands directly.

Can I use custom parameter types with Click in AIDB's CLI?

Yes, define custom Click parameter types to validate and transform user input before it reaches your command. AIDB's dev-cli supports dynamic parameter types for specialized input handling aligned with framework best practices.

How do I integrate Docker and test adapters into a new dev-cli command?

Wire Docker and test adapter systems through BaseService patterns and decorators in your command implementation. Use the CommandExecutor with hash-based cache invalidation and docker-compose generation workflows to automate complex development tasks.

Why should I encapsulate business logic in services rather than CLI commands?

Separating CLI command structure from business logic via BaseService classes creates reusable, testable, and maintainable code. Services can be called independently from other tools and remain decoupled from Click framework specifics.