Skip to main content
Skip to main content
🚧 Work in Progress

Zerops CLI Commands Reference

Basic Usage​

zcli <command> [flags]
Tip

All commands support the -h, --help flag which displays help information about the command.

Configuration

For detailed information about configuration options, environment variables, and logging, see the Zerops CLI Configuration page.

Command Groups​

Account & VPN​

login​

Logs you into Zerops using a generated token or your login credentials.

zcli login <token>

logout​

Disconnects from VPN and logs out from your Zerops account.

zcli logout

vpn up​

Connects to the Zerops VPN.

zcli vpn up [projectId] [flags]

Flags:

  • --auto-disconnect - Automatically disconnect from VPN if already connected
  • --mtu int - Set custom MTU value for Wireguard interface (default: 1420)
  • --projectId string - Required when you have access to multiple projects
Note

You can set a default project ID for VPN connections in a .zcli.yml file or via the ZEROPS_PROJECTID environment variable. See the Configuration page for details.

vpn down​

Disconnects from the Zerops VPN.

zcli vpn down
Note

For more detailed information about Zerops VPN configuration and troubleshooting, visit the VPN Documentation.

Project Management​

project list​

Lists all projects you have access to.

zcli project list

project delete​

Deletes a project and all its services.

zcli project delete [projectId] [flags]

Flags:

  • --confirm - Skip confirmation prompts for destructive operations
  • --projectId string - Required when you have access to multiple projects

project project-import​

Creates a new project with one or more services from a YAML definition.

zcli project project-import <importYamlPath> [flags]

Flags:

  • --orgId string - Organization ID where the project should be created (required for multiple organizations)
  • --workingDir string - Sets a custom working directory (default: "./")

project service-import​

Creates one or more services in an existing project from a YAML definition.

zcli project service-import <importYamlPath> [flags]

Flags:

  • --projectId string - Required when you have access to multiple projects

scope project​

Sets the default project for commands that require a project ID.

zcli scope project [projectId]
Tip

Instead of using the scope project command, you can also set a default project ID in a .zcli.yml file or via the ZEROPS_PROJECTID environment variable. See the Configuration page for details.

scope reset​

Resets the default project and service scope.

zcli scope reset

Service Operations​

service list​

Lists all services in a project.

zcli service list [flags]

Flags:

  • --projectId string - Required when you have access to multiple projects

service push​

Builds your application in Zerops and deploys it. This is the recommended way to deploy your code.

zcli service push [serviceIdOrName] [flags]

Flags:

  • --archiveFilePath string - Creates a tar.gz archive with application code
  • -g, --deployGitFolder - Include the .git folder in the upload
  • --disableLogs - Disable logs during push
  • -v, --verbose - Log additional debug data to the zCLI debug log file
  • --projectId string - Required when you have access to multiple projects
  • --serviceId string - Required when you have access to multiple services
  • --setup string - Choose setup to use from zerops.yml
  • --versionName string - Adds a custom version name
  • --workingDir string - Sets a custom working directory (default: "./")
  • -w, --workspaceState string - Defines version of workspace to push:
    • clean - pushes the HEAD without local changes
    • staged - pushes only staged files
    • all - pushes all staged and unstaged files (default)
  • --zeropsYamlPath string - Sets a custom path to the zerops.yml file
Tip

You can also use zcli push as a shorthand for zcli service push.

To avoid specifying --projectId and --serviceId flags repeatedly, you can set default values in a .zcli.yml file or via environment variables. See the Configuration page for details.

service deploy​

Deploys your application to Zerops. Similar to push but focuses on deployment only.

zcli service deploy [serviceIdOrName]

Flags: Same as service push command.

service start/stop​

Commands to start or stop a Zerops service.

zcli service start [serviceIdOrName] [flags]
zcli service stop [serviceIdOrName] [flags]

Flags for both commands:

  • --projectId string - Required when you have access to multiple projects
  • --serviceId string - Required when you have access to multiple services

service delete​

Deletes a Zerops service.

zcli service delete [serviceIdOrName] [flags]

Flags:

  • --confirm - Skip confirmation prompts for destructive operations
  • --projectId string - Required when you have access to multiple projects
  • --serviceId string - Required when you have access to multiple services

service enable-subdomain​

Enables access to your service through a Zerops subdomain.

zcli service enable-subdomain [serviceIdOrName] [flags]

Flags:

  • --projectId string - Required when you have access to multiple projects
  • --serviceId string - Required when you have access to multiple services

service log​

Gets service runtime or build logs to stdout.

zcli service log [serviceIdOrName] [flags]

Flags:

  • --follow - Continuously poll for new log messages
  • --format <format> - Log output format (FULL, SHORT, JSON, JSONSTREAM)
  • --formatTemplate <template> - Custom log format
  • --limit <number> - Number of recent log messages to return (1-1000, default: 100)
  • --messageType <type> - Select APPLICATION or WEBSERVER log messages
  • --minimumSeverity <severity> - Filter by severity level
  • --projectId string - Required when you have access to multiple projects
  • --serviceId string - Required when you have access to multiple services
  • --showBuildLogs - Show build logs instead of runtime logs

Utility Commands​

env​

Displays global environment variables and their paths.

zcli env

version​

Shows the current zCLI version.

zcli version

show-debug-logs​

Displays debug logs for troubleshooting.

zcli show-debug-logs

support​

Displays information about how to contact Zerops support.

zcli support

completion​

Generates shell autocompletion scripts.

zcli completion {bash|fish|powershell|zsh}

Available Shells:

  • bash - Generate autocompletion script for Bash
  • fish - Generate autocompletion script for Fish
  • powershell - Generate autocompletion script for PowerShell
  • zsh - Generate autocompletion script for Zsh

Example:

zcli completion bash > ~/.zerops-completion.bash
echo 'source ~/.zerops-completion.bash' >> ~/.bashrc