Skip to content

feat(cli): add ACP attach support#18272

Closed
shekohex wants to merge 2 commits into
anomalyco:devfrom
shekohex:acp-attach
Closed

feat(cli): add ACP attach support#18272
shekohex wants to merge 2 commits into
anomalyco:devfrom
shekohex:acp-attach

Conversation

@shekohex
Copy link
Copy Markdown
Contributor

@shekohex shekohex commented Mar 19, 2026

Issue for this PR

Closes #12853

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Adds --attach to opencode acp so ACP can bridge stdio to an existing opencode serve backend instead of always starting a local server.

It keeps the current local startup path unchanged, forwards --cwd in both modes, and updates the ACP/CLI docs plus the localized ACP/CLI pages.

How did you verify your code works?

  • bun typecheck
  • printf '%s\\n' '{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"initialize\",\"params\":{\"protocolVersion\":1}}' | bun run ./src/index.ts acp
  • printf '%s\\n' '{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"initialize\",\"params\":{\"protocolVersion\":1}}' | bun run ./src/index.ts acp --attach http://127.0.0.1:4105 with bun run ./src/index.ts serve --port 4105

Screenshots / recordings

N/A

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions
Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on my search, I found a potentially related PR:

#12743 - "feat(opencode): add backend server selection options for acp mode"

This PR appears to address similar functionality around allowing ACP to connect to backend servers instead of always starting locally, which is closely related to the --attach feature being added in PR #18272.

However, PR #12743 appears to be from an earlier iteration or different approach. You may want to review it to ensure there's no overlapping implementation or if it was previously closed/superseded.

@shekohex shekohex force-pushed the acp-attach branch 2 times, most recently from 553134a to c81cde0 Compare March 19, 2026 22:49
@shekohex shekohex marked this pull request as draft March 19, 2026 22:59
@shekohex shekohex marked this pull request as ready for review March 19, 2026 23:12
@shekohex shekohex closed this by deleting the head repository Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: ACP can call a specified opencode server

1 participant