Token导航 LogoToken导航

Agent Skill · 研究检索

better-cli(better CLI 搜索)

better-cli 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

better-cli 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 54,588。

总安装 507周安装 17GitHub Stars 5下载 140核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:better-cli(better CLI 搜索)
来源仓库:https://github.com/yogin16/better-cli
仓库路径:skills/better-cli
安装命令:
npx skills add https://github.com/yogin16/better-cli --skill better-cli
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/yogin16/better-cli --skill better-cli

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

用于构建面向人类终端用户和 AI Agent 的命令行工具,强调结构化输出与可靠性。适用于创建具有子命令、标志位和清晰输出的 CLI 程序。提供人类友好与自动化友好的正交设计原则,兼顾易用性与稳定性。使用前应明确目标语言、子命令定义及输出格式规范。

better-cli 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/better-cli

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/yogin16/better-cli --skill better-cli;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

better-cli 怎么安装?

在终端执行 npx skills add https://github.com/yogin16/better-cli --skill better-cli。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

better-cli 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

better-cli 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

better-cli 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

better-cli 用的人多吗?

公开数据是累计安装 507 次,近一周安装 17 次,下载 140 次,GitHub 5 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

better-cli 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
better-cli

better CLI 搜索 · 本页

5075接触敏感数据未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Better CLI: Build CLIs for Humans and AI Agents

Build command-line tools that are delightful for humans at a terminal AND reliable for AI agents in automation pipelines. These goals are orthogonal, not conflicting.

This skill targets command-based CLIs (think git, docker, gh, kubectl) — tools with subcommands, flags, and structured output. It is not about full-screen TUI applications or interactive dashboards.

When to Use

  • Building a new CLI tool in any language
  • Improving or refactoring an existing CLI to be more human- and agent-friendly
  • Adding commands, flags, or output formats to an existing CLI
  • Reviewing CLI code for usability, composability, or agent-readiness

NOT for: TUI/full-screen terminal apps, GUI applications, REST/GraphQL API design, shell scripting

Core Philosophy

Human DX optimizes for discoverability and forgiveness. Agent DX optimizes for predictability and defense-in-depth. A great CLI does both.

The Golden Rule: Output that tells you what to do next. Every command's output — success or failure — should give the user (human or AI agent) enough context to know what their next action should be. An agent reading your CLI's output should be able to continue its workflow without guessing.

flowchart LR
  H[Human at Terminal] --> TTY{stdout is TTY?}
  A[AI Agent] --> TTY
  TTY -->|Yes| RICH[Rich: colors, tables,\nprogress bars, prompts]
  TTY -->|No| CLEAN[Clean: JSON, no ANSI,\nno prompts, parseable]
  RICH --> CORE[Same data, same exit codes,\nsame semantics]
  CLEAN --> CORE

The Rules (Priority Order)

P0: Critical — Every CLI Must Do These

1. stdout for data, stderr for everything else
stdout  ->  primary output (results, JSON, file contents) — for piping
stderr  ->  errors, warnings, progress, diagnostics, prompts — for humans

This is the single most important rule. It enables piping, redirection, and agent parsing. Never mix.

2. Exit 0 on success, non-zero on failure

Use semantic exit codes so scripts and agents can branch on failure type:

CodeMeaningWhen to Use
0SuccessOperation completed
1General failureCatch-all error
2Usage errorBad arguments, unknown flags
3Resource not foundFile, user, service missing
4Permission deniedAuth failure, insufficient rights
5ConflictResource already exists
75Temporary failureNetwork timeout — retry may help
78Configuration errorMissing or invalid config

Document your exit codes. The transient distinction (75 vs others) is critical — agents use it to decide whether to retry.

3. Support --json for structured output

Every command that produces output MUST support --json (or --output json). Use a consistent envelope:

{
  "status": "ok",
  "data": { "id": "abc-123", "name": "my-resource" },
  "warnings": []
}

