cli-ops
БесплатноЗапускает вложенные скриптыНе проверенPatterns for building production-quality CLI tools with predictable behavior, parseable output, and agentic workflows. Triggers: cli tool, command line tool…
от 0xDarkMatter★ 86 звёзд на GitHubОб этом скилле
CLI Patterns for Agentic Workflows
Patterns for building CLI tools that AI assistants and power users can chain, parse, and rely on.
Philosophy
Build CLIs for agentic workflows - AI assistants and power users who chain commands, parse output programmatically, and expect predictable behavior.
Core Principles
| Principle | Meaning | Why It Matters |
|---|---|---|
| Self-documenting | --help is comprehensive and always current |
LLMs discover capabilities without external docs |
| Predictable | Same patterns across all commands | Learn once, use everywhere |
| Composable | Unix philosophy - do one thing well | Tools chain together naturally |
| Parseable | --json always available, always valid |
Machine consumption without parsing hacks |
| Quiet by default | Data only, no decoration unless requested | Scripts don't break on unexpected output |
| Fail fast | Invalid input = immediate error | No silent failures or partial results |
Design Axioms
- stdout is sacred - Only data. Never progress, never logging, never decoration.
- stderr is for humans - Progress bars, colors, tables, warnings live here.
- Exit codes have meaning - Scripts can branch on failure mode.
- Help includes examples - The fastest path to understanding.
- JSON shape is predictable - Same structure across all commands.
Command Architecture
Structural Pattern
<tool> [global-options] <resource> <action> [options] [arguments]
Every CLI follows this hierarchy:
<tool>
├── --version, --help # Global flags
├── auth # Authentication (if required)
│ ├── login
│ ├── status
│ └── logout
└── <resource> # Domain resources (plural nouns)
├── list # Get many
├── get <id> # Get one by ID
├── create # Make new (if supported)
├── update <id> # Modify existing (if supported)
├── delete <id> # Remove (if supported)
└── <custom-action> # Domain-specific verbs
Naming Conventions
| Element | Convention | Valid Examples | Invalid Examples |
|---|---|---|---|
| Tool name | lowercase, 2-12 chars | mytool, datactl |
MyTool, my-tool-cli |
| Resource | plural noun, lowercase | invoices, users |
Invoice, user |
| Action | verb, lowercase | list, get, sync |
listing, getter |
| Long flags | kebab-case | --dry-run, --output-format |
--dryRun, --output_format |
| Short flags | single letter | -n, -q, -v |
-num, -quiet |
Standard Resource Actions
| Action | HTTP Equiv | Returns | Idempotent |
|---|---|---|---|
list |
GET /resources | Array | Yes |
get <id> |
GET /resources/:id | Object | Yes |
create |
POST /resources | Created object | No |
update <id> |
PATCH /resources/:id | Updated object | Yes |
delete <id> |
DELETE /resources/:id | Confirmation | Yes |
search |
GET /resources?q= | Array | Yes |
Flags & Options
Mandatory Flags
Every command MUST support:
| Flag | Short | Behavior | Output |
|---|---|---|---|
--help |
-h |
Show help with examples | Help text to stdout, exit 0 |
--json |
Machine-readable output | JSON to stdout |
Root command MUST additionally support:
| Flag | Short | Behavior | Output |
|---|---|---|---|
--version |
-V |
Show version | <tool> <version> to stdout, exit 0 |
Recommended Flags
| Flag | Short | Type | Purpose | Default |
|---|---|---|---|---|
--quiet |
-q |
bool | Suppress non-essential stderr | false |
--verbose |
-v |
bool | Increase detail level | false |
--dry-run |
bool | Preview without executing | false | |
--limit |
-n |
int | Max results to return | 20 |
--output |
-o |
path | Write output to file | stdout |
--format |
-f |
enum | Output format | varies |
Flag Behavior Rules
- Boolean flags take no value:
--jsonnot--json=true - Short flags can combine:
-vqequals-v -q - Unknown flags are errors: Never silently ignore
- Repeated flags: Last value wins (or error if inappropriate)
Output Specification
Stream Separation
This is the most critical rule:
| Stream | Content | When |
|---|---|---|
| stdout | Data only | Always |
| stderr | Everything else | Interactive mode |
stdout receives:
- JSON when
--jsonis set - Minimal text output when interactive
- Nothing else. Ever.
stderr receives:
- Progress indicators (spinners, bars)
- Status messages ("Fetching...", "Done")
- Warnings
- Rich formatted tables
- Colors and decoration
- Debug information (
--verbose)
Interactive Detection
import sys
def is_interactive() -> bool:
"""T
Установить cli-ops в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadWriteEditВложенные файлы
FAQ
Что делает скилл cli-ops?
Patterns for building production-quality CLI tools with predictable behavior, parseable output, and agentic workflows. Triggers: cli tool, command line tool, build cli, cli patterns, agentic cli, cli design, typer cli, click cli.
Как установить скилл cli-ops?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл cli-ops запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
frontend-design
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
от Anthropicwebapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
от Anthropicbrand-guidelines
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
от Anthropicweb-artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…
от Anthropic