Skip to content

Add OpenCode integration and CLI-only mode support#138

Open
benjaminwestern wants to merge 1 commit intoTinyAGI:mainfrom
benjaminwestern:main
Open

Add OpenCode integration and CLI-only mode support#138
benjaminwestern wants to merge 1 commit intoTinyAGI:mainfrom
benjaminwestern:main

Conversation

@benjaminwestern
Copy link

Summary

I worked with KimiK2.5 and Opus4.6 to co-develop this PR.

This commit adds OpenCode as a supported AI provider alongside Anthropic and OpenAI, enabling users to use TinyClaw without requiring Discord, Telegram, or WhatsApp.

Changes

Key Features:

  • Add OpenCode provider with full agent and skill support
  • Implement CLI-only mode with --no-tmux flag for headless operation
  • Add --cli-only quick setup flag for streamlined onboarding without channels
  • Fix tmux window targeting to support user configs with base-index 1
  • Add send, receive, and chat commands for CLI-based interaction
  • Create .opencode directory structure with skill symlinks per agent
  • Support 6 pre-configured agent roles (build, plan, coder, reviewer, writer, assistant)

Technical Changes:

  • lib/common.sh: Support empty channels array for CLI-only configs
  • lib/daemon.sh: Add no-tmux mode and dynamic window targeting
  • lib/messaging.sh: Add send, receive, and chat functions
  • lib/setup-wizard.sh: Add --cli-only flag for quick setup
  • src/lib/agent.ts: Create .opencode structure and per-agent config
  • src/lib/invoke.ts: Add OpenCode CLI invocation with --agent flag
  • tinyclaw.sh: Add command routing for new flags
  • opencode.json: Add root agent configuration

Documentation:

  • Add docs/OPENCODE.md: OpenCode integration guide
  • Add docs/5-AGENT-SQUAD.md: Multi-agent team setup guide
  • Add docs/CLI.md: Complete CLI usage documentation
  • Update AGENTS.md: Add OpenCode-compatible team mention syntax
  • Update .gitignore: Exclude .opencode runtime directory

Type of Change

  • Bug fix
  • [ X] New feature
  • Enhancement to existing feature
  • Breaking change
  • Documentation update
  • Refactor / code cleanup

Testing

Tested locally using OpenCode + CLI-only mode:

  • Verified CLI-only setup (setup --cli-only)
  • Tested no-tmux daemon operation (start --no-tmux)
  • Confirmed message sending/receiving via API
  • Validated OpenCode provider integration (sonnet model)
  • Tested file creation and code generation
  • Verified response queue functionality
    Note: Multi-agent teams, tmux mode, and skill invocation not fully tested.

I think there is a Low chance of regression as changes primarily add new code rather than modifying existing functionality. Tmux targeting change improves handling of non-default base-index configs.


Checklist

  • [ X] I have tested these changes locally
  • [X ] My changes don't introduce new warnings or errors ( I have attempted to regression test in a number of different ways, but I apologise for regression if there is any)
  • [ X] I have updated documentation if needed

This commit adds OpenCode as a supported AI provider alongside Anthropic and OpenAI,
enabling users to use TinyClaw without requiring Discord, Telegram, or WhatsApp.

Key Features:
- Add OpenCode provider with full agent and skill support
- Implement CLI-only mode with --no-tmux flag for headless operation
- Add --cli-only quick setup flag for streamlined onboarding without channels
- Fix tmux window targeting to support user configs with base-index 1
- Add send, receive, and chat commands for CLI-based interaction
- Create .opencode directory structure with skill symlinks per agent
- Support 6 pre-configured agent roles (build, plan, coder, reviewer, writer, assistant)

Technical Changes:
- lib/common.sh: Support empty channels array for CLI-only configs
- lib/daemon.sh: Add no-tmux mode and dynamic window targeting
- lib/messaging.sh: Add send, receive, and chat functions
- lib/setup-wizard.sh: Add --cli-only flag for quick setup
- src/lib/agent.ts: Create .opencode structure and per-agent config
- src/lib/invoke.ts: Add OpenCode CLI invocation with --agent flag
- tinyclaw.sh: Add command routing for new flags
- opencode.json: Add root agent configuration

Documentation:
- Add docs/OPENCODE.md: OpenCode integration guide
- Add docs/5-AGENT-SQUAD.md: Multi-agent team setup guide
- Add docs/CLI.md: Complete CLI usage documentation
- Update AGENTS.md: Add OpenCode-compatible team mention syntax
- Update .gitignore: Exclude .opencode runtime directory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant