CLI reference
This page covers user-facing CLI operations. Run apex <command> --help for the complete options supported by the installed version.
Command workflow
Section titled “Command workflow”| Command | Purpose | Connects to or changes targets |
|---|---|---|
check |
Check Deployment YAML and node connectivity | Checks nodes; does not install |
validate |
Validate the Deployment and component manifests; resolve dynamic versions | No |
prepare |
Download or import artifacts and verify SHA256 | No |
apply |
Deploy using prepared artifacts | Yes |
deploy |
Run check, validate, prepare, and apply in order | Yes |
For a controlled deployment, run check, validate, and prepare, review apply --dry-run, then deploy:
apex check -f deployment.yamlapex validate -f deployment.yaml --manifests ~/.apex/manifests -o resolved.yamlapex prepare -f resolved.yaml --manifests ~/.apex/manifestsapex apply -f resolved.yaml --manifests ~/.apex/manifests --dry-runapex apply -f resolved.yaml --manifests ~/.apex/manifestsFor a one-command deployment, use apex deploy -f deployment.yaml. Automation should pass --yes when it intentionally accepts confirmation prompts.
Version resolution
Section titled “Version resolution”validate resolves version: auto and release-based versions, and writes a resolved Deployment. Pass the reported resolvedDeploymentYaml to prepare and apply so every stage uses the same exact versions. Select the version cache policy with --use-cached-versions, --refresh-versions, or --offline. prepare and apply do not resolve dynamic versions.
Preparing artifacts
Section titled “Preparing artifacts”Online:
apex prepare -f resolved.yaml --manifests ~/.apex/manifestsImport from an offline directory:
apex prepare -f resolved.yaml --manifests ~/.apex/manifests --offline-dir ./bundleprepare matches offline artifacts by the exact filenames in the manifests and verifies SHA256. Missing required artifacts cause an error. apply only uses prepared cache content; it does not download artifacts or search the offline directory.
Plans and lifecycle
Section titled “Plans and lifecycle”apex apply -f resolved.yaml --dry-runapex apply -f resolved.yaml --install-mode full--dry-run produces a plan and command preview without connecting to nodes, transferring files, or executing commands. --install-mode compact|full overrides role modes without changing the source YAML. Step-selection options are intended for staged maintenance; use them only when you understand component dependencies and installation state. After preparing the required artifacts, a full apply without step selectors performs the normal deployment checks.
Optional packages
Section titled “Optional packages”apex package listapex package install explorerapex package remove explorerPackage commands use the Default Deployment saved after the last successful full deployment. Use -f deployment.yaml if no snapshot is available, another context is required, or SSH credentials are not present in the snapshot. Removal prompts for confirmation; pass --yes for automation. Optional packages cannot be installed or removed independently in full mode.
Cleanup and diagnostics
Section titled “Cleanup and diagnostics”apex versionapex clean -f deployment.yamlclean deletes the Apex working directory on the Deployment targets and requires confirmation. It is not a product uninstall command; verify spec.apexDir before proceeding. For product removal and data cleanup, use the commands in Component management. Reports are stored in reports/ and operation logs in logs/ under Apex Home.
Common options
Section titled “Common options”-f/--file: Deployment YAML path.--manifests: Component Manifest directory; defaults to the directory under Apex Home.--cache: Artifact cache directory.--offline: Avoid network access and use local cache or artifacts.--yes: Confirm operations that otherwise prompt.
Options vary by subcommand; use that command’s --help output as the source of truth.