Same shape for every command. Agents parse it once, use it everywhere. Treat this as a versioned API contract — adding optional fields is safe; removing or renaming fields is a breaking change.

4. Output must guide the next action

This is the key to making CLIs work for AI agents. Every command output should be interpretable and navigable — the reader should know what to do next without guessing.

On success — confirm what happened and suggest next steps:

Created deployment 'web-app' (ID: deploy-xyz)

Next steps:
  View logs:      mycli logs deploy-xyz
  Check status:   mycli status deploy-xyz

On failure — explain what went wrong and how to fix it:

Error: Cannot deploy — 2 failing health checks.

Fix: mycli health check web-app --verbose
     mycli deploy --env staging --force   (skip health checks)

On partial results — indicate what's missing and how to get more:

Showing 20 of 142 results. Next page: mycli list --cursor eyJpZCI6IDIwfQ==

This pattern is what makes an agent autonomous — it reads the output, sees the suggested command, and executes it. Without this, agents stall or hallucinate next steps.

5. Support --help and --version

--help must include: description, usage pattern, flag list with types and defaults, and 2-3 realistic examples. Examples are the most-read section — lead with them.

EXAMPLES
  $ mycli deploy --env staging          Deploy to staging
  $ mycli deploy --env prod --dry-run   Preview production deployment
  $ mycli deploy --env prod --yes       Deploy without confirmation
6. Never require interactive input

Every interactive prompt MUST have a flag equivalent. If stdin is not a TTY, never prompt — fail with a clear error or use defaults.

Prompt TypeFlag Equivalent
Confirmation--yes / --force
Selection--type=value
Text input--name=value
Password--password-file=path or stdin pipe

An agent cannot type 'y' at a prompt. If your CLI hangs waiting for input, the agent's workflow is dead.

P1: High — What Separates Good from Great

7. Detect TTY and adapt

When stdout IS a TTY: colors, tables, progress bars, interactive prompts. When stdout is NOT a TTY: plain text, no ANSI codes, no spinners, no prompts.

Respect these environment signals:

SignalMeaning
NO_COLOR (any non-empty value)Suppress ANSI color
TERM=dumbMinimal terminal — no formatting
CI=trueRunning in CI — no interactive features
MYCLI_NO_INPUT=1App-specific non-interactive override
8. Errors must be actionable

Every error needs four components:

  1. What went wrong — the error itself
  2. Context — which resource, which operation, what input
  3. Fix — the exact command or action to resolve it
  4. Reference — docs URL or mycli help <topic>

Bad: Error: EACCES Good: Error: Cannot write to /etc/config — permission denied. Try: sudo mycli config set key=value

When --json is active, errors MUST be structured:

{
  "status": "error",
  "error": {
    "code": "AUTH_EXPIRED",
    "message": "API token has expired",
    "fix": "Run: mycli auth login --refresh",
    "transient": false
  }
}

The code field is machine-readable (agents branch on it). The transient field tells agents whether to retry.

9. Configuration precedence

Always: flags > env vars > project config > user config > defaults

LayerExampleUse Case
Flags--port 8080One-off override
Env varsMYCLI_PORT=8080CI/CD, containers
Project config.mycli.yaml in repo rootTeam-shared settings
User config~/.config/mycli/config.yamlPersonal defaults
DefaultsHardcodedSensible out-of-box

Never accept secrets via flags — they leak to ps output and shell history. Use env vars, config files, or --password-file.

10. Design for pipes and composition
  • Support --fields name,status,id to limit output columns (token efficiency for agents)
  • Support reading from stdin: cat ids.txt | mycli get --stdin
  • Use NDJSON (one JSON object per line) for streaming/paginated data
  • When creating resources, output the identifier so subsequent commands can chain
# This pipeline must work
mycli create --json | jq -r '.data.id' | xargs mycli deploy --id
11. Never break the existing contract

When improving an existing CLI, treat its current behavior as a contract. Users and scripts depend on it.

