---
title: "Intro"
---

Run the CLI in a project to open the full-screen terminal interface:

```bash
opencode2
```

Pass a directory to work in a different project:

```bash
opencode2 ~/code/my-project
```

Suggested terminals:

- [Ghostty](https://ghostty.org)
- [WezTerm](https://wezterm.org)
- [Alacritty](https://alacritty.org)
- [Kitty](https://sw.kovidgoyal.net/kitty/)

Truecolor support gives themes their most accurate colors; terminals without it use an approximation of the available
palette.

## Automation

Use `opencode2 run` to submit a prompt without opening the interactive interface. It is designed for scripts, CI jobs, and
other workflows that need model output directly in the terminal.

```bash
opencode2 run "Explain this repository"
```

## Mini

Use `opencode2 mini` to start OpenCode's minimal interactive interface instead of the full-screen TUI.

```bash
opencode2 mini
```

Run `opencode2 mini --help` to see its session, model, agent, prompt, and replay options.

## Background service

By default, OpenCode discovers or starts one shared background server for your user account. Every local OpenCode client
connects to that server, which owns sessions, configuration, integrations, permissions, and tool execution.

Use `--standalone` to run with a private server, or `--server` to connect to a specific server URL:

```bash
opencode2 --standalone
opencode2 --server http://localhost:4096
```

See [Troubleshooting](/troubleshooting) for shared service diagnostics and the [API reference](/api) for server endpoints.
