use-cases/agent-friendly-clis.md +48 −71
11# Create a CLI Codex can use | Codex use cases---
2name: Create a CLI Codex can use
3tagline: Give Codex a composable command for an API, log source, export, or team script.
4summary: Ask Codex to create a composable CLI it can run from any folder,
5 combine with repo scripts, use to download files, and remember through a
6 companion skill.
7skills:
8 - token: $cli-creator
9 url: https://github.com/openai/skills/tree/main/skills/.curated/cli-creator
10 description: Design the command surface, build the CLI, add setup and auth
11 checks, install the command on PATH, and verify it from another folder.
12 - token: $skill-creator
13 url: https://github.com/openai/skills/tree/main/skills/.system/skill-creator
14 description: Create the companion skill that teaches later Codex tasks which CLI
15 commands to run first and which write actions require approval.
16bestFor:
17 - Repeated work where Codex needs to search, read, download from, or safely
18 write to the same service, export, local archive, or repo script.
19 - Agent tools that need paged search, exact reads by ID, predictable JSON,
20 downloaded files, local indexes, or draft-before-write commands.
21starterPrompt:
22 title: Build a CLI and companion skill
23 body: >-
24 Use $cli-creator to create a CLI you can use, and use $skill-creator to
25 create the companion skill in this same thread.
26
27
28 Source to learn from: [docs URL, OpenAPI spec, redacted curl command,
29 existing script path, log folder, CSV or JSON export, SQLite database path,
30 or pasted --help output].
31
32
33 First job the CLI should support: [download failed CI logs from a build URL,
34 search support tickets and read one by ID, query an admin API, read a local
35 database, or run one step from an existing script].
36
37
38 Optional write job: [create a draft comment, upload media, retry a failed
39 job, or read-only for now].
2 40
3[← All use cases](https://developers.openai.com/codex/use-cases)
4 41
542Ask Codex to create a composable CLI it can run from any folder, combine with repo scripts, use to download files, and remember through a companion skill. Command name: [cli-name, or recommend one].
6
7Intermediate
8
91h
10
11Related links
12
13[Codex skills](https://developers.openai.com/codex/skills) [Create custom skills](https://developers.openai.com/codex/skills/create-skill)
14
15## Best for
16
17- Repeated work where Codex needs to search, read, download from, or safely write to the same service, export, local archive, or repo script.
18- Agent tools that need paged search, exact reads by ID, predictable JSON, downloaded files, local indexes, or draft-before-write commands.
19
20## Skills & Plugins
21
22- [Cli Creator](https://github.com/openai/skills/tree/main/skills/.curated/cli-creator)
23
24 Design the command surface, build the CLI, add setup and auth checks, install the command on PATH, and verify it from another folder.
25- [Skill Creator](https://github.com/openai/skills/tree/main/skills/.system/skill-creator)
26
27 Create the companion skill that teaches later Codex tasks which CLI commands to run first and which write actions require approval.
28 43
29## Starter prompt
30 44
3145Use $cli-creator to create a CLI you can use, and use $skill-creator to create the companion skill in this same thread. Before coding, show me the proposed command surface and ask only for missing
3246Source to learn from: [docs URL, OpenAPI spec, redacted curl command, existing script path, log folder, CSV or JSON export, SQLite database path, or pasted --help output]. details that would block the build.
3347First job the CLI should support: [download failed CI logs from a build URL, search support tickets and read one by ID, query an admin API, read a local database, or run one step from an existing script].relatedLinks:
3448Optional write job: [create a draft comment, upload media, retry a failed job, or read-only for now]. - label: Codex skills
3549 Command name: [cli-name, or recommend one]. url: /codex/skills
3650Before coding, show me the proposed command surface and ask only for missing details that would block the build. - label: Create custom skills
51 url: /codex/skills/create-skill
52---
37 53
38## Introduction54## Introduction
39 55
82 102
83**Test the CLI like a future agent**103**Test the CLI like a future agent**
84 104
85Test [cli-name] the way you would use it in a future task.
86Please show proof that:
87- command -v [cli-name] succeeds from outside the CLI source folder
88- [cli-name] --help explains the main commands
89- the setup/auth check runs
90- one safe discovery, list, or search command works
91- one exact read command works with an ID from the discovery result
92- any large log, export, trace, or payload writes to a file and returns the path
93- live write commands are not run unless I explicitly approved them
94Then read the companion skill and tell me the shortest prompt I should use when I need this CLI again.
95
96If Codex returns a giant JSON blob, ask it to narrow the default response and add a file export for full payloads. If it forgets the approval boundary, ask it to update the companion skill before you use it in another thread.105If Codex returns a giant JSON blob, ask it to narrow the default response and add a file export for full payloads. If it forgets the approval boundary, ask it to update the companion skill before you use it in another thread.
97 106
98## Use the skill later107## Use the skill later
99 108
100When you need the CLI again, invoke the skill instead of pasting the docs again:109When you need the CLI again, invoke the skill instead of pasting the docs again:
101 110
102Use $ci-logs to download the failed logs for this build URL and tell me the first failing step.
103
104Use $support-export to search this week's refund complaints and read the three highest-value tickets.
105
106Use $admin-api to find this user's workspace, read the billing record, and draft a safe account note.
107
108For recurring work, test the skill once in a normal thread, then ask Codex to turn that same invocation into an automation.111For recurring work, test the skill once in a normal thread, then ask Codex to turn that same invocation into an automation.
109
110## Related use cases
111
112[
113
114### Create browser-based games
115
116Use Codex to turn a game brief into first a well-defined plan, and then a real browser-based...
117
118Engineering Code](https://developers.openai.com/codex/use-cases/browser-games)[
119
120### Save workflows as skills
121
122Turn a working Codex thread, review rules, test commands, release checklists, design...
123
124Engineering Workflow](https://developers.openai.com/codex/use-cases/reusable-codex-skills)[
125
126### Upgrade your API integration
127
128Use Codex to update your existing OpenAI API integration to the latest recommended models...
129
130Evaluation Engineering](https://developers.openai.com/codex/use-cases/api-integration-migrations)