OpenCode Commands

OpenCode commands let you create custom shortcuts for repetitive tasks. Run them with /command-name in the TUI.

What it is

Commands are markdown files in .opencode/commands/ that define prompts. When you run a command, it executes the prompt with any arguments you pass.

How to create

Create .opencode/commands/<name>.md:

---
description: Do something useful
agent: explore
---
Your prompt here. Use $ARGUMENTS or $1, $2, etc. for args.

Arguments

Example:

/write-note https://github.com/user/repo

Special placeholders

Options

Example command

Here’s the write-note command I created:

---
description: Write a blog note from a URL
agent: explore
---
Write a short blogpost/note about the project at $1.
...

Now I can run /write-note https://github.com/user/repo to automatically create notes from GitHub repos.

Built-in commands: /init, /undo, /redo, /share, /help. Custom commands can override these.

Check the docs at opencode.ai/docs/commands for more.

Date
19.02.2026
Categories
Tags