rust(feat): add Cursor and OpenCode agent support - #705
Merged
Conversation
This was referenced Jul 30, 2026
evan-sift
marked this pull request as ready for review
July 30, 2026 16:35
evan-sift
force-pushed
the
rust/cli-agent-cursor-opencode
branch
from
July 30, 2026 22:39
2ed79e5 to
34b5595
Compare
lineville
reviewed
Jul 30, 2026
lineville
left a comment
Contributor
There was a problem hiding this comment.
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?
evan-sift
force-pushed
the
rust/cli-agent-cursor-opencode
branch
from
July 31, 2026 01:01
34b5595 to
b14b5b8
Compare
lineville
previously approved these changes
Jul 31, 2026
evan-sift
force-pushed
the
rust/cli-agent-cursor-opencode
branch
from
July 31, 2026 17:19
b14b5b8 to
938c6cc
Compare
lineville
approved these changes
Jul 31, 2026
evan-sift
force-pushed
the
rust/cli-agent-cursor-opencode
branch
from
July 31, 2026 18:09
938c6cc to
a6a0643
Compare
evan-sift
force-pushed
the
rust/cli-agent-cursor-opencode
branch
from
July 31, 2026 18:27
a6a0643 to
ae02134
Compare
evan-sift
force-pushed
the
rust/cli-agent-cursor-opencode
branch
from
July 31, 2026 18:41
ae02134 to
0b932e6
Compare
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
force-pushed
the
rust/cli-agent-cursor-opencode
branch
from
July 31, 2026 18:59
0b932e6 to
1ffa9a5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.jsonundermcpServers; OpenCode uses~/.config/opencode/opencode.jsonundermcpwith a local command array. Both join Codex on the shared~/.agents/skills/siftdirectory.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.jsoncis 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 onPATH.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-featurescmd::agenttests, including the cross-client rollback and preflight cases this PR makes testable