[PR #2410] feat: add createOpencodeTui() function to SDK for programmatic TUI launching #10302

Closed
opened 2026-02-16 18:14:55 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/2410

State: closed
Merged: Yes


This PR adds a new createOpencodeTui() function to the JavaScript SDK that allows programmatic launching of the opencode TUI interface.

Changes

  • Added TuiOptions type with optional project, model, session, and agent parameters
  • Added createOpencodeTui() function that spawns the opencode TUI process with inherited stdio
  • Function takes over the current terminal for interactive TUI experience

Usage

import { createOpencodeTui } from '@opencode/sdk'

const tui = createOpencodeTui({
  project: '/path/to/project',
  model: 'claude-3-5-sonnet',
  session: 'session-id',
  agent: 'agent-name'
})

The TUI will launch and take over the current terminal, providing an interactive coding experience.

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/2410 **State:** closed **Merged:** Yes --- This PR adds a new `createOpencodeTui()` function to the JavaScript SDK that allows programmatic launching of the opencode TUI interface. ## Changes - Added `TuiOptions` type with optional `project`, `model`, `session`, and `agent` parameters - Added `createOpencodeTui()` function that spawns the opencode TUI process with inherited stdio - Function takes over the current terminal for interactive TUI experience ## Usage ```javascript import { createOpencodeTui } from '@opencode/sdk' const tui = createOpencodeTui({ project: '/path/to/project', model: 'claude-3-5-sonnet', session: 'session-id', agent: 'agent-name' }) ``` The TUI will launch and take over the current terminal, providing an interactive coding experience.
yindo added the pull-request label 2026-02-16 18:14:55 -05:00
yindo closed this issue 2026-02-16 18:14:55 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#10302