Overview
Profiles give you a global configuration system that lives outside your project directories. Instead of initializing.opencode/ in every repository, you define your settings once and bring them anywhere.
When to Use Profiles
- When you work across multiple repositories and want consistent configuration.
- When you contribute to open source projects and need zero-footprint configuration.
- When you need to control what OpenCode sees in untrusted repositories.
- When you maintain separate configurations for work, personal, and client projects.
Core Concepts
Global vs Local Mode
| Aspect | Local Mode | Profile Mode |
|---|---|---|
| Config location | ./.opencode/ | ~/.config/opencode/profiles/<name>/ |
| Modifies repo | Yes | No |
| Per-project settings | Yes | Profile-isolated |
Requires ocx init | Yes | No (uses profile config) |
| Visibility control | No | Yes (exclude/include) |
| Registry scope | Project-only | Profile-isolated |
| Best for | Single project customization | Multi-project workflows |
What Is Inside a Profile
Each profile lives in~/.config/opencode/profiles/<name>/ and contains:
ocx.jsonc— OCX settings (registries, exclude/include patterns, custom binary)opencode.jsonc— OpenCode configurationAGENTS.md— Instructions for AI agents
How It Works
- Profile Resolution: OCX resolves the active profile using a priority chain (local config → CLI flag → env var → default profile → none).
- Instruction Discovery: OCX discovers instruction files walking up from the project directory to the git root.
- Pattern Filtering: Exclude/include patterns from the active profile filter which project instruction files OpenCode receives.
- Launch: OpenCode starts with the profile configuration and filtered instructions.
Profile Selection Priority
Profiles are resolved in this order:profilefield in.opencode/ocx.jsonc(project-specific profile)--profile <name>/-p <name>flag (explicit override)OCX_PROFILEenvironment variabledefaultprofile (if it exists)- No profile (base configurations only)
Directory Structure
Global Profiles
Local Project Config
Related Concepts
- Profile Configuration — Detailed configuration reference for exclude/include patterns and instruction discovery.
- Profile Security — Lock down recipes for untrusted repositories.
- CLI: Profile Commands — Full command reference for profile management.
See Also
- Quick Start — Set up your first profile.
- Enterprise Overview — Registry locking and integrity verification for teams.