Skip to content

Add opencode init lifecycle support#495

Open
young5lee wants to merge 27 commits intortk-ai:masterfrom
young5lee:feat/opencode-support-pr
Open

Add opencode init lifecycle support#495
young5lee wants to merge 27 commits intortk-ai:masterfrom
young5lee:feat/opencode-support-pr

Conversation

@young5lee
Copy link

Summary

  • add opencode detection, plugin installation, AGENTS.md lifecycle support, and target-aware rtk init flows so RTK can set up Claude, opencode, or both
  • promote rtk uninstall to the canonical teardown command while keeping rtk init --uninstall as a compatibility alias, and align --show plus reviewer-facing docs with the shipped lifecycle
  • add runtime/plugin compatibility fixes and Rust tests covering detection, install, uninstall, show-config, and opencode rewrite behavior

- add unix-only opencode detection wrapper and injectable helper
- add dedicated opencode support prompt with non-interactive default no
- add cfg-paired opencode installation gate with unix prompt flow
- run opencode detection after Claude settings patch handling completes
- add unix-only tests for config-directory and binary fallback behavior
- verify focused detect_opencode tests and full cargo test suite pass
- Assert embedded plugin asset content for bash rewrite hooks
- Define TempDir installer expectations for global and local plugin paths
- Embed the shipped TypeScript plugin for opencode bash rewrites
- Add create-if-missing installer helpers with TempDir-backed coverage
- Lock global and local target selection behavior
- Cover already-installed status messaging and skip rules
- Route post-init opencode setup through shared target selection helpers
- Keep installs idempotent with explicit status messaging and verification guidance
- lock plugin export compatibility for named and default loaders
- assert runtime command-shape helpers, diagnostics, and graceful fallbacks
- support named and default plugin exports plus alternate bash payload shapes
- add env-gated diagnostics and refresh guidance for real-session rechecks
- search project target binaries and PATH when absolute RTK fallbacks miss
- document the refreshed lookup path in install messaging for runtime rechecks
- lock helper-level target resolution for Claude, opencode, and both
- cover selected-target-only execution and legacy mode dispatch without side effects
- prompt for Claude, opencode, or both before target-specific setup runs
- route default init through explicit Claude and opencode runners with selected-target-only execution
- Lock official opencode global path helpers under config dir
- Define red coverage for final combined summary and show output paths
- Route opencode global path reporting through the official ~/.config root
- Add per-target outcome summaries and a combined final setup summary with concrete paths
- Cover create, append, idempotent, malformed, and removal behavior
- Lock the fixed rtk-opencode marker contract before wiring setup flow
- Add fixed RTK opencode section content with marker-based upsert/remove helpers
- Cover create, append, idempotent, malformed, and safe removal behavior in init tests
- Cover global AGENTS creation, already-configured, malformed safety, and show status
- Lock marker-aware AGENTS reporting before wiring setup and show_config
- Install and report the global AGENTS section alongside the opencode plugin lifecycle
- Make show_config detect AGENTS status from RTK markers instead of file existence alone
- cover uninstall cleanup for global and local plugin artifacts
- lock show-config expectations for real plugin paths and AGENTS marker reporting
- remove RTK-managed opencode plugins from both supported scopes during uninstall
- preserve AGENTS.md while stripping only the RTK section and report actual plugin locations in --show
- lock a dedicated `rtk uninstall` parse and help contract
- keep `rtk init --uninstall` covered as a deprecated compatibility alias
- add a primary `rtk uninstall` surface while keeping the init alias deprecated
- route both entrypoints through the existing uninstall cleanup behavior and updated guidance
- explain the shipped install, show, and uninstall flow in README
- map plugin scope and global AGENTS handling in architecture docs

Signed-off-by: young-macbook <dldixso@gmail.com>
- summarize AGENTS, show, and uninstall lifecycle updates in changelog
- rerun the Phase 3 Rust gate to confirm the branch is PR-ready

Signed-off-by: young-macbook <dldixso@gmail.com>
- promote rtk uninstall as the canonical doc surface
- explain shared main-to-init uninstall routing and legacy alias behavior
- describe rtk uninstall as the shipped removal command
- keep rtk init --uninstall documented as a deprecated compatibility alias
- remove the stale init-based uninstall command string from the older release note
- keep the note historical so it no longer reads like the current uninstall UX
@pszymkowiak
Copy link
Collaborator

Hi! Thanks for the contribution! Since March 6, all PRs should target the develop branch instead of master (see CONTRIBUTING.md).

Could you update the base branch? Click Edit at the top right of this PR and change it from master to develop.

Thanks!

@pszymkowiak
Copy link
Collaborator

Thanks for the contribution! OpenCode support has been merged into develop via #300 (plugin + init lifecycle). It will be available in the next release once develop is merged to master. This PR is now superseded — if you'd like to contribute further, check the open issues!

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