opencode.json or opencode.jsonc:
opencode.jsonc
Local directories
Usepath for a local directory:
~/docs are also
supported.
The string shorthand is useful when no other fields are needed:
A shorthand string is treated as a local path only when it starts with
.,
/, or ~. Use ./docs, not docs; a bare docs value is interpreted as
a Git repository.Git repositories
Userepository for a remote Git repository. GitHub owner/repo shorthand,
Git URLs, host/path forms, and SCP-style remotes are supported.
branch, OpenCode checks out and refreshes the remote’s default
branch. Branch names may contain letters, numbers, /, _, ., and -, but
cannot start with - or contain ... Local file: repositories are not
supported.
Git references also support shorthand:
Cloning and storage
OpenCode normalizes a remote and stores one checkout under its global data directory atopencode/repos/<host>/<repository-path>. On a typical Linux
installation, for example, Effect-TS/effect is stored at:
branch is omitted.
Materialization runs asynchronously when references load or reload, so a new
reference can appear before its checkout is ready. Clone and refresh failures
are logged and do not stop other references from loading.
Description and visibility
description tells agents when a reference is relevant. References with a
description are included in agent instructions with their alias and resolved
path. References without one remain available in @ autocomplete but are not
advertised automatically.
Set hidden to true to remove a reference from TUI @ autocomplete:
hidden controls only autocomplete visibility. It does not remove the
reference from the reference API or agent instructions when a description is
present.
Use references
Type@ in the TUI and select a reference alias to attach its root directory:
@alias/path is not a reference-specific file browser. Ask the agent to
inspect a particular path when more detail is needed.
References do not grant extra tool permissions. Access outside the active
Location remains subject to the agent’s normal tool rules and the
external_directory permission. Editing a reference additionally requires the
applicable edit permission.
Fields
| Field | Local | Git | Description |
|---|---|---|---|
path | Required | No | Local directory path |
repository | No | Required | Remote Git repository |
branch | No | Optional | Branch to fetch and check out |
description | Optional | Optional | Guidance describing when agents should use it |
hidden | Optional | Optional | Hide it from TUI @ autocomplete |
/, \, whitespace, a backtick, or a
comma.