Single source of truth and librarian for ALL OpenAI Codex CLI documentation. Manages local documentation storage, scraping, discovery, and resolution. Use when finding, locating, searching, or resolving Codex CLI documentation; discovering docs by keywords, category, tags, or natural language queries; scraping from llms.txt; managing index metadata (keywords, tags, aliases); or rebuilding index from filesystem. Run scripts to scrape, find, and resolve documentation. Handles doc_id resolution, keyword search, natural language queries, category/tag filtering, alias resolution, llms.txt parsing, markdown subsection extraction for internal use, hash-based drift detection, and comprehensive index maintenance.
Limited to specific tools
Additional assets for this skill
This skill is limited to using the following tools:
canonical/developers-openai-com/codex/autofix-ci.mdcanonical/developers-openai-com/codex/changelog.mdcanonical/developers-openai-com/codex/cli.mdcanonical/developers-openai-com/codex/cli/features.mdcanonical/developers-openai-com/codex/cli/reference.mdcanonical/developers-openai-com/codex/cloud.mdcanonical/developers-openai-com/codex/cloud/code-review.mdcanonical/developers-openai-com/codex/cloud/environments.mdcanonical/developers-openai-com/codex/cloud/internet-access.mdcanonical/developers-openai-com/codex/concepts.mdcanonical/developers-openai-com/codex/enterprise.mdcanonical/developers-openai-com/codex/guides/agents-md.mdcanonical/developers-openai-com/codex/guides/agents-sdk.mdcanonical/developers-openai-com/codex/guides/api-key.mdcanonical/developers-openai-com/codex/guides/autofix-ci.mdcanonical/developers-openai-com/codex/guides/build-ai-native-engineering-team.mdcanonical/developers-openai-com/codex/guides/slash-commands.mdcanonical/developers-openai-com/codex/ide.mdcanonical/developers-openai-com/codex/ide/cloud-tasks.mdcanonical/developers-openai-com/codex/integrations/linear.mdABSOLUTE PROHIBITION: NEVER use cd with && in PowerShell when running scripts from this skill.
The Problem: If your current working directory is already inside the skill directory, using relative paths causes PowerShell to resolve paths relative to the current directory instead of the repository root, resulting in path doubling.
REQUIRED Solutions (choose one):
cd with &&)NEVER DO THIS:
cd with &&: cd <relative-path> && python <script> causes path doublingThe file exceeds context limits and will cause issues. You MUST use scripts.
REQUIRED: ALWAYS use manage_index.py scripts for ANY index.yaml access:
python scripts/management/manage_index.py count
python scripts/management/manage_index.py list
python scripts/management/manage_index.py get <doc_id>
python scripts/management/manage_index.py verify
All scripts automatically handle large files via index_manager.py.
This skill provides slash commands for common workflows (once plugin commands are created):
/openai-ecosystem:scrape-docs - Scrape Codex CLI documentation from llms.txt sources/openai-ecosystem:refresh-docs - Refresh the local index and metadata without scraping/openai-ecosystem:validate-docs - Validate the index and references for consistencyThis skill provides automation tooling for OpenAI Codex CLI documentation management. It manages:
Core value: Prevents link rot, enables offline access, optimizes token costs, automates maintenance, and provides resilient doc_id-based references.
This skill should be used when:
CRITICAL: This section defines HOW to execute operations in this skill.
For ALL scraping, validation, and index operations, delegate execution to a general-purpose Task agent.
How to invoke:
Use the Task tool with:
subagent_type: "general-purpose"description: Short 3-5 word descriptionprompt: Full task description with execution instructionsScripts run in FOREGROUND by default. Do NOT background them.
When Task agents execute scripts:
python plugins/openai-ecosystem/skills/codex-cli-docs/scripts/core/scrape_docs.pyrun_in_background=true: Scripts are designed for foreground execution&, no nohup, no background process managementCRITICAL: Report ALL errors, warnings, and issues - never suppress or ignore them.
When executing scripts via Task agents:
Use this when you want to rebuild and validate the local index/metadata without scraping:
python plugins/openai-ecosystem/skills/codex-cli-docs/scripts/management/refresh_index.py
Use this when the user explicitly wants to hit the network and scrape docs:
# Scrape from configured llms.txt sources
python plugins/openai-ecosystem/skills/codex-cli-docs/scripts/core/scrape_docs.py
# Refresh index after scraping
python plugins/openai-ecosystem/skills/codex-cli-docs/scripts/management/refresh_index.py
# Resolve doc_id to file path
python plugins/openai-ecosystem/skills/codex-cli-docs/scripts/core/find_docs.py resolve <doc_id>
# Search by keywords (default: 25 results)
python plugins/openai-ecosystem/skills/codex-cli-docs/scripts/core/find_docs.py search sandbox tools
# Natural language search
python plugins/openai-ecosystem/skills/codex-cli-docs/scripts/core/find_docs.py query "how to configure sandbox"
# List by category
python plugins/openai-ecosystem/skills/codex-cli-docs/scripts/core/find_docs.py category guides
# List by tag
python plugins/openai-ecosystem/skills/codex-cli-docs/scripts/core/find_docs.py tag cli
Search Options:
| Option | Default | Description |
|---|---|---|
--limit N | 25 | Maximum number of results to return |
--no-limit | - | Return all matching results (no limit) |
--min-score N | - | Only return results with relevance score >= N |
--fast | - | Index-only search (skip content grep) |
--json | - | Output results as JSON |
--verbose | - | Show relevance scores |
The codex-cli-docs skill uses a unified configuration system.
Configuration Files:
config/defaults.yaml - Central configuration file with all default valuesconfig/filtering.yaml - Content filtering rulesconfig/tag_detection.yaml - Tag detection patternsreferences/sources.json - Documentation sources configurationEnvironment Variable Overrides:
All configuration values can be overridden using environment variables: CODEX_DOCS_<SECTION>_<KEY>
Required: pyyaml, requests, beautifulsoup4, markdownify, filelock
Optional (recommended): yake (for keyword extraction)
Python Version: Python 3.11+ recommended
Fetch documentation from configured sources using llms.txt format.
Extract specific markdown sections for token-optimized responses.
Detect documentation drift via 404 checking and hash comparison.
Discover and resolve documentation references using doc_id, keywords, or natural language queries.
Maintain index metadata, keywords, tags, and rebuild index from filesystem.
MUST use PowerShell (recommended) or prefix Git Bash commands with MSYS_NO_PATHCONV=1
Git Bash on Windows converts Unix paths to Windows paths, breaking filter patterns.
Example:
MSYS_NO_PATHCONV=1 python scripts/core/scrape_docs.py --filter "/docs/"
Status: FIXED - Scripts auto-detect Windows and configure UTF-8 encoding.
Status: EXPECTED - Some llms.txt entries may reference docs that don't exist yet. Scripts handle gracefully and continue.
The codex-cli-docs skill provides a clean public API for external tools:
from codex_docs_api import (
find_document,
resolve_doc_id,
get_docs_by_tag,
get_docs_by_category,
search_by_keywords,
get_document_section,
detect_drift,
refresh_index
)
# Natural language search
docs = find_document("sandbox configuration")
# Resolve doc_id to metadata
doc = resolve_doc_id("codex-cli-docs-getting-started")
# Get docs by tag
cli_docs = get_docs_by_tag("cli")
# Extract specific section
section = get_document_section("codex-cli-overview", "Installation")
When developing this plugin locally, you may want changes to go to your dev repo instead of the installed plugin location.
PowerShell:
$env:CODEX_DOCS_DEV_ROOT = "D:\repos\gh\melodic\claude-code-plugins"
Bash/Zsh:
export CODEX_DOCS_DEV_ROOT="/path/to/claude-code-plugins"
When you run any major script (scrape, refresh, rebuild), a mode banner will display:
Dev mode:
[DEV MODE] Using local plugin: D:\repos\gh\melodic\claude-code-plugins
Prod mode:
[PROD MODE] Using installed skill directory
PowerShell:
Remove-Item Env:CODEX_DOCS_DEV_ROOT
Bash/Zsh:
unset CODEX_DOCS_DEV_ROOT
codex-cli-docs/
SKILL.md # This file (public)
codex_docs_api.py # Public API
canonical/ # Documentation storage (private)
index.yaml # Metadata index
scripts/ # Implementation (private)
core/ # Scraping, discovery
management/ # Index management
maintenance/ # Cleanup, drift detection
utils/ # Shared utilities
config/ # Configuration
defaults.yaml # Default settings
filtering.yaml # Content filtering
tag_detection.yaml # Tag patterns
references/ # Technical documentation (public)
sources.json # Documentation sources
.cache/ # Cache storage (inverted index)
logs/ # Log files
Documentation is scraped from OpenAI Codex CLI llms.txt sources (configured in sources.json).
Query: "Search for sandbox documentation" Expected Behavior:
Query: "How do I configure the Codex CLI sandbox?" Expected Behavior:
Query: "Resolve codex-cli-getting-started" Expected Behavior:
Date: 2025-12-15 Model: claude-opus-4-5-20251101
Status: Initial release - awaiting llms.txt source configuration for scraping.