Skip to main content
Use OpenAI’s Codex CLI to write and maintain Mintlify documentation from the terminal. Project instructions in AGENTS.md give Codex persistent context about your documentation standards, components, and style guide.

Getting started

Prerequisites:
  • An OpenAI account with access to Codex
Setup:
  1. Install the Codex CLI:
  1. Navigate to your docs directory.
  2. (Optional) Add the AGENTS.md file below to your project.
  3. Run codex to start a session.
See the Codex CLI documentation for installation alternatives and authentication options.

Use Codex with Mintlify

Codex reads AGENTS.md files from your repository to understand project-specific rules and conventions before it starts working. You can place an AGENTS.md at the root of your docs repo to give Codex context about Mintlify components, your writing standards, and how you structure your documentation. Codex discovers AGENTS.md files at multiple levels:
  • Global instructions in ~/.codex/AGENTS.md apply to all your projects.
  • Project instructions in your repo root (or any subdirectory) apply to work done in that scope.
Codex concatenates these files from root to the current directory, so project-level instructions extend or override global ones. Create an AGENTS.md at the root of your docs repo and commit it so all contributors benefit from the same context. See AGENTS.md in the Codex documentation for complete details.

Example AGENTS.md

This file gives Codex context about Mintlify components and technical writing standards. Customize it for your documentation:
  • Writing standards: Update language guidelines to match your style guide.
  • Component patterns: Add project-specific components or modify existing examples.
  • Code examples: Replace generic examples with real API calls and responses for your product.
  • Style and tone preferences: Adjust terminology, formatting, and other rules.
Save this as AGENTS.md at the root of your docs repo.
AGENTS.md

Working with Codex

Once your AGENTS.md is in place, Codex picks it up automatically when you start a session in your docs repo.

Example prompts

Writing new content:
Improving existing content:
Updating navigation:
Maintaining consistency:

Enhance with MCP server

Connect the Mintlify MCP server to Codex to give it access to search the Mintlify documentation while helping you write. When you connect the MCP server, Codex can look up component usage and configuration options without you leaving the terminal. Add the MCP server to your global Codex config at ~/.codex/config.toml:
To connect to your own documentation site’s MCP server instead, replace the URL with your site’s MCP endpoint:
See Model Context Protocol for more information about MCP servers and how to find your site’s MCP endpoint.