Skip to content

rust(feat): add Cursor and OpenCode agent support - #705

Merged
evan-sift merged 1 commit into
mainfrom
rust/cli-agent-cursor-opencode
Jul 31, 2026
Merged

rust(feat): add Cursor and OpenCode agent support#705
evan-sift merged 1 commit into
mainfrom
rust/cli-agent-cursor-opencode

Conversation

@evan-sift

@evan-sift evan-sift commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Changes

Extends the agent lifecycle to the two clients that keep MCP registrations in their own JSON config rather than behind a CLI. Cursor uses ~/.cursor/mcp.json under mcpServers; OpenCode uses ~/.config/opencode/opencode.json under mcp with a local command array. Both join Codex on the shared ~/.agents/skills/sift directory.

Merges into the existing config instead of rewriting it, so unrelated servers and top-level settings survive. Writes go through a temp file and rename with permissions carried over, so an interrupted write cannot truncate a user's config. Refuses to follow a symlinked config or skill directory. An entry carrying keys this CLI does not write is a conflict rather than something to overwrite, and an OpenCode opencode.jsonc is reported as unavailable because comments would not survive a rewrite.

Detects these two clients by config directory as well as PATH, since both are commonly installed as editors with no CLI on PATH.

Snapshots every client's prior config before the first write, so a failure partway through a multi-client install restores all of them plus the skill directories.

Verification

  • cargo fmt --check --all, cargo clippy --all-features, cargo test --all-features
  • 21 cmd::agent tests, including the cross-client rollback and preflight cases this PR makes testable

@lineville lineville left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks solid, my main concern is that a lot of this is specific to 4 known harnesses. How do we expect this to handle other coding harnesses, or do we just want to accept that these are the handful we support and can validate?

Comment thread rust/crates/sift_cli/src/cmd/agent/config.rs
Comment thread rust/crates/sift_cli/src/cmd/agent/config.rs
@evan-sift
evan-sift force-pushed the rust/cli-agent-cursor-opencode branch from 34b5595 to b14b5b8 Compare July 31, 2026 01:01
lineville
lineville previously approved these changes Jul 31, 2026
@evan-sift
evan-sift force-pushed the rust/cli-agent-cursor-opencode branch from 938c6cc to a6a0643 Compare July 31, 2026 18:09
@evan-sift
evan-sift force-pushed the rust/cli-agent-cursor-opencode branch from a6a0643 to ae02134 Compare July 31, 2026 18:27
@evan-sift
evan-sift force-pushed the rust/cli-agent-cursor-opencode branch from ae02134 to 0b932e6 Compare July 31, 2026 18:41
Base automatically changed from rust/cli-agent-claude-codex to main July 31, 2026 18:59
Extend the agent lifecycle to the two clients that keep MCP registrations in
their own JSON config rather than behind a CLI. Cursor uses
`~/.cursor/mcp.json` under `mcpServers`; OpenCode uses
`~/.config/opencode/opencode.json` under `mcp` with a local command array.
Both join Codex on the shared `~/.agents/skills/sift` skill directory.

Merge into the existing config instead of rewriting it, so unrelated servers
and top-level settings survive. Writes go through a temp file and rename, and
permissions are carried over, so an interrupted write cannot truncate a user's
config. Refuse to follow a symlinked config or skill directory. An entry
carrying keys this CLI does not write is reported as a conflict rather than
overwritten, and an OpenCode `opencode.jsonc` is reported as unavailable
because comments would not survive a rewrite.

Detect these two clients by config directory as well as PATH, since both are
commonly installed as editors without a CLI on PATH.

Snapshot every client's prior config before the first write so a failure
partway through a multi-client install restores all of them plus the skill
directories. These are the tests that cover the cross-client transaction;
the JSON clients can be driven directly, without a fake process runner.

Generalize the skill-target test now that three clients share one directory.
@evan-sift
evan-sift force-pushed the rust/cli-agent-cursor-opencode branch from 0b932e6 to 1ffa9a5 Compare July 31, 2026 18:59
@evan-sift
evan-sift merged commit c9e761c into main Jul 31, 2026
22 checks passed
@evan-sift
evan-sift deleted the rust/cli-agent-cursor-opencode branch July 31, 2026 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants