Absortio

Email → Summary → Bookmark → Email

Intro

https://opencode.ai/docs/ Sep 26, 2025 23:20

Extracto

Get started with opencode.

Resumen

Resumen Principal

opencode se posiciona como un agente de codificación de IA diseñado para operar directamente en la terminal, ofreciendo una solución integral para el desarrollo de software asistido por inteligencia artificial. Su arquitectura permite a los usuarios integrarlo en sus flujos de trabajo existentes, requiriendo solamente un emulador de terminal moderno y claves API de proveedores de LLM. La herramienta se distingue por su proceso de instalación y configuración simplificado, así como por un paso crucial de inicialización del proyecto que involucra el análisis del código base para generar un archivo AGENTS.md. Este archivo es fundamental para que opencode desarrolle una comprensión profunda de la estructura y los patrones de codificación del proyecto, permitiéndole interactuar de manera altamente contextualizada. Sus capacidades abarcan desde la explicación de segmentos de código hasta la adición y modificación de características complejas, empleando modos de interacción duales (Plan y Build) para optimizar el proceso de desarrollo y garantizar la iteración controlada. Además, ofrece herramientas esenciales como deshacer y rehacer cambios, y la posibilidad de compartir conversaciones, consolidándose como un asistente de codificación robusto y colaborativo.

Elementos Clave

  • Integración y Configuración Flexible: opencode requiere un emulador de terminal moderno y permite la conexión con cualquier proveedor de LLM mediante claves API, ofreciendo opencode zen como una opción curada y verificada. El proceso de autenticación es directo, y la instalación se simplifica a través de un script curl o administradores de paquetes populares como npm, Homebrew, Chocolatey, WinGet y Scoop, asegurando su accesibilidad en diversas plataformas.
  • Análisis de Proyecto Profundo con AGENTS.md: Antes de la interacción activa, opencode se inicializa dentro de un proyecto, analizando su estructura y patrones de codificación para crear un archivo **AGENTS.md

Contenido

opencode is an AI coding agent built for the terminal.

opencode TUI with the opencode theme

Let’s get started.


Prerequisites

To use opencode, you’ll need:

  1. A modern terminal emulator like:

  2. API keys for the LLM providers you want to use.


Install

The easiest way to install opencode is through the install script.

curl -fsSL https://opencode.ai/install | bash

You can also install it with the following commands:

  • Using Node.js

    bash npm install -g opencode-ai

  • Using Homebrew on macOS and Linux

    brew install sst/tap/opencode

  • Using Paru on Arch Linux

Windows

  • Using Chocolatey

  • Using WinGet

  • Using Scoop

    scoop bucket add extras

    scoop install extras/opencode

  • Using NPM

    npm install -g opencode-ai

Support for installing opencode on Windows using Bun is currently in progress.

You can also grab the binary from the Releases.


Configure

With opencode you can use any LLM provider by configuring their API keys.

If you are new to using LLM providers, we recommend using opencode zen. It’s a curated list of models that have been tested and verified by the opencode team.

  1. Run opencode auth login, select opencode, and head to opencode.ai/auth.

  2. Sign in, add your billing details, and copy your API key.

  3. Paste your API key.

    $ opencode auth login

    Add credential

    Select provider

    opencode

    Create an api key at https://opencode.ai/auth

    Enter your API key

    _

Alternatively, you can select one of the other providers. Learn more.


Initialize

Now that you’ve configured a provider, you can navigate to a project that you want to work on.

And run opencode.

Next, initialize opencode for the project by running the following command.

This will get opencode to analyze your project and create an AGENTS.md file in the project root.

This helps opencode understand the project structure and the coding patterns used.


Usage

You are now ready to use opencode to work on your project. Feel free to ask it anything!

If you are new to using an AI coding agent, here are some examples that might help.


Ask questions

You can ask opencode to explain the codebase to you.

How is authentication handled in @packages/functions/src/api/index.ts

This is helpful if there’s a part of the codebase that you didn’t work on.


Add features

You can ask opencode to add new features to your project. Though we first recommend asking it to create a plan.

  1. Create a plan

    opencode has a Plan mode that disables its ability to make changes and instead suggest how it’ll implement the feature.

    Switch to it using the Tab key. You’ll see an indicator for this in the lower right corner.

    Now let’s describe what we want it to do.

    When a user deletes a note, we'd like to flag it as deleted in the database.

    Then create a screen that shows all the recently deleted notes.

    From this screen, the user can undelete a note or permanently delete it.

    You want to give opencode enough details to understand what you want. It helps to talk to it like you are talking to a junior developer on your team.

  2. Iterate on the plan

    Once it gives you a plan, you can give it feedback or add more details.

    We'd like to design this new screen using a design I've used before.

    [Image #1] Take a look at this image and use it as a reference.

    opencode can scan any images you give it and add them to the prompt. You can do this by dragging and dropping an image into the terminal.

  3. Build the feature

    Once you feel comfortable with the plan, switch back to Build mode by hitting the Tab key again.

    And asking it to make the changes.

    Sounds good! Go ahead and make the changes.


Make changes

For more straightforward changes, you can ask opencode to directly build it without having to review the plan first.

We need to add authentication to the /settings route. Take a look at how this is

handled in the /notes route in @packages/functions/src/notes.ts and implement

the same logic in @packages/functions/src/settings.ts

You want to make sure you provide a good amount of detail so opencode makes the right changes.


Undo changes

Let’s say you ask opencode to make some changes.

Can you refactor the function in @packages/functions/src/api/index.ts?

But you realize that it is not what you wanted. You can undo the changes using the /undo command.

opencode will now revert the changes you made and show your original message again.

Can you refactor the function in @packages/functions/src/api/index.ts?

From here you can tweak the prompt and ask opencode to try again.

Or you can redo the changes using the /redo command.


The conversations that you have with opencode can be shared with your team.

This will create a link to the current conversation and copy it to your clipboard.

Here’s an example conversation with opencode.


Customize

And that’s it! You are now a pro at using opencode.

To make it your own, we recommend picking a theme, customizing the keybinds, configuring code formatters, creating custom commands, or playing around with the opencode config.

Fuente: opencode