Feature Request: codex://file/<path>:<line>:<col> deep link and --goto CLI flag for IDE/editor switching

Open 💬 2 comments Opened May 13, 2026 by kouzhihao

Problem

Codex currently has no external API for other tools to open a specific file at a specific line:column position in the Codex desktop app. This blocks editor-switching workflows where developers want to jump from JetBrains IDE (or any other tool) directly into Codex at the exact same location.

Precedent: Cursor supports both:

  • cursor://file/<absolute_path>:<line>:<column> (URL scheme on macOS)
  • cursor --goto <absolute_path>:<line>:<column> (CLI flag on all platforms)

The existing switch2cursor JetBrains plugin (32k+ downloads, MIT license) uses these APIs. A community member is trying to build the equivalent Switch2Codex plugin but is blocked by this missing capability.

Current state (reverse-engineered from Codex.app v26.506.31421)

What works

  • codex app <project_path> — opens the desktop app with a workspace folder
  • --open-project <path> — CLI arg parsed into {kind: "newThread", path}
  • codex://new?path=/some/dir — deep link to create a new thread with path context
  • Internal chat: path:line:column references ARE clickable and navigate correctly (when not broken, cf. issue openai/codex#13339)

What is missing

From the DA() URL parser in the app.asar (workspace-root-drop-handler):

Supported URL hosts: plugins, automations, codex-app, connector, new, settings, skills, threads<br>→ No file or open host exists.

The EA() parameter extractor supports: hostId, marketplace, originUrl, path, prompt, returnTo, source<br>→ No line or column parameters.

The OA() argv parser only handles --open-project, bare paths (Windows only), and codex:// URLs<br>→ No --goto flag.

Proposed solution

1\. URL scheme: codex://file/<absolute_path>:<line>:<column>

codex://file/Users/alice/project/src/main.kt:42:10

This should open the file in Codex and navigate cursor to line 42, column 10.<br>On macOS this would work via open "codex://file/path:line:col".

2\. CLI flag: codex --goto <path>:<line>:<column>

codex --goto /Users/alice/project/src/main.kt:42:10

Cross-platform parity with Cursor's cursor --goto flag.

3\. (Optional) URL query variant for web compatibility

codex://open?file=/absolute/path&line=42&column=10

Why this matters

The codex:// URL scheme already exists and is registered on macOS via setAsDefaultProtocolClient("codex"). The file navigation logic already exists internally (chat references support path:line:col format, per issue openai/codex#13339). Adding external access to this capability would:

  1. Enable JetBrains to Codex switching plugins (like switch2cursor for Cursor)
  2. Allow any tool (terminals, browsers, other editors) to deep-link into Codex
  3. Improve the multi-tool developer workflow that Codex is designed for

Related issues

  • openai/codex#13339 — path:line:column navigation exists internally but had Windows regression
  • openai/codex#18314 — Custom URL scheme handling issues (relevant background)

View original on GitHub ↗

2 Comments

mcfly001 · 28 days ago

I have a related workflow that needs one more part beyond opening a file at a line: the target should be an existing Codex Desktop thread, so that the user can continue the same conversation with the selected code as context.

Use case

A local JavaScript tool (for example, a test-failure report, code index, or internal dashboard) knows:

  • the Codex thread to return to;
  • a workspace-relative file path;
  • an optional line/range.

It should be able to bring the existing Codex task to the foreground, reveal that file in the right-side file/editor area, and select the requested range. The user can then choose Add to conversation (or Ask in side chat) and continue in the already-active thread.

Today, a file link can open a file in some cases, but it does not provide a documented external contract for selecting the active thread, reliably highlighting a range, or connecting that selection to the existing composer.

Possible extension

In addition to the proposed file-only route, support a thread-scoped form such as:

codex://threads/<thread-id>/file?path=src/example.ts&startLine=42&endLine=58

or:

codex://open?thread=<thread-id>&path=src/example.ts&line=42&column=1

Expected behavior:

  1. Activate the matching existing desktop thread/window.
  2. Resolve the file only within that thread's workspace or attached roots.
  3. Open/reveal the file in the in-app right-side file view and highlight the requested line/range.
  4. Expose the normal selection actions, especially Add to conversation, so the user deliberately adds the selected code to the existing composer. An optional focusComposer=1 could focus the composer, but the deep link should never submit a message automatically.

This would make the feature useful not only for editor switching, but also for JS-based local developer tooling that routes a developer from a concrete failure or report back to the exact Codex discussion and code location.

linear[bot] · 6 days ago

from idir:

Additional user signal for the simpler terminal → Codex Desktop workflow: users want Cursor-style cursor test.txt parity while staying entirely in Codex. The minimum useful behavior is a command such as codex app ./test.txt (or an equivalent documented form) that: 1. Activates Codex Desktop. 2. Resolves or opens the file's parent workspace. 3. Reveals the file in the in-app workspace file tab/editor. 4. Does not submit a message automatically. Line/column navigation can be additive; direct file opening is useful on its own. This appears covered by openai/codex#22474 rather than needing a separate issue.