Scripts and CI
Beta · Tabnine plugin for OpenCode v0.5.1
Run tabnine-opencode non-interactively in scripts, pipelines, and CI jobs. There's no separate CLI to install for headless use: the same tabnine-opencode command drives interactive and non-interactive runs.
Authenticate with a token
Create a Tabnine Personal Access Token (PAT), store it in your CI secret store, then expose it as the TABNINE_TOKEN environment variable. With TABNINE_TOKEN set, the agent behaves the same as a signed-in user, with no browser interaction. An environment token takes precedence over any prior interactive sign-in on the machine and overwrites it.
For the full list of authentication environment variables, see Signing In and Working with Models.
Run a prompt non-interactively
Use the run command with your prompt as the argument:
TABNINE_TOKEN=<your-pat> tabnine-opencode run "Summarize the TODO comments in this repository"To pick a specific model and get machine-readable output:
TABNINE_TOKEN=<your-pat> tabnine-opencode run --model tabnine/claude-4-5-sonnet --format json "List the public functions in src/"--model tabnine/<key>: run with a specific Tabnine-served model. See Signing In and Working with Models for model keys and default-model configuration.--format default|json: choose the output format. Usejsonfor machine-readable output.
Other run flags
run also accepts the flags below (descriptions as printed by --help), with the most script-relevant first:
--continue, -c
continue the last session
--session, -s
session id to continue
--fork
fork the session before continuing (requires --continue or --session)
--file, -f
file(s) to attach to message
--agent
agent to use
--title
title for the session (uses truncated prompt if no value provided)
--share
share the session
--command
the command to run, use message for args
--attach
attach to a running opencode server (e.g., http://localhost:4096)
--username, -u
basic auth username (defaults to OPENCODE_SERVER_USERNAME or 'opencode')
--password, -p
basic auth password (defaults to OPENCODE_SERVER_PASSWORD)
opencode reference: run and its flags are standard opencode features; see the opencode CLI docs and Commands docs.
What still applies in headless runs
Everything your organization governs in interactive sessions also governs run mode: agent guidelines, tool approvals, MCP governance, code-attribution checks, and quota and license limits all still apply.
If a headless run fails, see Troubleshooting for debug logs and common issues.
Last updated
Was this helpful?
