You are reading the documentation for an outdated Corteza release. 2024.9 is the latest stable Corteza release.

Corteza Command Line Interface (CLI)

Corteza comes with command line interface tool. With it, you can manually or automatically change applications settings, add users, roles, and run the API. You are using the same binary that can start the backend service and the API.

Depending on built flavour, you can use a different entry:
  • Microservice build produce corteza-server-system, corteza-server-messaging and corteza-server-compose

  • Monolith build produces corteza-server binary with system, messaging, compose subcommands

Using the CLI tool

At least basic Docker and Docker Compose knowledge is required for most Corteza setup and management.
Executing with Docker Compose (when service is started)
docker-compose exec <service name> help
Executing with docker (when container is running)
docker exec -it <container name> help
Running with Docker Compose (when service is not started)
docker run -it --rm <container name> help
Executing with Docker (when container is not running)
docker run -it --rm [docker run options] <container name> help
Running and executing with Docker Compose should be easier and simpler because all required options and settings for container are packed in the Docker Compose project configuration file (docker-compose.yaml)
Start HTTP Server with REST API
Usage:
  corteza-server serve-api [flags]

Flags:
  -h, --help   help for serve-api
Provision tasks
Usage:
  corteza-server provision [command]

Available Commands:
  configuration    Create permissions & resources
  migrate-database Run database migration scripts

Flags:
  -h, --help   help for provision

Use "corteza-server provision [command] --help" for more information about a command.
Create permissions & resources
Usage:
  corteza-server provision configuration [flags]

Flags:
  -h, --help   help for configuration
Run database migration scripts
Usage:
  corteza-server provision migrate-database [flags]

Flags:
  -h, --help   help for migrate-database
External authentication
Usage:
  corteza-server system auth [command]

Available Commands:
  auto-discovery     Auto discovers new OIDC client
  jwt                Generates new JWT for a user
  test-notifications Sends samples of all authentication notification to receipient

Flags:
  -h, --help   help for auth

Use "corteza-server system auth [command] --help" for more information about a command.
Auto discovers new OIDC client
Usage:
  corteza-server system auth auto-discovery [name] [url] [flags]

Flags:
      --enable            Enable this provider and external auth
  -h, --help              help for auto-discovery
      --skip-validation   Skip validation
Sends samples of all authentication notification to receipient
Usage:
  corteza-server system auth test-notifications [recipient] [flags]

Flags:
  -h, --help   help for test-notifications
Generates new JWT for a user
Usage:
  corteza-server system auth jwt [email-or-id] [flags]

Flags:
  -h, --help   help for jwt
Export system resources
Usage:
  corteza-server system export [flags]

Flags:
  -h, --help          help for export
  -p, --permissions   Export system permissions
  -s, --settings      Export settings
Import
Usage:
  corteza-server system import [flags]

Flags:
  -h, --help   help for import
Role management
Usage:
  corteza-server system roles [command]

Available Commands:
  useradd     Add user to role

Flags:
  -h, --help   help for roles

Use "corteza-server system roles [command] --help" for more information about a command.
Add user to role
Usage:
  corteza-server system roles useradd [role-ID-or-name-or-handle] [user-ID-or-email] [flags]

Flags:
  -h, --help   help for useradd
Settings management
Usage:
  corteza-server system settings [command]

Available Commands:
  delete      Set value (raw JSON) for a specific key (or by prefix)
  export      Import settings as JSON to stdout or file
  get         Get value (raw JSON) for a specific key
  import      Import settings as JSON from stdin or file
  list        List all
  set         Set value (raw JSON) for a specific key

Flags:
  -h, --help   help for settings

Use "corteza-server system settings [command] --help" for more information about a command.
Set value (raw JSON) for a specific key (or by prefix)
Usage:
  corteza-server system settings delete [keys, ...] [flags]

Flags:
  -h, --help            help for delete
      --prefix string   Filter settings by prefix
Import settings as JSON to stdout or file
Usage:
  corteza-server system settings export [file] [flags]

Flags:
  -h, --help   help for export
Get value (raw JSON) for a specific key
Usage:
  corteza-server system settings get [key to get, ...] [flags]

Flags:
  -h, --help   help for get
Import settings as JSON from stdin or file
Usage:
  corteza-server system settings import [file] [flags]

Flags:
  -h, --help   help for import
List all
Usage:
  corteza-server system settings list [flags]

Flags:
  -h, --help            help for list
      --prefix string   Filter settings by prefix
Set value (raw JSON) for a specific key
Usage:
  corteza-server system settings set [key to set] [value] [flags]

Flags:
  -h, --help   help for set
Sink
Usage:
  corteza-server system sink [command]

Available Commands:
  signature   Creates signature for sink HTTP endpoint

Flags:
  -h, --help   help for sink

Use "corteza-server system sink [command] --help" for more information about a command.
Creates signature for sink HTTP endpoint
Usage:
  corteza-server system sink signature [flags]

Flags:
      --content-type string   Content type (optional)
      --expires string        Date of expiration (YYYY-MM-DD, optional)
  -h, --help                  help for signature
      --method string         HTTP method that will be used (default "GET")
      --origin string         Origin of the request (arbitrary string, optional)
User management
Usage:
  corteza-server system users [command]

Available Commands:
  add         Add new user
  list        List users
  password    Change password for user

Flags:
  -h, --help   help for users

Use "corteza-server system users [command] --help" for more information about a command.
Add new user
Usage:
  corteza-server system users add [email] [flags]

Flags:
  -h, --help          help for add
      --no-password   Create user without password
List users
Usage:
  corteza-server system users list [flags]

Flags:
  -h, --help   help for list
Change password for user
Usage:
  corteza-server system users password [email] [flags]

Flags:
  -h, --help   help for password
Specify one ("modules", "pages", "charts", "permissions") or more resources to export
Usage:
  corteza-server compose export [flags]

Flags:
  -h, --help               help for export
      --namespace string   Export namespace resources (by ID or string)
  -p, --permissions        Export system permissions
  -s, --settings           Export settings
Import
Usage:
  corteza-server compose import [flags]

Flags:
  -h, --help               help for import
      --namespace string   Import into namespace (by ID or string)
Export Messaging resources
Usage:
  corteza-server messaging export [flags]

Flags:
  -h, --help          help for export
  -p, --permissions   Export system permissions
  -s, --settings      Export settings
Import
Usage:
  corteza-server messaging import [flags]

Flags:
  -h, --help   help for import