CLI reference

Stable contracts for people, automations, and AI agents using ploy.

Syntax

Global command shape
ploy [global options] <command> [command options]
Global optionMeaning
-v, --versionPrint the CLI version and exit 0.
-h, --helpShow help and exit 0.
--dry-runPreview supported mutations. Not every command accepts it.
--workspace <id>Override the effective workspace for one invocation.

Environment variables

VariableMeaning
PLOY_WORKSPACE_IDWorkspace override below --workspace and above saved selection.
PLOY_NO_UPDATE_CHECK=1Disable the best-effort daily update notice.
XDG_CONFIG_HOMEChange the parent directory used for CLI configuration.

Saved state

Config is stored at ~/.config/ploy/config.json, or $XDG_CONFIG_HOME/ploy/config.json when XDG_CONFIG_HOME is set. It is written with mode 0600 and may contain credentials plus selected workspace and site IDs.

Workspace and site resolution

  1. --workspace <id>
  2. PLOY_WORKSPACE_ID
  3. The workspace saved by ploy workspace use
  4. No workspace

Flags and environment variables do not update saved selection. Saving a different workspace clears the saved site. Commands that act on a selected site use the site stored by ploy site use.

Exit codes

CodeMeaning
0Success. Without --wait, asynchronous work was accepted or rejoined.
1Runtime, API, service validation, or terminal-operation failure.
2CLI usage error.
3Authentication required or credentials expired.
4site publish --wait timed out; the publish is still running.
5site publish --wait lost API contact; the publish is still running.

For asynchronous commands, use the returned operation or resource ID to inspect progress instead of starting duplicate work.

Agent and automation support

Area--json--dry-runTTY notes
Workspace/site selectionCommand-specificSupported with explicit IDsSelector requires a TTY
Site init/status/publishSupportedPublish onlyNot required with explicit context
Code SyncNoNoHuman-readable output
Variables, Secrets, dotenvNoSet/import onlyPrompt used when stdin/body omitted
DocumentsSupportedNoset reads stdin
Ploybooks and schedulesJSON by defaultMutationsFiles or inline content
Skills/design-system inspectionCommand-specificNoLocal checkout required

Command index

CLI lifecycle

  • ploy update
  • ploy help [command]
  • ploy --version

Authentication

  • ploy login
  • ploy logout
  • ploy whoami
  • ploy tokens
  • ploy token revoke <target>

Workspaces and sites

  • ploy workspace list|use|current
  • ploy site list|use|init|status|publish
  • ploy site publish-status <operation-id>
  • ploy site code-sync init|sync

Configuration

  • ploy variable set|get
  • ploy secret set|get
  • ploy env set

Content and workflows

  • ploy documents list|get|set
  • ploy ploybooks list
  • ploy ploybook get|read|outline|read-section
  • ploy ploybook create|update|edit|delete
  • ploy ploybook schedule list|create|update|delete

Local development

  • ploy skills init|sync
  • ploy design-system list-components|list-pages
  • ploy design-system get-page-components|get-theme-colors
  • ploy design-system plan-page-build|query

Detailed guides