Matthew3 downloadsTurn a note into a Codex session. Write instructions in the note and get the answers, approvals and results back in it.
Turn an Obsidian note into a Codex session. You write an instruction in the note, press a key, and Codex's answer, its approval requests and the files it touched come back into the same note. The note keeps the whole conversation, so you can read it later, link to it, and pick the session up again.
Status: development version (0.4.2). Tested on Linux with Codex CLI 0.172.0. macOS and Windows are not yet tested; see Limitations.
Not affiliated with OpenAI. This is an independent plugin. "OpenAI" and "Codex" are trademarks of OpenAI. The plugin starts the Codex CLI that you install yourself; it does not include or redistribute any OpenAI software.
A session note holds a sequence of input blocks and output blocks:
```cxcli
List every prime between 1 and 100.
[[Notes on primes]]
```
> [!cxcli-out] Turn 1 · 2026-11-29 12:00
> 2, 3, 5, 7, 11, …
cxcli code block and press Cmd+Enter (macOS) or Ctrl+Enter (Windows and Linux).codex app-server for the run, opens (or resumes) the note's Codex thread with a permission profile built from your settings, and streams the answer into the note. When Codex asks to run a command outside the sandbox or to change a file, an approval card appears in the note (or in a dialog if the note is not on screen).cxcli-out callout and a new empty input block is added. The next turn continues the same Codex thread. A turn that failed is removed from the thread before it is retried, so the instruction is not sent twice.Notes as context. [[Note]] tells Codex where the note is; ![[Note]] puts its text into the prompt; ![[Note#Heading]] and ![[Note#^block]] send just that part. Links in the input block can be clicked, previewed and completed like normal links.
Shell lines. A line starting with ! runs a shell command in the working folder (through thread/shellCommand, so it is part of the thread).
Every Codex slash command. All slash commands of Codex CLI are listed when you type /, each with a description in your language. Those that make sense in a note work there: /model, /reasoning (/effort), /fast, /permissions, /status, /usage, /debug-config, /warnings, /goal, /rename, /archive, /delete, /resume, /fork, /side (/btw), /plan, /init, /mention, /review, /compact, /recap, /diff, /copy, /export, /new (/clear), /cd, /pwd, /exit (/quit), /raw, /skills, /mcp, /plugins, /apps, /hooks, /experimental, /memories, /import, /app, /logout. Commands of Codex's own screen (/theme, /vim, /statusline, /keymap, /agents, /approve and the like) open the note's interactive screen and are typed into it; the five that only Codex's IDE extension has (/cloud, /cloud-environment, /ide-context, /local, /project) answer with a short explanation. $skill mentions a Codex skill.
Codex CLI commands. /codex <command> runs a command of the Codex CLI itself, for example /codex doctor, /codex mcp list, /codex exec "…" or /codex features list. /codex exec, /codex review and /codex exec resume get the note's permission profile; if you choose a sandbox yourself (--sandbox, --yolo, --profile and so on) the plugin asks first, because its protection then does not apply. Commands that open Codex's full-screen interface (/codex, /codex resume, /codex fork, /codex agents, /codex cloud) open it in the interactive screen.
Completion for Codex CLI commands and options. After /codex or !codex every command of the Codex CLI is listed (exec, exec resume, mcp add, …), each with a one-sentence description in your language; what you type narrows the list. Typing codex without / at the start of the input block shows the same list, and the choice becomes a /codex line. Typing -- lists the options of that command. The options of /model, /permissions, /statusline and /title are completed the same way. @ lists the files of the working folder and inserts the chosen path. Tab takes the highlighted entry, like Enter.
Global flags of the Codex CLI. An input block that starts with one of the Codex CLI's flags is a command: --model gpt-5.5 --search Explain this folder does what codex --model gpt-5.5 --search "Explain this folder" does in a terminal, in the interactive screen, on this note's thread. Everything after the flags, later lines included, is the first instruction. Typing -- at the start of the block lists the flags with a description in your language. --help and --version print Codex's own text in the note. Choosing a sandbox yourself (--sandbox, --yolo, --profile, …) asks first. To send a line that starts with -- as ordinary text, write \--.
The interactive screen. Open the interactive screen (or a screen command, /codex, or a -- line) runs the real codex screen in a tab below the note, on the note's thread (or a new session when the note has none). Everything of Codex's screen works there: pickers, approvals, /plan, its own shortcuts. It gets the note's permission profile, so blocked folders stay unreadable. While it is open the note does not run turns of its own; when Codex ends (/exit, Ctrl+C, or closing the tab), the turns made there are written into the note, so the note keeps the whole conversation. It needs Python 3.8 or later on your computer (nothing else on macOS and Linux; pip install pywinpty on Windows). On Windows and Linux, Obsidian's hotkeys are held off while the screen has the focus; on macOS the Cmd keys stay Obsidian's. Copy and paste: Cmd+C and Cmd+V on macOS, Ctrl+Shift+C and Ctrl+Shift+V elsewhere.
The shortcuts of Codex CLI's interactive mode. In the input block:
| Key | What it does in a note |
|---|---|
| Up / Down | Bring back earlier inputs (this note's, and those sent from other notes since Obsidian started), when the block is empty or still shows a recalled input |
| Ctrl+R | Search the earlier inputs; Enter uses the match, Esc cancels |
| Ctrl+O | Copy the last finished reply (same as /copy) |
| Ctrl+G | Write the input in the editor set in VISUAL or EDITOR; it must have its own window and wait until the file is closed (for example code --wait) |
| Ctrl+L | Move the input block to the top of the view; the note and the session are kept |
| Alt+R | Source mode on or off (same as /raw) |
| Esc Esc | On an empty block: the previous message, ready to edit, in a new note on a fork of the thread from just before it. Off when Obsidian's Vim key bindings are on; the command Edit the previous message in a forked note does the same |
| Ctrl+C | Stops a run; on an idle note with an empty block it closes the note (same as /exit). With a selection it copies as usual |
| Esc | Stops a run |
@ ! / $ |
File paths, shell lines, commands, skills |
While Codex is working, the run key (or Ask Codex) opens the prompt bar: Enter adds the text to the running turn, Tab keeps it and sends it when the turn ends. Queued input is not sent after a failed turn (it stays queued) or a stopped one (it is put in the input block).
Inside the input block these keys come before Obsidian's own hotkeys (on Windows and Linux, Ctrl+O, Ctrl+G and Ctrl+L have other meanings elsewhere). The setting Codex CLI shortcuts in the input block turns them off. Copying the last reply, searching earlier inputs, editing the previous message and the external editor are also commands, so you can give them hotkeys of your own. Keys of Codex's own pickers (F8 for voice, Ctrl+T in the /resume picker, Space in /plugins, and the like) work in the interactive screen.
Note commands. :cwd path changes the working folder, :fork [turn] branches the session into a new note, :undo puts back the files changed in the previous turn, :summary writes a summary into the note's properties, and :full [[Session note]] embeds another session in full.
Prompt bar. The Ask Codex command, or typing /cx at the start of a line in any note, opens a prompt bar. From a normal note it starts a new session note that links back to it.
Approvals you control. By default every file change and every command that needs to leave the sandbox goes to a card. You can instead let Codex work inside the working folder without asking. "Always allow" rules are kept only on this device and can be removed in the settings.
Protection through Codex's sandbox. Each run gets its own permission profile. It denies the session note, the vault's configuration folder, Codex's auth.json, folders such as ~/.ssh, and any folder, tag or file pattern you block. If you allow reading the configuration folder it becomes read-only instead; it can never be written, even when Codex may work in the vault without asking. Requests that would touch .git/hooks, .git/config, .codex, .agents, .mcp.json or the Codex home folder are declined before they reach a card.
Safe output. Answers are rendered so that they cannot run code, load remote content or create dangerous links in your vault.
14 languages. German, Spanish, French, Indonesian, Italian, Japanese, Korean, Portuguese (Brazil), Turkish, Ukrainian, Vietnamese, Chinese (Simplified), Chinese (Traditional) and English, following Obsidian's language setting; every other setting shows English. With English (GB), dates are written day first (30/11/2026 14:03 in output blocks, 30-11-2026 140312 in note names); times are 24-hour in every language. The cxnote-created property stays YYYY-MM-DD so that Obsidian reads it as a date.
npm install -g @openai/codex, then codex login), or an API key stored in Obsidian's secret storage and chosen in the settings. Tested with 0.172.0.Download main.js, manifest.json and styles.css from the latest release and put them in <vault>/.obsidian/plugins/codex-note-cli/. Then enable Codex Note CLI in Settings → Community plugins.
Run Codex Note CLI: New session note, write an instruction in the input block and press the run key. Commands:
| Command | What it does |
|---|---|
| New session note | Creates a session note in the session folder |
| Ask Codex | Opens the prompt bar |
| Go to the input block | Moves the cursor into the last input block |
| Run the current input block | Same as the run key |
| Save output block as a new note | Copies the output block under the cursor into a new note |
| Stop the run | Stops the running turn |
The plugin itself makes no network requests. Codex talks to OpenAI (or the provider set in your Codex configuration). Web search is off or on as Codex's own setting says, unless you choose otherwise in the plugin settings. The network for commands in the sandbox is off unless you turn it on.
child_process)The plugin is a front end for the Codex CLI, so it starts programs on your computer. It starts them only as part of something you do in a session note or in the settings:
codex app-server) for each run, and codex --version when it looks for Codex;PATH and other environment variables a terminal would have (macOS and Linux; it prints the environment and exits);python3, or the path in the settings) for the interactive screen's pseudo-terminal, and once to check that it works;! lines when "Run ! lines through Codex" is off, and the codex … command lines you type;VISUAL or EDITOR when you press Ctrl+G;taskkill to stop a run's programs when you stop the run.Commands Codex runs, ! lines and MCP servers run as programs on your computer. ! lines and MCP servers run outside Codex's sandbox.
fs)Besides notes, which it reads and writes through Obsidian's own API, the plugin uses Node.js's file access for:
AGENTS.md, .codex or .mcp.json (before asking whether you trust it), and listing its files for @ completion (hidden folders and node_modules skipped, at most 5000 files);:undo and the saved diffs for /diff, in your user cache folder (see below);The plugin goes through the vault's file list in three places: to find notes with a blocked tag, so that Codex's sandbox can deny them; to offer file names when you type [[ inside an input block; and, after a file is renamed, to update links in the unsent input blocks of session notes (Obsidian does not update links inside code blocks).
The plugin writes to the clipboard when you ask it to: /copy and Ctrl+O (the last reply), copying a selection in the interactive screen, and, when Ctrl+G cannot put the edited text back, that text. It reads the clipboard only when you paste into the interactive screen (Cmd+V on macOS, Ctrl+Shift+V elsewhere).
Settings are stored in the plugin's data.json. "Always allow" rules, trusted working folders and the per-note /permissions choice are stored in Obsidian's local storage on this device. The interactive screen's Python helper is passed on the command line and writes no file. Notes whose interactive-screen turns are not written in yet are remembered in Obsidian's local storage until they are. Ctrl+G writes the input block's text to a file in the system's temporary folder for the external editor and removes it when the editor has closed it, also when the editor could not be started. Earlier inputs for Up/Down and Ctrl+R are read from the notes and kept in memory only. Copies of files taken before an approved change (for :undo) are kept in your user cache folder (~/Library/Caches/codex-note-cli, %LOCALAPPDATA%\codex-note-cli\Cache or ~/.cache/codex-note-cli), at most the 20 newest turns and 50 MB.
[[links]], ! lines and / commands in it are not interpreted.:undo. /permissions inside it can widen what Codex may do./codex agents and /codex cloud run as typed and may start Codex's background server, which outlives the tab./plan is an approximation: the app-server interface has no plan mode, so the plugin asks Codex for a plan and makes files read-only for that turn./permissions cannot grant full access or turn on automatic review from a note; set those in Codex's own configuration if you want them./codex commands other than exec and review run as ordinary programs outside the sandbox, like ! lines.npm install
npm run build # writes main.js
npm run lint # the checks of the community plugin review (eslint-plugin-obsidianmd)
npm test # unit tests
npm run test:integration # the real Codex CLI (on PATH, or CODEX_BIN) against a mock API; needs Python 3
MIT License. See LICENSE and NOTICE. Earlier history of this repository holds Codex help texts that are under the Apache License 2.0 (LICENSES/Apache-2.0.txt); NOTICE says which.