OPENCODE(1)

NAME
opencode - open source AI coding agent for the terminal

SYNOPSIS
opencode [OPTIONS]

DESCRIPTION
opencode is an AI coding agent designed for the terminal. It provides a TUI (Terminal User Interface) for interacting with 75+ LLM providers including Anthropic Claude, OpenAI, Google Gemini, GitHub Copilot, and local models via Ollama.

It uses a client/server architecture allowing the server to run on one machine while being driven remotely from another client.

OPTIONS

-h, --help
    Display help information and exit.

-v, --version
    Print version number and exit.

-d, --debug
    Enable debug logging.

-c DIR, --cwd DIR
    Set the working directory for the session.

-p PROMPT, --print PROMPT
    Run non-interactively with the given prompt and print the response, then exit. Useful for scripting and automation.

-f FORMAT, --format FORMAT
    Output format when using -p. Options: text (default), json.

-q, --quiet
    Suppress the spinner animation. Useful when running from scripts.

ENVIRONMENT

OPENCODE_INSTALL_DIR
    Override the binary installation directory used by the install script.

XDG_BIN_DIR
    XDG Base Directory Specification compliant binary path.

FILES

~/.config/opencode/
    User configuration directory.

~/.local/share/opencode/auth.json
    Stored authentication credentials.

TUI COMMANDS
Inside the TUI, the following slash commands are available:

/connect
    Configure and authenticate an LLM provider.

/models
    Switch between available models.

SEE ALSO
Full documentation at https://opencode.ai/docs

AUTHORS
Developed by the Anomaly team. See https://github.com/anomalyco/opencode for contributors.

LICENSE
MIT License.