{"id":31228764,"url":"https://github.com/yaroslavyaroslav/CodexSublime","last_synced_at":"2025-09-22T07:03:15.679Z","repository":{"id":304175614,"uuid":"1018001266","full_name":"yaroslavyaroslav/CodexSublime","owner":"yaroslavyaroslav","description":"Sublime Text frontend for OpenAI Codex","archived":false,"fork":false,"pushed_at":"2025-09-17T10:47:01.000Z","size":512,"stargazers_count":15,"open_issues_count":8,"forks_count":7,"subscribers_count":3,"default_branch":"develop","last_synced_at":"2025-09-17T11:36:38.649Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yaroslavyaroslav.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["yaroslavyaroslav"]}},"created_at":"2025-07-11T12:46:13.000Z","updated_at":"2025-09-17T10:47:05.000Z","dependencies_parsed_at":"2025-07-11T15:31:04.731Z","dependency_job_id":"f7d73cfa-267b-4abe-802b-1dae417400df","html_url":"https://github.com/yaroslavyaroslav/CodexSublime","commit_stats":null,"previous_names":["yaroslavyaroslav/codexsublime"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/yaroslavyaroslav/CodexSublime","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaroslavyaroslav%2FCodexSublime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaroslavyaroslav%2FCodexSublime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaroslavyaroslav%2FCodexSublime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaroslavyaroslav%2FCodexSublime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yaroslavyaroslav","download_url":"https://codeload.github.com/yaroslavyaroslav/CodexSublime/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaroslavyaroslav%2FCodexSublime/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276361150,"owners_count":25628853,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-22T02:00:08.972Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-09-22T07:01:54.099Z","updated_at":"2025-09-22T07:03:15.667Z","avatar_url":"https://github.com/yaroslavyaroslav.png","language":"Python","funding_links":["https://github.com/sponsors/yaroslavyaroslav"],"categories":["Python"],"sub_categories":[],"readme":"# Codex Sublime Text plug-in\n\nChat with the [Codex CLI](https://github.com/openai/codex) directly from Sublime Text.\n\n## Upgrade Notes\n\n- API token setting: This package expects your OpenAI API token in the `token` setting and exports it to the environment variable named by `env_key` (default: `OPENAI_API_KEY`). If you previously used another package with a different setting name, please add `\"token\": \"sk-...\"` to your Codex settings or set the corresponding environment variable.\n\n- Markdown and folding: The transcript and input panels now use a bundled Markdown syntax for improved headings and section folding. You can auto‑fold sections by header via `fold_sections` in project or global Codex settings.\nThe plug-in spins up a `codex proto` subprocess, shows the conversation in a\nMarkdown panel and lets you execute three simple commands from the Command\nPalette.\n\n---\n\n![](static/codex_title.png)\n\n## Features\n\n- Full Codex capabilities\n    - Assistant-to-Bash interaction\n    - Sandboxing (on macOS and Linux)\n    - Model and provider selection\n- MCP support (via `~/.codex/config.toml`)[^1]\n- Deep Sublime Text integration\n    - Multiline input field uses Markdown\n    - Selected text is auto-copied into the message with syntax applied\n    - Outputs to either the output panel or a separate tab\n    - Symbol list included in answers\n- Works out of the box[^2].\n\n### Installation\n\n1. **Install the Codex CLI** (the plug-in talks to the CLI, it is **not** bundled).\n\n   ```bash\n   npm i -g @openai/codex\n   ```\n\n   On Windows you can use\n\n   ```bash\n   winget install OpenAI.Codex\n   ```\n\n   By default the plug-in uses \"which(codex)\"\n\nIf yours lives somewhere else, set the `codex_path` setting (see below). It\naccepts either a single string (e.g. `\"codex.exe\"` when Codex is installed natively\non Windows) or an array of strings – e.g.:\n\n```jsonc\n{\n  \"codex_path\": [\"wsl\", \"-e\", \"codex\"],\n}\n```\n\n2. Plugin installation\n    1. With Package Control\n        `Package Control: Install Package` → **Codex**\n\n    2. Manual\n        Clone / download into your `Packages` folder (e.g. `~/Library/Application Support/Sublime Text/Packages/Codex`).\n\n\n3. Optionally create an OpenAI token and tell the plug-in about it.\n\n   *Open the menu* → **Preferences › Package Settings › Codex** and put your\n   key into the generated `Codex.sublime-settings` file:\n\n   ```jsonc\n   {\n       \"token\": \"sk-…\"\n       // exported to this env var for the Codex CLI\n       \"env_key\": \"OPENAI_API_KEY\"\n   }\n   ```\n\nThat’s it – hit \u003ckbd\u003e⌘⇧P\u003c/kbd\u003e / \u003ckbd\u003eCtrl ⇧ P\u003c/kbd\u003e, type *Codex*, select one of\nthe commands and start chatting.\n\n---\n\n## Commands (⌘⇧P)\n\n• **Codex: Prompt** – open a small Markdown panel, type a prompt, hit *Super+Enter*.\n\n• **Codex: Open Transcript** – open the conversation buffer in a normal tab.\n\n• **Codex: Reset Chat** – stop the Codex subprocess, clear the transcript and\n  invalidate the stored `session_id` so the next prompt starts a brand-new\n  session.\n\n---\n\n## Per-project configuration\n\nEvery Sublime project can override Codex settings under the usual `settings`\nsection.  Example:\n\n```jsonc\n{\n    \"folders\": [{ \"path\": \".\" }],\n\n    \"settings\": {\n        \"codex\": {\n            // will be filled automatically – delete or set null to reset\n            \"session_id\": null,\n\n            // model \u0026 provider options\n            \"model\":            \"o3\",\n            \"provider_name\":    \"openai\",\n            \"base_url\":         \"https://api.openai.com/v1\",\n            \"wire_api\":         \"responses\",\n            \"approval_policy\":  \"on-failure\",\n\n            // sandbox\n            \"sandbox_mode\": \"read-only\",\n            \"permissions\": [\n                // additional writable paths (project folders are added automatically)\n                \"/Users/me/tmp-extra\"\n            ]\n            ,\n            // Auto-fold specific sections in the transcript by their header\n            // name (case-insensitive). You can pass a string or a list.\n            // Example: fold the model's internal reasoning block\n            // (rendered as \"## agent_reasoning\").\n            \"fold_sections\": [\"agent_reasoning\"]\n        }\n    }\n}\n```\n\n---\n\n## Writable paths passed to Codex\n\nThe plug-in constructs the `sandbox_policy.permissions` list for each session:\n\n1. `/private/tmp`\n2. **`cwd`** – the first project folder (or the current working directory if\n   there is none)\n3. **All folders** listed in the Sublime project (visible in the sidebar)\n4. Any extra paths you add via `settings.codex.permissions`\n\nThose paths are sent to the CLI unchanged; Codex is free to read/write inside\nthem depending on the selected `sandbox_mode`.\n\n---\n\n## Default configuration sent to the CLI\n\nThe first thing the bridge does is send a `configure_session` message:\n\n```jsonc\n{\n    \"id\": \"\u003csession_id\u003e\",\n    \"op\": {\n        \"type\": \"configure_session\",\n\n        // model / provider\n        \"model\":            \"codex-mini-latest\",\n        \"approval_policy\":  \"on-failure\",\n        \"provider\": {\n            \"name\":     \"openai\",\n            \"base_url\": \"https://api.openai.com/v1\",\n            \"wire_api\": \"responses\",\n            \"env_key\":  \"OPENAI_API_KEY\"\n        },\n\n        // sandbox\n        \"sandbox_policy\": {\n            \"permissions\": [\n                \"disk-full-read-access\",\n                \"disk-write-cwd\",\n                \"disk-write-platform-global-temp-folder\",\n                \"disk-write-platform-user-temp-folder\",\n                {\n                    \"disk-write-folder\": {\"folder\": \"$HOME/.cache\"} // for clangd cache\n                }\n            ],\n            \"mode\": \"workspace-write\"\n        },\n\n        \"cwd\": \"\u003ccwd\u003e\"\n    }\n}\n```\n\nAll values can be overridden per-project as shown above.\n\nEnjoy hacking with Codex inside Sublime Text!  🚀\n\n## Code sent to the language model\n\nThe plugin only sends the code snippets that you explicitly type or select in the input panel to the language model. It never uploads your entire file, buffer, or project automatically. Local configuration (such as sandbox permissions or project folders) is used only by the CLI to enforce file I/O rules and is not included in the prompt context.\n\nHowever keep in mind that since this plugin and tool it relays on is agentish, any data from within your sandbox area could be sent to a server.\n\n## Suppressing noisy events\n\nIf the Codex backend floods the transcript with incremental updates such as\n`agent_reasoning_delta`, add them to the `suppress_events` array in your\nproject-specific `codex` settings:\n\n```jsonc\n{\n  \"suppress_events\": [\"agent_reasoning_delta\"]\n}\n```\n\n## Auto-folding sections\n\nYou can tell the transcript to auto‑fold certain sections by header name. The\nmatch is case-insensitive and can be configured globally or per-project.\n\n- Global (Preferences ▸ Package Settings ▸ Codex ▸ Settings):\n\n  ```jsonc\n  {\n    // ... other settings ...\n    \"fold_sections\": [\"agent_reasoning\"]\n  }\n  ```\n\n- Per project (`.sublime-project` under `settings.codex`):\n\n  ```jsonc\n  {\n    \"settings\": {\n      \"codex\": {\n        \"fold_sections\": [\"agent_reasoning\"]\n      }\n    }\n  }\n  ```\n\nNotes\n- Folding is scope-based and targets the Markdown `meta.section` for that\n  header. Only the section body is folded, so the header line shows with an\n  inline ellipsis (row style), e.g.: `## agent_reasoning ...`.\n- The fold is applied right after the section is appended. If your syntax\n  definition delays section scopes, the plugin waits briefly to target the\n  correct section.\n\n[^1]: https://github.com/openai/codex/blob/main/codex-rs/config.md#mcp_servers\n[^2]: If both requirements are met (1) `codex` is installed and (2) token in settings is provided.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyaroslavyaroslav%2FCodexSublime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyaroslavyaroslav%2FCodexSublime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyaroslavyaroslav%2FCodexSublime/lists"}