Configuration and paths
Use this page for the low-level details that support the rest of the docs: where OCP stores state, how repository metadata is shaped, and which JVM properties override the defaults.
Default paths
- OCP registry:
~/.config/ocp/config.json - OCP storage root:
~/.config/ocp - Repository clone directory:
~/.config/ocp/repositories/<repo-name> - Repository metadata file:
~/.config/ocp/repositories/<repo-name>/repository.json - Resolved merged profile directory:
~/.config/ocp/resolved-profiles/<profile-name>/ - Backup directory:
~/.config/ocp/backups/<timestamp>/ - OpenCode target directory:
~/.config/opencode/
System property overrides
Advanced usage and tests can override paths with JVM properties:
ocp.config.dirocp.cache.dir(legacy storage override)ocp.opencode.config.dirocp.working.dir
config.json shape
{
"config": {
"activeProfile": "my-company",
"lastOcpVersionCheckEpochSeconds": 1741262400,
"latestOcpVersion": "0.2.0"
},
"repositories": [
{
"name": "my-repo",
"uri": "git@github.com:my-company/my-repo.git",
"localPath": "/home/user/.config/ocp/repositories/my-repo"
}
]
}
config.activeProfiledefaults tonull.config.lastOcpVersionCheckEpochSecondsdefaults tonulland records the last CLI update check attempt.config.latestOcpVersiondefaults tonulland stores the latest successful CLI release lookup.repositories[*].nameis required.repositories[*].uriis optional and isnullfor file-based repositories.repositories[*].localPathis required after normalization.- Git-backed repositories derive
localPathfrom storage root and repository name when no explicit path is stored. - File-based repositories store the normalized absolute path provided by the user.
- A repository entry may store both
uriandlocalPathwhen a local repository later gains a remote Git URI. In that case,localPathremains authoritative.
- Git-backed repositories derive
repository.json shape
{
"profiles": [
{ "name": "my-company", "description": "Company defaults" },
{ "name": "oss", "description": "Open-source profile", "extends_from": ["my-company"] }
]
}
profilesdefaults to an empty list.- Blank profile names are ignored.
descriptionis optional and may be omitted ornull.extends_fromis optional and uses an ordered array of parent profile names.- Legacy scalar
extends_fromvalues are accepted at read time and migrated on startup to a one-element array. - Profile names must be globally unique across all configured repositories.
Related reference pages
- Repositories and profiles for the higher-level mental model.
- Profile inheritance for merge and precedence rules.
- Repository commands for add, create, delete, list, and refresh behavior.