How to Set Up Codex CLI in Ritemark
Codex is OpenAI's coding agent CLI that works with your ChatGPT account. Ritemark integrates Codex directly into its AI sidebar -- select "Codex" from the agent dropdown and start working. Ritemark detects if Codex CLI is installed and walks you through setup if it is not.
What Do You Need Before Installing?
You need two things:
- Node.js 18 or higher -- Ritemark's setup wizard can detect and help install this
- ChatGPT Plus ($20/mo) or ChatGPT Pro ($200/mo) subscription -- Codex CLI usage is included with your subscription at no additional API cost
Check if Node.js is installed by opening Ritemark's terminal and running:
node --version
If you see a version number (18+), you are ready.
How Do You Install Codex CLI?
Option 1: Ritemark's Built-in Setup (Recommended)
Open the AI sidebar in Ritemark and select "Codex" from the agent dropdown. If Codex is not installed, Ritemark shows an onboarding wizard that:
- Detects missing dependencies (Git, Node.js, Codex CLI)
- Offers guided installation for each component
- Walks you through authentication
Option 2: Manual Installation
Install Codex CLI from your terminal or Ritemark's built-in terminal:
npm install -g @openai/codex
After installation, run codex to authenticate:
codex
This opens your browser to sign in with your ChatGPT account. No API key is needed -- your ChatGPT subscription covers Codex usage.
Verify the installation:
codex --version
You can also confirm your setup status in Settings -> Codex Account. This section shows your authentication method, CLI version, and subscription status.
How Do You Use Codex in Ritemark?
From the AI Sidebar (Recommended)
Open the AI sidebar and select "Codex" from the agent dropdown at the top of the panel. Type your request in the chat input. Codex reads your open document and project files, proposes edits, and waits for your approval before writing changes.
From the Terminal
Open a folder with markdown files in Ritemark, then start Codex in the terminal:
codex "make this document more concise"
Try these examples:
codex "in notes.md, add a summary section at the top"
codex "reorganize proposal.md: move conclusions to the end, add an executive summary"
codex "review draft.md and improve the writing style"
What Can Codex Do With Your Documents?
Codex handles complex writing tasks by reading your files, understanding context, and making edits with your approval.
Polish writing:
codex "review draft.md and improve the writing style. Make it more professional."
Expand content:
codex "in blog-post.md, expand the 'Benefits' section with 3 more bullet points"
Restructure documents:
codex "convert meeting-notes.md from paragraphs into a structured outline with headers"
Convert formats:
codex "convert notes.md into a blog post format with introduction and conclusion"
Translate:
codex "translate article.md to Estonian, save as article-et.md"
How Do You Get the Best Results?
Specific prompts produce better results than vague ones. Always reference the filename and describe the exact outcome you want.
| Instead of | Say |
|---|---|
| "improve this" | "make the introduction more engaging" |
| "fix it" | "fix the bullet point formatting in the Features section" |
| "make it better" | "simplify the language for a non-technical audience" |
Use Version Control as a Safety Net
Git lets you review AI changes and revert anything you do not like:
git commit -am "before AI edits"
# run codex commands
git diff # review changes
git commit -am "AI: improved writing" # or git checkout . to undo
How Much Does Codex Cost?
Codex CLI usage is included with your ChatGPT subscription. There are no additional API costs.
- ChatGPT Plus ($20/mo) -- includes Codex CLI access
- ChatGPT Pro ($200/mo) -- includes Codex CLI access with higher rate limits
You do not need a separate OpenAI API key or billing account.
Troubleshooting
"Command not found: codex"
Make sure Node.js is installed and the npm global bin directory is in your PATH. Reinstall if needed:
npm install -g @openai/codex
On macOS with nvm, ensure you are using the correct Node version:
nvm use 18
npm install -g @openai/codex
Node Architecture Mismatch on macOS
If you see unexpected errors on Apple Silicon Macs, check that Node.js is running natively:
node -p "process.arch"
This should show arm64. If it shows x64, you are running Node under Rosetta. Reinstall Node.js natively:
nvm uninstall 18
arch -arm64 nvm install 18
Authentication Issues
If OAuth sign-in does not complete, check that your browser opened the authentication page. Make sure you have an active ChatGPT Plus or Pro subscription.
Changes Not Appearing in Editor
Ritemark auto-reloads files within about 1 second. If changes do not appear, save the file manually with Cmd+S or reload the window with Cmd+Shift+P -> Reload Window.
Ritemark Setup Wizard Not Detecting Codex
Close and reopen the AI sidebar after installing Codex. If the wizard still does not detect it, restart Ritemark. The built-in repair tool in Settings can also diagnose connection issues.
Frequently Asked Questions
How do I install Codex CLI?
Run npm install -g @openai/codex in any terminal, including Ritemark's built-in terminal. You need Node.js 18+ installed first. Then run codex to sign in with your ChatGPT account.
Do I need an OpenAI API key for Codex?
No. Codex CLI authenticates with your ChatGPT account via OAuth. Your ChatGPT Plus or Pro subscription covers usage. No separate API key or billing setup is required.
Does Codex edit files automatically?
No. Codex proposes changes and waits for your approval before writing to disk. You review each edit and can accept or reject it.
How do I update Codex CLI?
Run npm update -g @openai/codex in the terminal to get the latest version.
Can Codex work on multiple files at once?
Yes. Codex reads and edits multiple files in your working directory in a single session. It handles batch operations like translating all markdown files in a folder.
What is the difference between Codex and Claude Code?
Both are terminal-based AI agents that read and edit files on your computer. Codex is made by OpenAI and uses GPT models. Claude Code is made by Anthropic and uses Claude models. Ritemark supports both -- pick the one that fits your workflow or subscription.
Does Codex work on Windows?
Yes. Install via npm install -g @openai/codex in PowerShell or use Ritemark's built-in onboarding wizard, which detects missing dependencies and guides you through setup.
Does Codex work with languages other than English?
Yes. Codex handles content in any language. You can write prompts in English or your native language, and it can translate between languages while preserving markdown formatting.
Does Ritemark have a setup wizard for Codex?
Yes. Open the AI sidebar, select "Codex" from the agent dropdown, and Ritemark checks if Codex CLI is installed. If anything is missing, the onboarding wizard guides you through installing dependencies.
Related
- How to Set Up Claude Code - Alternative AI agent setup
- Why Does Ritemark Use Terminal AI Agents? - How CLI agents work with Ritemark
- AI Assistant - Built-in chat sidebar
- Getting Started - Ritemark basics