Skip to content
Flywrite

Writing with Codex

Flywrite doesn't bundle its own AI. Instead, you run the real Codex, OpenAI's command-line agent, in the built-in terminal, on your own subscription — with your own setup and no extra AI fees from Flywrite.

Before you start

Install Codex by following OpenAI's Codex CLI guide. Once it runs in your computer's terminal, it runs in Flywrite.

The writing loop

  1. Open a terminal and launch Codex — ⌃3, or the + button in the terminal tab bar.
  2. Point Codex at your text — select it and press ⌘⇧L, or @-mention the file (see below).
  3. Ask for what you want — "tighten this paragraph," "draft an intro from these notes."
  4. Watch the edits land. Codex edits your files directly, and the editor updates live.
  5. Review and keep writing. You can hand-edit right alongside the agent.

Pointing the agent at your work

Codex doesn't see what you have open or selected in Flywrite on its own, so tell it where to look. You can @-mention a file right in your prompt (type @ and the file name). Or select some text and press ⌘⇧L — Send Selection to Terminal — and Flywrite drops a reference to that file and those lines into the terminal for you. (These shortcuts are defaults — all of them are customizable.)

Your safety net

Flywrite's automatic before-agent checkpoint doesn't kick in for Codex, so save one yourself before you hand over your work: click Checkpoint in the top bar, or press ⌘⇧C. Then you can always see exactly what changed — and restore any earlier version if you don't like it. See Checkpoints & versions.

Know when it's done

Flywrite can send a system notification when Codex finishes a task in a Flywrite terminal, and can play a sound with it. This needs the one-time setup below. The notification switch lives on the Codex page in Settings → Agents; the sound is in Settings → Notifications. Click the notification to jump straight back to that terminal.

Setting up Codex

Settings → Agents → Codex has its terminal shortcut, its notification switch, and its one-time Flywrite setup: a notify setting that tells Flywrite when a task finishes. The setup lives in Codex's own config, and Codex applies it for you: click Set up with Codex… and a terminal opens where Codex adds the setting while you watch and approve the edit — Flywrite never edits that file itself. Preview prompt shows the exact prompt Codex is given, and Copy prompt lets you paste it into a session you already have open instead. Once installed, the same button offers to remove it again. Setup takes effect in new Codex sessions, and it does nothing in terminals outside Flywrite.

If your Codex config already sends its notifications to another program, Flywrite won't replace it. Preview or copy the prompt and ask Codex to combine the two if you want both.

Agents can tune Flywrite, too

Your app settings are editable as files, so Codex can manage them for you. Open the Settings project (Settings → Edit settings file (JSON)), launch Codex in its terminal, and ask — "switch me to a warmer theme," "make the code font bigger." Changes apply live as the agent works. Details in Appearance & themes.