Breaking changes (NEVER do without a major version bump):

  • Removing or renaming flags, subcommands, or env vars
  • Changing exit codes for existing failure modes
  • Removing or renaming fields in --json output
  • Changing default behavior of existing commands
  • Changing positional argument order or meaning

Safe, additive changes (always OK):

  • Adding new flags with defaults that preserve old behavior
  • Adding new optional fields to JSON output
  • Adding new subcommands
  • Adding --json support where it didn't exist
  • Adding new exit codes for cases that previously returned 1
  • Adding --fields, --quiet, --dry-run as new flags

When in doubt, add, don't modify. Deprecate old behavior with warnings on stderr before removing it.

12. Flags over positional arguments

Flags are self-documenting, order-independent, and future-proof.

Bad: mycli deploy production v2.1.0 Good: mycli deploy --env production --version v2.1.0

One positional argument is fine (the "main thing" — file path, resource name). Two is suspicious. Three is wrong.

P2: Medium — Polish That Builds Trust

13. Show progress on stderr for long operations

For TTY: spinners, progress bars, ETA. For pipes: suppress entirely, or emit structured progress to stderr. Never send progress indicators to stdout — they corrupt data streams.

14. Support --dry-run for mutating commands

Show exactly what would change without doing it. With --json, output planned changes in structured format. This is an essential safety rail for AI agents — they can validate before executing.

15. Make operations idempotent

mycli config set key=value must be safe to run twice. Create commands should support --if-not-exists. Agents retry on transient failures — design for it.

16. Provide shell completions

Support bash, zsh, and fish via mycli completions <shell>. Most frameworks generate these automatically (Cobra, Click, oclif, clap).

17. Use consistent command grammar

Pick a pattern and stick to it across every command:

  • Noun-verb: mycli pod list, mycli pod delete (kubectl style)
  • Verb-noun: mycli list pods, mycli delete pod (docker style)

Standardize on common verbs: list, get/show, create, update, delete.

Agent-Readiness Decision Tree

When reviewing or building a CLI, walk through this:

flowchart TD
  START[New CLI command] --> OUT{Produces output?}
  OUT -->|Yes| JSON[Add --json with consistent envelope]
  OUT -->|No| EXIT[Ensure meaningful exit code]
  JSON --> MUT{Mutates state?}
  EXIT --> MUT
  MUT -->|Yes| DRY[Add --dry-run]
  MUT -->|No| PIPE{Usable in pipes?}
  DRY --> CONFIRM{Needs confirmation?}
  CONFIRM -->|Yes| FORCE[Add --yes/--force bypass]
  CONFIRM -->|No| IDEM[Make idempotent if possible]
  FORCE --> IDEM
  IDEM --> PIPE
  PIPE --> FIELDS[Add --fields for column selection]
  FIELDS --> ERR[Structured errors with code + fix + transient]
  ERR --> DONE[Agent-ready]

Anti-Patterns

Mixing data and diagnostics on stdout

Novice: "Print everything to stdout, users will see it" Expert: mycli list | jq. breaks if warnings are on stdout. Data to stdout. Everything else to stderr. No exceptions. Timeline: Unix convention since 1977. Still the #1 mistake in new CLIs.

Colors and ANSI in piped output

