Skip to content
ReShiki / guide

Set up Codex

Which one do I need?

Codex is optional. Drawing, chemistry checks, imports, and exports work without it. Install Codex only if you want ReShiki’s assistant to turn instructions or reference images into editable drawings, or help improve a layout.

Codex provides the assistant’s model connection and account sign-in. ReShiki supplies the chemical drawing tools, builds the proposed structures locally, and renders them for review. Installing Codex does not replace ReShiki’s chemistry engine, and you do not need to write code or open a programming project.

The integration launches the Codex CLI’s local app server automatically. This is a background process ReShiki talks to; you do not need to start a server yourself or leave a terminal open. See the official app-server documentation.

If codex --version already works in your terminal, continue to sign-in. Otherwise, choose one installation method for your operating system. These commands follow the official Codex CLI installation guide, checked on 9 October 2026.

Open Terminal and run the standalone installer:

Terminal window
curl -fsSL https://chatgpt.com/codex/install.sh | sh

If you already use Homebrew, you can instead run:

Terminal window
brew install --cask codex

Open PowerShell and run the native Windows installer:

Terminal window
powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"

Install it in Windows itself. A Codex installation only inside WSL cannot be launched by the native ReShiki app. ReShiki needs the actual codex.exe executable, so the standalone installer is preferable to a command-script wrapper.

Open a terminal and run:

Terminal window
curl -fsSL https://chatgpt.com/codex/install.sh | sh

On macOS or Linux, the official npm package is another option:

Terminal window
npm install -g @openai/codex

After installation, open a new terminal and check:

Terminal window
codex --version

Run:

Terminal window
codex login

Complete the browser sign-in using an account with Codex access. Then check the saved login:

Terminal window
codex login status

Use the same operating-system account that runs ReShiki. Codex manages the saved credentials; ReShiki reuses that sign-in and does not ask you to paste a password or API key into the drawing window.

Codex supports account sign-in through ChatGPT and API-key authentication. Availability and usage limits depend on your account; API-key usage is billed to the associated API account. ReShiki does not include model usage with the app download. For account requirements or the optional API-key route, follow the official authentication guide.

  1. Open or restart ReShiki after installing Codex.
  2. Click Assistant in the top toolbar. It attempts to connect automatically.
  3. If Connect Codex remains in the footer, click it after signing in.
  4. A connected footer shows a filled dot and Codex, and the model menu shows the catalog returned by Codex. A listed model does not guarantee account access; sending a request checks access for that model. Clicking Codex refreshes the connection and model list.
  5. Type a drawing request or attach an image, then click Send. Review the preview and choose Apply when satisfied. Applying is undoable.

Connected assistant with Codex in the footer, a model selector, and Review mode

The screenshot shows a connected local preview build. GPT-6 Astra is selected when available; another account may offer different models. You can close the terminal after login. See drawing with the assistant for image input, review modes, and follow-up edits.

  1. ReShiki sends your request, conversation context, relevant drawing data, and any attached source image through Codex to the model. This needs internet access.
  2. The model requests ReShiki’s drawing operations. The local engine creates editable atoms, bonds, labels, and other objects, and checks and renders the proposal.
  3. A separate model review receives the rendered drawing and source image to inspect the result and request bounded corrections.
  4. The draft remains available for inspection. Automatic application requires a completed review with no unresolved findings; uncertain chemical assignments still need your decision.

ReShiki starts this Codex session with a read-only sandbox and disables shell execution, web search, external apps, and additional agents. Its tools are limited to the drawing workflow. This does not make the assistant offline: prompts and images are still sent for model processing. Ordinary drawing and chemistry checks remain local. Review can make additional model requests, so a request’s usage includes more than its final reply. Conversation history and unapplied drafts are session-local; save applied drawings as .rsk files.

Symptom What to check
Codex could not be found Run codex --version, open a new terminal after installation, and restart ReShiki. On Windows, check Get-Command codex.exe; install the native executable rather than only a WSL copy.
Sign-in required Run codex login status, sign in with codex login, then click Connect Codex again.
A model is missing Click Codex to refresh the available models. Choose one offered by your account.
Connection or generation times out Check connectivity and account access, reconnect, and retry. Completed previews are retained; inspect them before starting another request.

For a custom installation, set RESHIKI_CODEX to the absolute path to the Codex executable in the environment that launches ReShiki. For example, on macOS or Linux:

Terminal window
RESHIKI_CODEX=/absolute/path/to/codex /absolute/path/to/reshiki

On macOS, the app executable is normally /Applications/ReShiki.app/Contents/MacOS/reshiki. An environment variable set in a terminal only applies to processes launched from that terminal; it does not change an already running app. To update Codex, rerun the standalone installer, or use the corresponding Homebrew/npm update command for your chosen installation method.

The Assistant panel identifies Install Codex, Sign in to Codex, Connection needs attention, Checking Codex…, and Ready to try an image. The check starts the local app server and reads its saved sign-in and model catalog; it does not send an inference request. A listed model is not proof of account entitlement: access is checked when you send the request. If a check fails, the panel stops showing Codex as connected. Test connection retries, and Cancel check stops the check while ordinary drawing remains available. Setup messages never show your account details or the provider’s raw error text.

When ready, choose Try example image · ethanol. The original bundled image and known reference graph are documented with their license. The button attaches the image locally and fills a request; it does not upload anything. Choose Send, compare the editable draft against the reference (three heavy atoms, C–C–O, two single bonds, neutral, no specified stereochemistry), and inspect or edit it before Apply. The guided exercise waits for Apply even when ordinary requests use Auto apply. Apply uses the existing document validation and Undo workflow. An ambiguous or incorrect draft remains a draft for your decision. Check the draft yourself: a draft that looks right can still be the wrong molecule.

The composer describes external transfer before Send: the request, recent conversation and relevant drawing data travel through Codex, together with any attached image. The review also receives the source image and rendered drafts. Existing account access/usage limits apply; an API-key sign-in uses separate API billing. Codex owns credentials. ReShiki does not collect passwords or keys in this panel. ‹ in the panel header returns to the inspector.

Official installation and account guidance was checked against installed codex-cli 0.161.0 and the CLI guide, authentication guide, and app-server authentication protocol on 9 October 2026. The in-app links open these official instructions or this ReShiki setup guide; they do not start a sign-in flow or change Codex settings.