Skip to main content
This page describes the protocol between oc (the core CLI) and plugins (standalone binaries). If you’re using oc to call plugins, this explains what happens under the hood. If you’re building a plugin, this is the contract you need to implement.

Discovery

Plugins are executable binaries stored in ~/.onecli/plugins/ with the naming convention oc-{name}. When you run oc google calendar list-events, oc looks for a binary at ~/.onecli/plugins/oc-google. The plugin directory can be overridden with ONECLI_PLUGIN_DIR.

Manifest

Every plugin must respond to the manifest subcommand with a JSON object describing its capabilities:

Manifest fields

Auth interface

Plugins that require authentication must respond to the auth subcommand. The auth flow uses newline-delimited JSON (NDJSON) on stdout:
oc reads the stdout stream and stores the first response where status is "ok" and credentials.access_token is non-empty.

Auth response fields

Command execution

When oc runs a plugin command, it:
  1. Resolves credentials from the vault or local storage
  2. Injects credentials as environment variables into the plugin’s process
  3. Executes the plugin binary as a subprocess with the remaining arguments
  4. Passes stdin/stdout/stderr directly between the caller and the plugin

Environment variable injection

Credentials are passed as environment variables with the naming convention OC_{PLUGINNAME}_{FIELD}: The plugin name is uppercased. All four fields are set if available.

Execution model

The plugin inherits the caller’s stdin, stdout, and stderr. oc does not modify the plugin’s output; it passes through directly.

Meta-commands

Two subcommands are special and run without credentials:
  • manifest returns the plugin’s manifest JSON
  • auth runs the plugin’s authentication flow
All other subcommands go through credential resolution first.

Archive format

Plugin releases follow the goreleaser naming convention:
Example: oc-google_1.0.1_darwin_arm64.tar.gz Each release must include a checksums.txt file with SHA256 hashes: