Skip to content
ocx
install

Command line

Options before the command name apply to every command. Each command group has its own page.

When to use ANSI colors in output.

Default auto: color only on a terminal. An explicit --color outranks NO_COLOR, CLICOLOR and CLICOLOR_FORCE.

  • Value: auto|always|never

Path to the ocx configuration file.

Can also be set via the OCX_CONFIG environment variable. The file must exist, or the command exits 79.

To disable config discovery entirely, set OCX_NO_CONFIG=1.

The file layers on top of the discovered system, user and $OCX_HOME files and of the managed tier; it does not replace them.

Output format for stdout reports: plain (default) or json.

Applies to every command; there is no per-command --format. The --shell[=NAME] output of env / package env is unaffected.

Each report’s fields are in the reports schema, https://ocx.sh/schemas/reports/v1.json.

  • Value: json|plain

Freeze tag resolution to the local index; never fetch an unknown tag.

A tag in the local index resolves from cache. A digest-pinned reference (or a tag ocx.lock pins) still fetches its content.

An unpinned tag missing from the index errors. Populate the index first with ocx index update (refused under this flag, exit 81).

Scoped to packages: patch companions and managed configuration still resolve live. Unlike --offline and Cargo’s --frozen, the network stays reachable for known content.

Conflicts with --remote. Env var: OCX_FROZEN.

Select the global toolchain ($OCX_HOME/ocx.toml) as the project file in effect, instead of discovering a project by CWD walk.

Mutually exclusive with --project. Resolution-affecting: forwarded to child ocx processes via OCX_GLOBAL.

Equivalent env var: OCX_GLOBAL. The global toolchain never composes into project resolution; ocx exec and ocx package exec stay hermetic and never read it.

Before the subcommand -g means --global; after it, -g means --group. Nothing selects the global toolchain implicitly.

Overrides the local index home directory.

The local index is a collection of per-source subtrees, one per configured registry or index, each holding tag roots plus their manifest data. Resolution can work fully offline once it is populated.

This flag redirects the whole collection, replacing the default at $OCX_HOME/index.

Digest-addressed lookups still consult the local index even under --remote; only tag listings and tag->manifest lookups route to the remote registry there. Can also be set via the OCX_INDEX environment variable.

Maximum number of root packages to pull concurrently.

0 means “use all logical cores” (GNU Parallel convention). Omitting the flag falls back to the OCX_JOBS environment variable; when neither is set, pulls run unbounded.

Negative values are rejected at parse time.

Caps only the outer dispatch - transitive dependency and layer extraction stay unbounded.

Shorthand for --format json.

Last one wins if combined with --format.

The log level to use.

Default info. Logs go to stderr, never stdout.

At info and below a line reads error: message or warning: message; debug and trace add a timestamp and level. Can also be set via the OCX_LOG_LEVEL environment variable.

  • Short: -l
  • Value: trace|debug|info|warn|error|off
  • Environment: OCX_LOG_LEVEL

Disable all network access.

Tag->digest resolution must be satisfied by the local index or a digest-pinned identifier; unpinned tags missing from the local index exit 81. Run ocx index update online first, or switch to a digest-pinned identifier.

Useful for hermetic CI runs and air-gapped environments.

Equivalent env var: OCX_OFFLINE.

Project directory, or the project file itself (project-tier toolchain config).

A directory resolves to the ocx.toml inside it, so --project . and --project /path/to/repo both work; a file may have any name (like Cargo --manifest-path). Equivalent env var: OCX_PROJECT; OCX_NO_PROJECT=1 disables project discovery.

A path that does not exist exits 79, a directory with no ocx.toml exits 64, and an unreadable path exits 74.

Suppress the stdout report and progress bars (errors and warnings remain).

When set, the CLI’s structured report (table or JSON) is not printed and no transfer progress is rendered on stderr. Equivalent env var: OCX_QUIET.

Route mutable lookups (tag list, catalog, tag->manifest) to the remote registry instead of the local index.

Pure queries (index list, index catalog, package description pull) do not persist the result to the local index - use ocx index update to refresh the local index explicitly. Implies network access.

Combined with --offline the result is “pinned-only mode”: no source contact. Any tag-addressed resolution that cannot be satisfied locally errors instead of silently falling back.

Equivalent env var: OCX_REMOTE.

Every command is documented on the page of its group.

PageCommands
Top-level commandsocx about, ocx add, ocx clean, ocx env, ocx exec, ocx init, ocx inspect, ocx lock, ocx login, ocx logout, ocx pull, ocx remove, ocx status, ocx update, ocx upgrade, ocx version
ocx configocx config, ocx config push, ocx config setup, ocx config test, ocx config update
ocx direnvocx direnv, ocx direnv export, ocx direnv init
ocx indexocx index, ocx index catalog, ocx index list, ocx index regenerate, ocx index sync, ocx index update
ocx package: publishingocx package, ocx package announce, ocx package attest, ocx package cascade, ocx package cascade check, ocx package cascade repair, ocx package claim, ocx package copy, ocx package create, ocx package description, ocx package description pull, ocx package description push, ocx package push, ocx package sign, ocx package test
ocx package: consumingocx package deps, ocx package deselect, ocx package env, ocx package exec, ocx package inspect, ocx package install, ocx package prune, ocx package pull, ocx package receipt, ocx package sbom, ocx package select, ocx package uninstall, ocx package verify, ocx package which
ocx patchocx patch, ocx patch freeze, ocx patch publish, ocx patch sync, ocx patch test, ocx patch why
ocx selfocx self, ocx self activate, ocx self setup, ocx self update
ocx shellocx shell, ocx shell allow, ocx shell completion, ocx shell revoke, ocx shell state

These anchors resolve on the page listed.

AnchorPage
aboutcommands.md#about
addcommands.md#add
cleancommands.md#clean
configconfig.md#config
config-pushconfig.md#config-push
config-setupconfig.md#config-setup
config-testconfig.md#config-test
config-updateconfig.md#config-update
depspackage-consuming.md#deps
direnvdirenv.md#direnv
direnv-exportdirenv.md#direnv-export
direnv-initdirenv.md#direnv-init
env-rootcommands.md#env-root
execcommands.md#exec
exit-codes../exit-codes.md
indexindex-commands.md#index
index-catalogindex-commands.md#index-catalog
index-listindex-commands.md#index-list
index-regenerateindex-commands.md#index-regenerate
index-syncindex-commands.md#index-sync
index-updateindex-commands.md#index-update
initcommands.md#init
inspectcommands.md#inspect
lockcommands.md#lock
logincommands.md#login
logoutcommands.md#logout
packagepackage-publishing.md#package
package-announcepackage-publishing.md#package-announce
package-attestpackage-publishing.md#package-attest
package-cascadepackage-publishing.md#package-cascade
package-cascade-checkpackage-publishing.md#package-cascade-check
package-cascade-repairpackage-publishing.md#package-cascade-repair
package-claimpackage-publishing.md#package-claim
package-copypackage-publishing.md#package-copy
package-createpackage-publishing.md#package-create
package-descriptionpackage-publishing.md#package-description
package-description-pullpackage-publishing.md#package-description-pull
package-description-pushpackage-publishing.md#package-description-push
package-deselectpackage-consuming.md#package-deselect
package-envpackage-consuming.md#package-env
package-execpackage-consuming.md#package-exec
package-inspectpackage-consuming.md#package-inspect
package-installpackage-consuming.md#package-install
package-prunepackage-consuming.md#package-prune
package-pullpackage-consuming.md#package-pull
package-pushpackage-publishing.md#package-push
package-receiptpackage-consuming.md#package-receipt
package-sbompackage-consuming.md#package-sbom
package-selectpackage-consuming.md#package-select
package-signpackage-publishing.md#package-sign
package-testpackage-publishing.md#package-test
package-uninstallpackage-consuming.md#package-uninstall
package-verifypackage-consuming.md#package-verify
patchpatch.md#patch
patch-freezepatch.md#patch-freeze
patch-publishpatch.md#patch-publish
patch-syncpatch.md#patch-sync
patch-testpatch.md#patch-test
patch-whypatch.md#patch-why
pullcommands.md#pull
removecommands.md#remove
selfself.md#self
self-activateself.md#self-activate
self-setupself.md#self-setup
self-updateself.md#self-update
shellshell.md#shell
shell-allowshell.md#shell-allow
shell-completionshell.md#shell-completion
shell-revokeshell.md#shell-revoke
shell-stateshell.md#shell-state
statuscommands.md#status
updatecommands.md#update
upgradecommands.md#upgrade
versioncommands.md#version
whichpackage-consuming.md#which