# Codex (https://openknowledge.ai/docs/integrations/codex)

Use OpenKnowledge with Codex.

OpenKnowledge works with Codex through MCP plus an installed skill.

## Install

There are two ways to connect Codex, depending on how you run OpenKnowledge:

- **Desktop app** (macOS, Windows, Linux). The first time you open a project, a consent dialog detects Codex and configures it for you. To re-trigger the dialog, choose **File → Set up OpenKnowledge integrations…**.
- **Web app / terminal** (any platform, including Intel Macs — see the [web app guide](https://openknowledge.ai/docs/get-started/quickstart#ok-install-web-app)). Run `ok init` in your project: it registers the OpenKnowledge MCP server with Codex and the other editors it detects. Every `ok start` repairs the entry if it has drifted (it never adds one you removed).

## Open with AI

From the editor, **Open with AI ▸ Codex** dispatches the current file, folder, or project to Codex in one click. Entry points include the sidebar's right-click menu (file / folder / empty space), the **File → Open with AI** menu, and the Command Palette. You can also hand the current doc to Codex from the bottom **Ask AI** composer.

Codex receives a short prompt asking it to open the target in OpenKnowledge's web preview. The agent then grounds the rest of the conversation through MCP. See [Editor → Open with AI](https://openknowledge.ai/docs/features/editor#open-with-ai) for the full UX.

## Verify

Open the project in Codex and ask:

> List the first 5 documents you come across in this project.

The agent should call the OpenKnowledge `exec` tool and respond with some of your documents.

If you don't see the tool, restart Codex. If it's still missing and `ok init` reported your config was `left unchanged`, the reason in parentheses says why `~/.codex/config.toml` (or `$CODEX_HOME/config.toml` if set) was left untouched. For config problems, fix the file and re-run `ok init`; for `no format-preserving writer available`, your config isn't the problem — OpenKnowledge can't rewrite the file safely on this platform, so add an `open-knowledge` entry to `mcp_servers` by hand (command: `ok mcp`).

## Scheduled runs

The ChatGPT desktop app runs Codex on a schedule from its **Scheduled** view. Tasks run unattended under your default sandbox, against your local project or an isolated background worktree, and the app must be running for tasks that need local files. See OpenAI's [scheduled tasks](https://learn.chatgpt.com/docs/automations) docs. Codex CLI has no scheduler of its own; use [`codex exec`](https://learn.chatgpt.com/docs/non-interactive-mode) from OS cron instead. Described as of August 2026, while the ChatGPT and Codex surfaces are still changing quickly.

The meeting-sync prompt in [Ingest meetings](https://openknowledge.ai/docs/workflows/meeting-ingestion#automatically-on-a-schedule) works verbatim as a scheduled task.