Novice: "Always show colors for better UX" Expert: ANSI escape sequences (\x1b[38;2;...m) are tokenized as text by LLMs, wasting context window and breaking parsing. Check isatty(stdout) and NO_COLOR before emitting any ANSI codes. Detection: Pipe output through cat -v — if you see ^[[ sequences, you have a bug.

Interactive prompts with no bypass

Novice: "Always confirm destructive operations for safety" Expert: Agents can't type 'y'. Every prompt MUST have a --yes/--force bypass. If stdin is not a TTY and no bypass flag is provided, fail with a clear error — never hang. Detection: Command hangs when run in CI or with stdin piped from /dev/null.

Printing nothing on success

Novice: "Unix tradition says silence means success" Expert: For humans, silence feels broken — show brief confirmation ("Created resource abc123"). For agents, silence is ambiguous — exit 0 and support --json to return the result. Use -q/--quiet for scripts that explicitly want silence.

Designing for humans OR machines, not both

Novice: "Our users are developers, they'll parse text" or "Just output JSON always" Expert: Detect context (TTY vs pipe) and adapt automatically. Human-readable by default in terminals, machine-readable when piped or when --json is passed. Both audiences are served by the same command.

Output that doesn't tell you what to do next

Novice: "Just print the result and exit" Expert: Every output is a signpost. On success, suggest the logical next command. On failure, suggest the fix command. On partial results, show how to get more. Agents depend on these cues to continue autonomously — without them, agents stall, retry blindly, or hallucinate commands. Detection: Run a command successfully and ask: "Does the output tell me what to do next?" If not, add a "Next steps" section.

Breaking existing CLI contracts while "improving" them

Novice: "This flag name is bad, let me rename it" or "Let me restructure the JSON output to be cleaner" Expert: Existing users and scripts depend on the current contract — flag names, exit codes, output shape, default behavior. Add new capabilities alongside the old ones. Deprecate with stderr warnings before removing. Renaming a flag or removing a JSON field can break thousands of downstream scripts and agent workflows. Detection: Any PR that removes, renames, or changes the type of an existing flag, exit code, or output field without a major version bump.

Verbose default output that wastes agent context

Novice: "More information is always better" Expert: A single vitest run generates 419KB of output. An agent needs 5 numbers. Support --fields to select columns, --quiet for minimal output, and --json for structured data. Every unnecessary byte in stdout costs the agent tokens.

Agent-Readiness Checklist

Quick audit for any CLI:

[ ] Every command supports --json with consistent envelope
[ ] stdout has ONLY data; stderr has everything else
[ ] Exit codes are semantic (not just 0/1)
[ ] Every prompt has a --yes / --force / --flag bypass
[ ] Errors include: code, message, fix suggestion, transient flag
[ ] --dry-run available for all mutating commands
[ ] Progress/spinners go to stderr, never stdout
[ ] NO_COLOR and TTY detection implemented
[ ] --fields flag limits output to requested columns
[ ] Create commands output the created resource identifier
[ ] Mutating commands are idempotent or have --if-not-exists
[ ] --help includes examples, not just flag descriptions
[ ] Secrets never accepted via flags (use env vars or files)
[ ] Piped output contains zero ANSI escape codes
[ ] Success output includes "next steps" with exact follow-up commands
[ ] Error output includes the exact command to fix or diagnose the issue
[ ] No debug traces or stack traces in default output (use --debug)
[ ] Existing flags, exit codes, and output fields are never removed or renamed (additive only)

References

Consult these for deep dives — they are NOT loaded by default:

FileConsult When
references/output-design.mdDesigning JSON envelopes, NDJSON streaming, field selection, output versioning, token-efficient formats
references/agent-patterns.mdUnderstanding how AI agents consume CLIs, MCP wrapping, schema introspection, dynamic tool discovery
references/error-handling.mdFull exit code tables (sysexits.h), structured error format specs, error taxonomy design
references/interactivity.mdTTY detection code samples (Node/Python/Go/Rust), NO_COLOR implementation, progress bar patterns, prompt design
references/composability.mdPipe-friendly patterns, stdin conventions, cross-command chaining, NDJSON streaming
references/discoverability.mdHelp text structure, shell completion generation, man pages, --help-json for agent introspection
references/security.mdSecret handling, input validation for agent contexts (path traversal, injection), permission scoping
references/testing.mdOutput contract testing, CLI integration test patterns, snapshot testing, schema validation in CI

平台分布

Codex

35.05%
按下载量换算49

Claude

27.99%
按下载量换算39

Cursor

18.89%
按下载量换算26

Gemini CLI

8.15%
按下载量换算11

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills