Sun, 2 Nov. 2025 Thomas Bendler ~ 4 min to read

Beautiful Command Line - OpenCode

Hi folks! Continuing on our journey to building the ultimate terminal environment, we now focus on bringing the power of AI directly into our command line. The tool of choice is OpenCode, a powerful, open-source AI coding agent built specifically for the terminal user interface (TUI). It brings sophisticated context awareness and LLM capabilities right to your fingertips, ensuring you never have to leave your code editor or terminal to ask a question or implement a feature.


Installation with Homebrew

Just like the other tools in this series, we will use Homebrew to handle the installation on macOS.

To get the latest official release, you simply need to tap the OpenCode repository and install the formula:

brew install opencode

This command installs the opencode binary, giving you instant access to the AI agent.

The Catppuccin Theme

A beautiful command line needs a beautiful theme, and Catppuccin is a community-favorite for a soothing, pastel aesthetic. While OpenCode offers built-in themes, you can easily set your preferred one, like catppuccin, in the global configuration file.

The global configuration is located at ~/.config/opencode/opencode.json (or opencode.jsonc). If the file doesn’t exist, create it and add your theme setting:

// ~/.config/opencode/opencode.jsonc
{
  // Set your preferred theme for the TUI
  "theme": "catppuccin"
}

OpenCode will now load the gorgeous Catppuccin colors, ensuring your AI assistant looks as slick as the rest of your terminal setup!

Unlocking Power with GitHub Copilot

One of the most impressive features of OpenCode is its flexibility in model provisioning. If you already have a GitHub Copilot subscription, you can use it as your Large Language Model (LLM) provider with OpenCode at no extra cost. This allows you to leverage the powerful models Copilot uses directly in your terminal agent.

To set up GitHub Copilot, use the authentication command:

opencode auth login
  1. In the interactive prompt, select GitHub Copilot as your provider.
  2. OpenCode will give you a one-time code and a URL (github.com/login/device).
  3. Open the URL in your browser, enter the code, and grant access to your GitHub account.

Once the login is complete, you can start a new session. You can now use the /models command within the OpenCode TUI to select a specific Copilot model to power your agent. This is a game-changer for terminal-first development!

Context-Aware Coding in Your Project

What sets OpenCode apart is its deep integration into your coding workflow. When you launch it inside a project directory, it doesn’t just treat you as a general user; it sees you as a developer working on that specific codebase.

Navigate to your project root and simply run the application:

cd /path/to/my/awesome-project
opencode

The first time you run it, you should initialize the agent to understand your project’s structure, dependencies, and coding patterns. You do this by running the internal /init command:

/init

This step will analyze your code (often using Language Server Protocol or LSP features) and create a configuration file, typically an AGENTS.md file, which acts as a blueprint for the AI. Commit this file to Git — it’s your AI’s map of the project!

Now, you can ask for features, bug fixes, or explanations with zero-context boilerplate, as OpenCode already understands the files you are working on.

Beautiful command line