Run OpenAI Codex CLI inside Obsidian, with note context, visual generation, Memory Map search, and one-click setup helpers.
Codex Lab is a desktop-only Obsidian plugin that wraps your authenticated Codex CLI session. It is built for users who want an ObsidianCode-like agent sidebar, but powered by Codex instead of Claude Code.
Core chat and visual generation are routed through Codex CLI. Codex Lab does not require an OpenAI API key for normal use.
Latest BRAT release: 0.3.0
Install with:
https://github.com/reallygood83/codexian
- Codex sidebar in Obsidian: Chat with Codex from a native sidebar using an ObsidianCode-style interface.
- Automatic note context: The active note, selected text, and pinned notes can be sent to Codex automatically.
- Pinned and dismissible note chips: Pin important notes with
+or remove noisy notes withx. - Memory Map: Build a local vault index, find related notes, and add them to context with clear hover reasons.
- Visible Codex work timeline: Codex CLI progress lines are shown as a step-by-step timeline while the final answer is being generated.
- Slash command menu: Type
/to open a scrollable Codex-style command menu. - Model selector: Includes
gpt-5.5,gpt-5.4, and fallback Codex model options. Settings still allow manual model IDs. - Windows-aware Codex launch: Avoids known
codex.cmdspawn issues by running the Codex Node entrypoint directly when needed. - Permission modes: Review, Auto, and Yolo map to Codex sandbox behavior.
- Obsidian appearance-aware text: Chat and composer text follow your Obsidian font, size, and line-height settings.
Codex Lab can generate and embed PNG or SVG visual assets from the current note.
Supported visual types:
- Infographic
- Poster
- Cartoon / storyboard
- Concept art
- Diagram illustration
- YouTube thumbnail
- Profile / avatar
- Product marketing
- E-commerce hero image
- UI / app mockup
Flow:
- Open a note.
- Click the image button in the Codex Lab sidebar.
- Choose
PNG via Codex image generationorSVG via Codex code generation. - Choose a visual format.
- Codex Lab analyzes the note and drafts a production-ready image prompt.
- Review or edit the prompt.
- Codex Lab generates the asset and embeds it into the note.
Important details:
- PNG generation uses Codex CLI built-in
image_generation. - SVG generation uses Codex CLI to write a text-safe SVG file.
- Generated assets are saved to the configured media folder.
- Embeds are inserted below YAML frontmatter/properties so Obsidian properties stay valid.
- Korean text guidance is included to reduce garbled labels.
- Prompt drafting uses GPT Image 2-style recipes:
subject,composition,style,environment,lighting,typography,details, andaspect_ratio. - The progress modal shows Codex CLI steps while prompts and image files are being generated, copied, verified, and embedded.
Open Obsidian Settings → Community plugins → Codex Lab.
Codex Lab settings include:
- Run diagnostics: Check whether Obsidian can find
codex,npm,node,git, andomx. - Install / update Codex + OMX: Installs
@openai/codexandoh-my-codex, then runsomx setupandomx doctor. - Update Codex CLI: Runs
npm install -g @openai/codex@latest. - Enable image generation: Runs
codex features enable image_generation. - Install / update Obsidian Skills: Installs
kepano/obsidian-skillsinto~/.codex/skills.
obsidian-skills is not an Obsidian community plugin. It is an Agent Skills repository that teaches Codex CLI about Obsidian Markdown, Bases, JSON Canvas, Obsidian CLI workflows, and Defuddle web extraction.
- Obsidian desktop.
- Node.js 20+.
- Git, for one-click Obsidian Skills installation.
- OpenAI Codex CLI installed and authenticated.
- A recent Codex CLI with
image_generationenabled for PNG visual generation. - Optional: oh-my-codex for advanced OMX workflows.
Recommended CLI setup:
npm install -g @openai/codex oh-my-codex
codex login
codex features enable image_generation
omx setup
omx doctorPlatform notes:
- macOS: Codex Lab auto-detects Homebrew, npm, and NVM Codex paths such as
/opt/homebrew/bin/codex. - Windows: Codex Lab auto-detects npm paths such as
%APPDATA%\npm\codex.cmd. When this.cmdwrapper causes Node spawn issues, Codex Lab runs the underlying@openai/codex/bin/codex.jsentrypoint throughnode. - Windows PowerShell: Recommended for manual setup commands.
- Windows WSL: Still a practical fallback for advanced OMX/team workflows if native Windows terminal tooling is unstable.
Codex Lab supports BRAT installation from GitHub releases.
- Install Obsidian42 - BRAT from Obsidian Community Plugins.
- Open BRAT settings.
- Click Add Beta Plugin.
- Paste this repository URL:
https://github.com/reallygood83/codexian
- Enable Codex Lab in Obsidian Community Plugins.
Each release includes the files BRAT needs:
main.jsmanifest.jsonstyles.css
If BRAT does not update immediately, use BRAT's plugin update command or restart Obsidian.
Codex Lab is designed to make Obsidian notes feel native inside Codex CLI:
- Open a note and Codex Lab detects it automatically.
- Use the pin icon to keep a note attached while switching files.
- Use
xto exclude a note when you want a note-independent conversation. - Run
Codex Lab: Attach current note to chatfrom Obsidian commands or bind it to a hotkey. - Ask Codex normally; Codex Lab sends the selected note context through Codex CLI.
Memory Map is a local, API-free way to find relevant notes in your vault.
User flow:
- Click Build Memory Map once to index the vault locally.
- Open any note.
- Click Find Context.
- Codex Lab recommends related notes with clear reasons.
- Add useful notes to Codex Lab context with
+.
Memory Map uses note titles, tags, links, backlinks, headings, keywords, folders, modified times, URL-noise filtering, and BM25-style term scoring.
Memory Map data is saved locally in the vault:
.codexian/memory/index.json
Available commands:
Codex Lab: Build Memory MapCodex Lab: Find related notes for current note
Open Obsidian Settings → Community plugins → Codex Lab.
- Set
Codex CLI pathonly if auto-detection fails. - Add
PATHunder environment variables only if Obsidian cannot findcodex,npm,git, oromx. - On Windows,
Codex CLI pathmay point tocodex.cmd; Codex Lab will internally prefer the matchingcodex.jsentrypoint when available. - On macOS/Linux, Codex Lab keeps the normal executable path and does not use the Windows
.cmdworkaround. - Choose your Codex model and reasoning effort.
- Use
Reviewpermission mode until you trust the current vault workflow. - Configure the media folder for generated visual assets.
npm install
npm run buildManual install for local development:
<vault>/.obsidian/plugins/codex-lab/
main.js
manifest.json
styles.css
Then enable Codex Lab in Obsidian settings.
This repository includes a GitHub Actions workflow that builds and uploads BRAT assets when a tag matching the manifest version is pushed.
Example:
git tag 0.2.15
git push origin 0.2.15- Review mode is the safest default.
- Auto mode maps to Codex full-auto behavior.
- Yolo mode maps to Codex's dangerous bypass mode and should only be used in trusted, backed-up vaults.
- One-click installers show command previews and log setup output.
- Visual generation edits the current note only after the asset file exists.
Codex Lab is in active MVP development. Current focus areas:
- Better Codex CLI parity with interactive slash commands.
- More robust visual generation workflows.
- Optional embedding-based Memory Map ranking.
- Deeper tool-call rendering and diff previews.
- Long-term conversation persistence.
Created by 배움의 달인 / @reallygood83.