Build tiny task-scoped CLIs on demand when an agent cannot directly access the data, page, API, or platform action a user needs.
This is a starter repo for agent unblock workflows: reuse an existing tool if possible, otherwise scaffold the smallest useful helper, run it immediately, and answer from the result.
Use it for prompts like:
- "Read this X post for me"
- "Analyze this YouTube script"
- "Summarize this page the agent cannot read directly"
- "Compare these API responses"
Do not use it when the helper is turning into a real product with config, subcommands, browser login flows, or framework structure.
python scripts/bootstrap_ai_cli.py youtube-script \
--purpose "Fetch transcript text and metadata for a YouTube video" \
--template transcript_stub \
--workspace "$PWD"This creates:
.agent-tools/
youtube-script/
cli.py
Patch the generated file with the smallest missing fetch or transform logic, run it on a real sample, and answer from the output.
If your repository already uses another scratch-tool directory, override it:
python scripts/bootstrap_ai_cli.py youtube-script \
--purpose "Fetch transcript text and metadata for a YouTube video" \
--template transcript_stub \
--workspace "$PWD" \
--tools-dir ".codex-tools"Representative example: examples/youtube_transcript
- User request
Analyze this YouTube script for pacing and retention.
- Bootstrap command
python scripts/bootstrap_ai_cli.py youtube-script \
--purpose "Fetch transcript text and metadata for a YouTube video" \
--template transcript_stub \
--workspace "$PWD"- Patched
cli.pyexcerpt
def extract_video_id(target: str) -> str:
if "youtube.com" in target or "youtu.be" in target:
...
return target.strip()
def fetch_segments(video_id: str, lang: str) -> list:
return YouTubeTranscriptApi.get_transcript(video_id, languages=[lang])- Example dependency
python -m pip install youtube-transcript-apiThis dependency is only required for the representative YouTube example, not for the scaffold script itself.
- Example execution
python examples/youtube_transcript/cli.py "https://youtu.be/dQw4w9WgXcQ" --json- Example JSON output
{
"status": "ok",
"tool": "youtube-transcript",
"video_id": "dQw4w9WgXcQ",
"lang": "en",
"segment_count": 3
}- Final answer built from the output
The script gets to the point quickly, but the payoff arrives almost immediately after the hook. To improve retention, expand the middle section with one concrete example before the closing action.
| Template | Best for | What it gives you |
|---|---|---|
generic |
Anything custom | Minimal one-file scaffold with TODO logic |
fetch_json |
APIs and JSON endpoints | urllib fetch + JSON normalization |
fetch_page_text |
Articles and webpages | HTML fetch + title/text extraction |
parse_local_file |
Local JSON or text artifacts | File read + simple normalization |
transcript_stub |
Video or audio transcript flows | Transcript-shaped output and segment scaffold |
| Agent | Entry point | How to use it |
|---|---|---|
| Codex | SKILL.md | Place this repo in your Codex skills directory |
| Claude Code | prompts/claude-code.md | Copy the prompt into project instructions or task preamble |
| Gemini CLI | prompts/gemini-cli.md | Copy the prompt into project instructions or task preamble |
| Other coding agents | prompts/core.md | Paste the core instructions into the agent's working context |
git clone https://github.com/Siwoo4985/ai-cli-bootstrap-skill.git \
"${CODEX_HOME:-$HOME/.codex}/skills/ai-cli-bootstrap-skill"- Clone this repository anywhere in your workspace.
- Start with prompts/core.md.
- Add prompts/claude-code.md or prompts/gemini-cli.md if you want agent-specific defaults.
| Example | Purpose | Notes |
|---|---|---|
| youtube_transcript | Representative end-to-end transcript flow | Best default onboarding path |
| webpage_extractor | Stable page-to-text extraction | Standard-library example |
| x_post_reader | Illustrative post reader | Shows normalization shape, not a guaranteed stable fetch path |
Run the scaffold tests:
python -m unittest discover -s testsValidate the Codex skill metadata:
python "${CODEX_HOME:-$HOME/.codex}/skills/.system/skill-creator/scripts/quick_validate.py" \
"${CODEX_HOME:-$HOME/.codex}/skills/ai-cli-bootstrap-skill"Small, focused improvements are the best fit:
- tighten prompts
- improve scaffold templates
- add clearer examples
- keep docs, templates, and behavior consistent
If the generated helper starts turning into a framework, move that work into a separate project instead.
This project is released under the MIT License.