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

CLI Reference

DevNote think about adding some more examples/usecases? Update/assure the commands are still as are and valid.

DevNote add some more notes, descriptions. Consider generating this.

Corteza command-line interface tool allows you to quickly interact with different parts of the system — from changing the settings to assigning roles to users.

Running CLI interface via docker

If you are running a deployment via docker or docker compose, you can easily execute an already running server outside of the containers.

Docker Compose

Refer to more docker compose examples at useful Docker commands.

$ docker-compose exec <service name> ./bin/corteza-server <command>

Docker

First, find the ID of the container which is running your Corteza server in the current project directory. You can use the accrued container ID to execute CLI commands as illustrated by the following example.

The example assumes the service name is server.

$ docker ps | grep `basename $PWD | sed -e 's/\.//g'`_server
$ docker exec <container ID> ./bin/corteza-server <command>

Authentication

Auto Discovery

Auto discovers new OIDC client.

Usage:
  corteza-server auth auto-discovery [name] [url] [flags]

Flags:
      --enable            Enable this provider and external auth
  -h, --help              help for auto-discovery
      --skip-validation   Skip validation

JWT

Generates a new JWT for a user.

Usage:
  corteza-server auth jwt [email-or-id] [flags]

Flags:
  -h, --help   help for jwt

Test Notification

Sends samples of all authentication notification to a recipient.

Usage:
  corteza-server auth test-notifications [recipient] [flags]

Flags:
  -h, --help   help for test-notifications

Import

Imports data from yaml sources.

When importing RBAC rules, the changes do not automatically change. RBAC rules are reloaded in 1h intervals. If you need to reflect the changes immediately, you will need to restart the Corteza server.

Usage:
  corteza-server import [flags]

Flags:
  -h, --help                   help for import
      --merge-left-existing    Update any existing values; existing data takes priority. Default skips.
      --merge-right-existing   Update any existing values; new data takes priority. Default skips.
      --replace-existing       Replace any existing values. Default skips.

Provision

Provision tasks

Usage:
  corteza-server provision [flags]

Flags:
  -h, --help   help for provision

RBAC

Checks and manipulates permissions.

Check

Checks applied permissions against given file (only supports compose permissions for now).

Usage:
  corteza-server rbac check [flags]

Flags:
  -h, --help   help for check

Roles

Role management

Add user

Adds a user to a role.

Usage:
  corteza-server roles useradd [role-ID-or-name-or-handle] [user-ID-or-email] [flags]

Flags:
  -h, --help   help for useradd

Serve api

Starts HTTP server with REST API.

Usage:
  corteza-server serve-api [flags]

Aliases:
  serve-api, serve

Flags:
  -h, --help   help for serve-api

Sink signature

Creates a signature for a sink HTTP endpoint.

Usage:
  corteza-server sink signature [flags]

Flags:
      --content-type string   Content type (optional)
      --expires string        Date of expiration (YYYY-MM-DD, optional)
  -h, --help                  help for signature
      --max-body-size int     Max allowed body size
      --method string         HTTP method that will be used (optional)
      --origin string         Origin of the request (arbitrary string, optional)
      --path string           Full sink request path (do not include /sink prefix, add / for just root)
      --signature-in-path     Include signature in a path instead of query string

Upgrading

Usage:
  corteza-server upgrade [flags]

Flags:
  -h, --help   help for upgrade

Users

User management

Add user

Add new user

Usage:
  corteza-server users add [email] [flags]

Flags:
  -h, --help          help for add
      --no-password   Create user without password

List

List users

Usage:
  corteza-server users list [flags]

Flags:
  -h, --help           help for list
  -l, --limit int      How many entry to display (default 20)
  -q, --query string   Query and filter by handle, email, name

Password

Change password for user

Usage:
  corteza-server users password [email] [flags]

Flags:
  -h, --help   help for password

Federation Sync

There are two commands with which you can handle federation sync:
  • data sync,

  • structure sync.

The two commands (corteza-server sync data and corteza-server sync structure) force the background watcher to run.

Usage:
  corteza-server sync [command]

Available Commands:
  data        Sync data
  structure   Sync structure

Flags:
  -h, --help   help for sync

Version

Usage:
  corteza-server version [flags]

Flags:
  -h, --help   help for version