For the complete documentation index, see llms.txt. This page is also available as Markdown.

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. Use json for machine-readable output.

Other run flags

run also accepts the flags below (descriptions as printed by --help), with the most script-relevant first:

Flag
Description

--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.

Ask-first tools block in headless runs. When there's no UI, opencode automatically rejects any permission prompt. So if your organization sets a tool class, such as running commands or editing files, to ask-first, that tool can't complete in a script or CI run. This includes service accounts. If your CI job needs a governed tool, ask your Tabnine admin to set that tool class to auto-approve. See Native Tools and Service Accounts and Token Limits. A tool your organization has disabled is blocked in every mode.

If a headless run fails, see Troubleshooting for debug logs and common issues.

Last updated

Was this helpful?