The cli-creator skill builds real, installable command-line tools that any future Codex thread can run by name from any working directory. It is designed for durable tools — not one-off scripts — that expose composable read/write commands, return stable JSON, manage authentication cleanly, and pair with a companion skill so Codex knows how to use them. Sources can include API documentation, OpenAPI specs, existing curl examples, SDKs, web apps, admin tools, or local scripts.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/openai/skills/llms.txt
Use this file to discover all available pages before exploring further.
What CLI Creator Enables
Composable commands
Discover, resolve, read, write, and raw-escape-hatch commands that chain together naturally from any repo.
Stable JSON output
Every command supports
--json so Codex can parse results, pipe them to the next step, or use them in automation.Auth management
Supports env variables, config files, and explicit flags in a documented precedence order — no leaked tokens.
Companion skill
After the CLI works, the skill creates or updates a companion skill that teaches future Codex threads when and how to use the new tool.
Trigger Conditions
Codex activates this skill when you ask it to:- Build a CLI for an API, service, or web app you work with regularly
- Turn existing curl examples or shell history into a stable, composable tool
- Create a command-line wrapper around an OpenAPI spec or SDK
- Package an internal script as an installable binary Codex can call from any repo
CLI Creator is for durable tools. If a short script in the current repo solves your task, write the script there instead.
Start: What to Specify
Name the target tool, its source, and the first real jobs it should do before Codex starts scaffolding:- Source: API docs, OpenAPI JSON, SDK docs, curl examples, browser app, existing internal script, or shell history
- Jobs: literal reads/writes such as
list drafts,download failed job logs,search messages,upload media,read queue schedule - Install name: a short binary name such as
ci-logs,slack-cli, orbuildkite-logs
Choosing a Runtime
Codex inspects your machine first:| Runtime | When to choose |
|---|---|
| Rust (default) | Durable CLIs Codex will run from any repo — one fast binary, strong arg parsing, easy install into ~/.local/bin |
| TypeScript/Node | When the official SDK, auth helper, or browser automation library makes the CLI materially better |
| Python | Data science, local file transforms, notebooks, SQLite/CSV/JSON analysis, or Python-heavy admin tooling |
Command Contract (Agent-CLI Patterns)
Before writing any code, Codex sketches the full command surface in chat. Every CLI built with this skill follows a consistent shape:--helpis interface: write it for a future Codex thread that only has the binary and a vague task.doctor --jsonverifies config, auth, version, endpoint reachability, and missing setup. It must be usable even when auth is missing — reporting what’s absent rather than crashing.--jsoneverywhere Codex will parse output: emit JSON to stdout only; send progress and diagnostics to stderr; redact tokens and secrets.- Write commands do one thing: use the narrowest stable resource ID, support
--dry-runordraftfirst when the service allows it, and never hide writes inside broad commands likefixorauto. - Pagination is explicit: start shallow by default; provide
--limit, cursor, or offset knobs with clearly documented defaults. - Exit codes are meaningful: exit zero on success (including empty results); exit non-zero for auth failure, invalid input, network failure, API error, or incomplete upload/download.
Authentication Design
Supported in this precedence order:- Environment variable using the service’s standard name (e.g.,
GITHUB_TOKEN) - User config file under
~/.<tool-name>/config.tomlor another simple documented path --api-keyflag only for explicit one-off tests — env/config is preferred for normal use to avoid leaking tokens into shell history
doctor --json always reports:
- Whether a token is available
- The auth source category (
flag,env,config, provider default, ormissing) - What setup step is missing
- Whether offline/fixture mode is active and whether auth is required
Build Workflow
Read the source
Inventory resources, auth, pagination, IDs, media flows, rate limits, and dangerous write actions. If OpenAPI is available, download and inspect it before naming commands.
Sketch the command list
Present the full command surface in chat. Keep names short and shell-friendly.
Implement core commands
Build
doctor, discovery, resolve, and read commands first. Add one narrow draft or dry-run write path if requested. Add the raw escape hatch.Install on PATH
The CLI must be callable by name outside the source folder. For Rust, a typical For TypeScript/Node:For Python:
Makefile target:Smoke-test from outside the source folder
Always test from another repo or
/tmp — not from inside the source folder — to catch binaries that only work with cargo run or package-manager wrappers:Run tests and checks
Format, typecheck or build, unit tests for request builders and pagination, no-auth
doctor, help output, and at least one fixture or live read-only API call.Examples of CLIs This Skill Can Build
CI log downloader
ci-logs — fetch GitHub Actions run logs for failing jobs, extract snippets by error pattern, return structured JSON with file paths and line numbers.Slack workspace CLI
slack-cli — list channels, resolve channel names to IDs, search messages, fetch thread context, and draft replies with --dry-run protection.Sentry error CLI
sentry-cli — list projects, resolve issue IDs from URLs, fetch event details and stack traces, assign or comment on issues.Internal API wrapper
A custom CLI from curl examples and DevTools network captures — sanitized endpoint notes, auth from env, composable read commands, raw
request get escape hatch.