cli-builder

cli-builder is a skill for Claude Code, Codex from eddiebelaval/squire. It costs 47 tokens per session (5,043 once invoked), scanned A, original, MIT.

A guide to building command-line programs, which are tools people run from a terminal by typing commands. It covers Node.js and Python libraries for arguments, prompts, progress displays, and terminal output.

In plain words
What is it for?
Use it to design command syntax, add interactive prompts, show progress, handle signals, and support help and version commands.
Why use it?
It helps avoid confusing commands, unclear errors, awkward input handling, and poor behaviour when tools are used in scripts or pipelines.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/eddiebelaval/squire/cli-builder
Any agent
npx skills add eddiebelaval/squire --skill cli-builder
Clone the repo
git clone --depth 1 https://github.com/eddiebelaval/squire

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for cli-builder

README.md
[![agentmods](https://agentmods.dev/badge/skills/eddiebelaval/squire/cli-builder.svg)](https://agentmods.dev/skills/eddiebelaval/squire/cli-builder)
Your own site
<a href="https://agentmods.dev/skills/eddiebelaval/squire/cli-builder"><img src="https://agentmods.dev/badge/skills/eddiebelaval/squire/cli-builder.svg" alt="Measured on agentmods" height="20"></a>
Per session 47 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,043 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00047 $0.05043
Opus 5 $0.00023 $0.02521
Sonnet 5 $0.00009 $0.01009
Haiku 4.5 $0.00005 $0.00504

Measured yesterday against content hash 984a05da3901, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

cli-builder scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/cli-builder/SKILL.md · 865 lines

How it starts

The opening of the file, as written. The whole thing — 865 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CLI Builder Skill

Core Workflows

Workflow 1: Primary Action

  1. Analyze the input and context
  2. Validate prerequisites are met
  3. Execute the core operation
  4. Verify the output meets expectations
  5. Report results

Overview

This skill helps you build professional command-line interfaces with excellent user experience. Covers argument parsing, interactive prompts, progress indicators, colored output, and cross-platform compatibility.

CLI Design Philosophy

Principles of Good CLI Design

  1. Predictable: Follow conventions users expect
  2. Helpful: Provide clear help text and error messages
  3. Composable: Work well with pipes and other tools
  4. Forgiving: Accept common variations in input

Design Guidelines

  • DO: Use conventional flag names (-v, --verbose, -h, --help)
  • DO: Provide meaningful exit codes
  • DO: Support --version and --help on all commands
  • DO: Use colors meaningfully (errors=red, success=green)
  • DON'T: Require interactive input when running in pipes
  • DON'T: Print to stdout when outputting errors
  • DON'T: Ignore signals (Ctrl+C should exit cleanly)

Node.js CLI Development

Project Setup

# Initialize CLI project
mkdir my-cli && cd my-cli
npm init -y

# Install core dependencies
npm install commander chalk ora inquirer

# Optional: TypeScript support
npm install -D typescript @types/node @types/inquirer ts-node

Package.json Configuration

{
  "name": "my-cli",
  "version": "1.0.0",
  "description": "A powerful CLI tool",
  "bin": {
    "mycli": "./bin/cli.js"
  },
  "files": [
    "bin",
    "dist"
  ],
  "scripts": {
    "build": "tsc",
    "dev": "ts-node src/cli.ts",
    "link": "npm link"
  },
  "engines": {
    "node": ">=18.0.0"
  }
}

Commander.js - Command Structure

// src/cli.ts
import { Command } from 'commander';
import { version } from '../package.json';

const program = new Command();

program
  .name('mycli')
  .description('A powerful CLI for doing awesome things')
  .version(version, '-v, --version', 'Display version number');

// Simple command
program
  .command('init')
  .description('Initialize a new project')
  .argument('[name]', 'Project name', 'my-project')
  .option('-t, --template <type>', 'Template to use', 'default')
  .option('--no-git', 'Skip git initialization')
  .option('-f, --force', 'Overwrite existing files')
  .action(async (name, options) => {
    console.log(`Creating project: ${name}`);
    console.log(`Template: ${options.template}`);
    console.log(`Git: ${options.git}`);
  });

// Command with subcommands
const config = program
  .command('config')
  .description('Manage configuration');

config
  .command('get <key>')
  .description('Get a configuration value')
  .action((key) => {
    console.log(`Getting config: ${key}`);
  });

config
  .command('set <key> <value>')
  .description('Set a configuration value')
  .action((key, value) => {
    console.log(`Setting ${key} = ${value}`);
  });

config
  .command('list')
  .description('List all configuration')
  .option('--json', 'Output as JSON')
  .action((options) => {
    if (options.json) {
      console.log(JSON.stringify({ key: 'value' }, null, 2));
    } else {
      console.log('key = value');
    }
  });

// Parse arguments
program.parse();

Read the full file on GitHub · 865 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 865 lines · 47 tokens per session scan A 984a05da3901

Subscribe to this mod's changes

cli-builder is a skill published in the GitHub repository eddiebelaval/squire (21 stars, last pushed 19d ago), licensed MIT. It adds 47 tokens to every session and 5,043 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

langgraph-docs

Fetches and references LangGraph Python documentation to build stateful agents, create multi-agent workflows, and implement human-in-the-loop patterns. Use when the user asks about LangGraph, graph agents, state machines, agent orchestration, LangGraph API, or needs LangGraph implementation guidance.

langchain-ai/deepagents · 62 tokens

gjc-sdk-author

Author trusted-local TypeScript and Python scripts that operate GJC sessions through the broker-bound CLI.

Yeachan-Heo/gajae-code · 24 tokens

adding-personhog-rpc

Guide for adding a new RPC to personhog-replica and personhog-router. Covers eligibility checks, proto definition, code generation for Python and Node.js clients, Rust implementation (storage trait, postgres queries, service handler, router wiring), and index compatibility validation. Use when adding a new gRPC…

PostHog/posthog · 88 tokens

migrating-llm-gateway-callers

Migrates an LLM caller from services/llm-gateway to PostHog/ai-gateway. Use when adding a gateway caller, converting an existing Python gateway integration, adopting shared Go-capable client builders, changing gateway URLs or headers for a caller, or removing a Python fallback. Inventories the caller's contract…

PostHog/posthog · 102 tokens

write-script-bun

MUST use when writing TypeScript scripts. Bun is the default and preferred TypeScript runtime — pick it for TypeScript unless the script specifically needs Deno.

windmill-labs/windmill · 37 tokens

write-script-python3

MUST use when writing Python scripts.

windmill-labs/windmill · 13 tokens