title: "AI Skills for Gemini CLI & Codex CLI" description: "Configure coding standards and AI behavior in Gemini CLI and Codex CLI." slug: "gemini-codex-cli-skills" category: "skills" updatedAt: "2026-03-05T00:00:00.000Z" faqs:
- q: "What is GEMINI.md?" a: "GEMINI.md is a project-level instruction file placed in your .gemini/ directory. Gemini CLI reads it to understand your project conventions."
- q: "Does Codex CLI support custom instructions?" a: "Yes. Codex CLI reads instructions from .codex/instructions.md and respects custom configuration files."
AI Skills for Gemini CLI & Codex CLI
Overview
Both Google's Gemini CLI and OpenAI's Codex CLI support custom coding standards through instruction files. Here's how to configure them.
Gemini CLI — GEMINI.md
Gemini CLI reads a GEMINI.md file from your .gemini/ directory:
# Project: E-Commerce API
## Tech Stack
- Runtime: Node.js 20 with TypeScript
- Framework: Express.js
- Database: PostgreSQL with Prisma ORM
- Auth: JWT with refresh tokens
## Coding Standards
- Use async/await over callbacks
- All functions must have JSDoc comments
- Use Zod for request validation
- Follow RESTful conventions for API endpoints
## Testing
- Jest for unit tests
- Supertest for API integration tests
- Minimum 80% code coverage
File locations:
- Project-level:
.gemini/GEMINI.md(recommended) - Global:
~/.gemini/GEMINI.md
Codex CLI — Instructions
OpenAI's Codex CLI uses custom instruction files:
# Codex Instructions
## Architecture
- Clean Architecture with repository pattern
- Dependency injection using tsyringe
- Domain-driven design for business logic
## Error Handling
- Custom AppError class for all application errors
- Never catch and swallow errors silently
- Log all errors with structured JSON logging
## Security
- Input validation on all endpoints
- Parameterized queries only (never string concat)
- CORS configured for specific origins
File location: .codex/instructions.md or ~/.codex/instructions.md
MCP Configuration
Both tools support MCP servers:
Gemini CLI
// .gemini/settings.json
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["@modelcontextprotocol/server-github"],
"env": { "GITHUB_TOKEN": "${GITHUB_TOKEN}" }
}
}
}
Codex CLI
// .codex/config.json
{
"mcpServers": {
"postgres": {
"command": "npx",
"args": ["@modelcontextprotocol/server-postgres"],
"env": { "DATABASE_URL": "${DATABASE_URL}" }
}
}
}
Comparison
| Feature | Gemini CLI | Codex CLI | |---------|-----------|-----------| | Skills file | GEMINI.md | instructions.md | | Location | .gemini/ | .codex/ | | MCP config | settings.json | config.json | | Provider | Google | OpenAI |
Related Guides
Was this guide helpful?
Last updated: March 5, 2026