Skip to content

[FEATURE]: Add 'opencode agents' command for background session management #27746

@alanZee

Description

@alanZee

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Feature Description

Add an opencode agents command that provides an interactive TUI interface for managing background agent sessions, similar to Claude Code's claude agents command.

Motivation

Claude Code has a claude agents command that opens an interactive TUI view for managing background coding sessions. This allows users to:

  • View all running background sessions at a glance
  • Switch between sessions easily
  • Monitor session status and progress
  • Dispatch new sessions with specific settings (model, effort level, permissions)
    Currently, OpenCode manages background sessions through CLI commands (opencode session list, opencode -s <id>, opencode -c), which lacks the convenience of a unified interactive interface.

Proposed Solution

Add a new opencode agents command that:

  1. Opens an interactive TUI (similar to the main OpenCode TUI)
  2. Lists all background sessions with their status, model, and working directory
  3. Allows selecting a session to attach/resume
  4. Provides options to start new sessions with configurable settings
  5. Shows session statistics (token usage, cost, duration)
    Example usage:
# Open the agents management TUI
opencode agents
# Filter by working directory
opencode agents --cwd /path/to/project
# Set default model for new sessions from the TUI
opencode agents --model anthropic/claude-sonnet-4
# Set default effort level
opencode agents --effort high
Alternatives Considered
1. 
Enhance existing opencode session list: Could add interactive selection, but doesn't provide the full management experience
2. 
Add flags to opencode command: Could add --list-sessions flag, but doesn't provide a unified view
3. 
Create a separate opencode-tui tool: Could be a plugin, but core integration would be more seamless
Additional Context
This feature would align OpenCode with Claude Code's session management UX, making it easier for users to manage multiple concurrent coding tasks across different projects.
**Label:** `enhancement`

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions