Skip to content

Cuiman CLI

The cuiman tool is a shell client for any web services compliant with OGC API - Processes, Part 1: Core Standard.

Applications can create a branded CLI with new_cli(name="my-client", config_type=MyClientConfig). The selected configuration type is used consistently by configure, login, logout, and all request commands; it does not alter the default cuiman CLI's settings.

cuiman can be used to get the available processes, get process details, execute processes, and manage the jobs originating from the latter. It herewith resembles the core functionality of the OGC API - Processes, Part 1. For details see https://ogcapi.ogc.org/processes/.

You can use shorter command name aliases, e.g., use command name vr for validate-request, or lp for list-processes.

The tool's exit codes are as follows:

  • 0 - normal exit
  • 1 - user errors, argument errors
  • 2 - remote API errors
  • 3 - local network transport errors

If the --traceback flag is set, the original Python exception traceback will be shown and the exit code will always be 1. Otherwise, only the error message is shown.

Usage:

$ cuiman [OPTIONS] COMMAND [ARGS]...

Options:

  • --version: Show version and exit.
  • --traceback, --tb: Show server exception traceback, if any.
  • --install-completion: Install completion for the current shell.
  • --show-completion: Show completion for the current shell, to copy it or customize the installation.
  • --help: Show this message and exit.

Commands:

  • configure: Configure the client tool.
  • login: Reuse or obtain credentials and save them...
  • logout: Remove the locally stored credentials for...
  • generate-client: Generate the Python code for...
  • list-processes: List available processes.
  • get-process: Get process details.
  • create-request: Create an execution request (template) for...
  • validate-request: Validate a process execution request.
  • execute-process: Execute a process in asynchronous mode.
  • list-jobs: List all jobs.
  • get-job: Get job details.
  • dismiss-job: Cancel a running or delete a finished job.
  • get-job-results: Get job results.
  • show-app: Show the client app in a browser.

cuiman configure

Configure the client tool.

Prompts require an interactive terminal. In notebook shell commands or other noninteractive environments, supply all configuration options.

Usage:

$ cuiman configure [OPTIONS]

Options:

  • --api-url TEXT: The URL of a service complying to the OGC API - Processes.
  • -a, --auth-type TEXT: The authorisation method for the API (none|basic|token|login|oauth2|oidc|api-key).
  • --login-url TEXT: The proprietary login endpoint URL.
  • --token-url TEXT: The OAuth2 token endpoint URL.
  • --grant-type TEXT: The OAuth2 grant type (password|client_credentials).
  • --client-id TEXT: OAuth2 or OIDC client ID.
  • --issuer-url TEXT: The OpenID Connect issuer URL.
  • --scope TEXT: An OpenID Connect resource scope; repeat for multiple scopes.
  • --access-token-header TEXT: Custom header for static/proprietary tokens; empty means Bearer.
  • --api-key-header TEXT: Header used for API-key authentication.
  • -c, --config PATH: Client configuration file.
  • --help: Show this message and exit.

cuiman login

Reuse or obtain credentials and save them in the OS keyring.

Usage:

$ cuiman login [OPTIONS]

Options:

  • -c, --config PATH: Client configuration file.
  • --no-browser: Print the OIDC authorization URL instead of opening a browser.
  • --force: Sign in again, allowing credential prompts.
  • --no-input: Never prompt or open a browser; use supplied credentials.
  • --help: Show this message and exit.

cuiman logout

Remove the locally stored credentials for this configuration.

Usage:

$ cuiman logout [OPTIONS]

Options:

  • -c, --config PATH: Client configuration file.
  • --help: Show this message and exit.

cuiman generate-client

Generate the Python code for service-specific, higher-level client functions.

The command generates classes for both sync and async clients, which have methods that directly represent the processes of the currently configured processing service.

Usage:

$ cuiman generate-client [OPTIONS] NAME

Arguments:

  • NAME: Service name used for generated module and class names. [required]

Options:

  • -o, --output-dir TEXT: Directory where generated modules will be written. [default: .]
  • -c, --config PATH: Client configuration file.
  • --help: Show this message and exit.

cuiman list-processes

List available processes.

Usage:

$ cuiman list-processes [OPTIONS]

Options:

  • -c, --config PATH: Client configuration file.
  • -f, --format [simple|json|yaml]: Output format. [default: yaml]
  • --help: Show this message and exit.

cuiman get-process

Get process details.

Usage:

$ cuiman get-process [OPTIONS] PROCESS_ID

Arguments:

  • PROCESS_ID: Process identifier. [required]

Options:

  • -c, --config PATH: Client configuration file.
  • -f, --format [simple|json|yaml]: Output format. [default: yaml]
  • --help: Show this message and exit.

cuiman create-request

Create an execution request (template) for a given process.

The generated template comprises generated default values for all inputs. Note that they might not necessarily be valid. The generated template request may serve as a starting point for the actual, valid execution request.

Usage:

$ cuiman create-request [OPTIONS] [PROCESS_ID]

Arguments:

  • [PROCESS_ID]: Process identifier.

Options:

  • -d, --dotpath: Input names use dot-path notion to encode nested values, e.g., -i scene.colors.bg=red.
  • -c, --config PATH: Client configuration file.
  • -f, --format [simple|json|yaml]: Output format. [default: yaml]
  • --help: Show this message and exit.

cuiman validate-request

Validate a process execution request.

The execution request to be validated may be read from a file given by --request, or from stdin, or from the process_id argument with zero, one, or more --input (or -i) options.

The process_id argument and any given --input options will override settings with the same name found in the given request file or stdin, if any.

Usage:

$ cuiman validate-request [OPTIONS] [PROCESS_ID]

Arguments:

  • [PROCESS_ID]: Process identifier.

Options:

  • -d, --dotpath: Input names use dot-path notion to encode nested values, e.g., -i scene.colors.bg=red.
  • -i, --input [NAME=VALUE]...: Process input value.
  • -r, --request PATH: Execution request file. Use - to read from .
  • -f, --format [simple|json|yaml]: Output format. [default: yaml]
  • --help: Show this message and exit.

cuiman execute-process

Execute a process in asynchronous mode.

The execution request to be submitted may be read from a file given by --request, or from stdin, or from the process_id argument with zero, one, or more --input (or -i) options.

The process_id argument and any given --input options will override settings with same name found in the given request file or stdin, if any.

Usage:

$ cuiman execute-process [OPTIONS] [PROCESS_ID]

Arguments:

  • [PROCESS_ID]: Process identifier.

Options:

  • -d, --dotpath: Input names use dot-path notion to encode nested values, e.g., -i scene.colors.bg=red.
  • -i, --input [NAME=VALUE]...: Process input value.
  • -s, --subscriber [NAME=URL]...: Process subscriber URL.
  • -r, --request PATH: Execution request file. Use - to read from .
  • -c, --config PATH: Client configuration file.
  • -f, --format [simple|json|yaml]: Output format. [default: yaml]
  • --help: Show this message and exit.

cuiman list-jobs

List all jobs.

Usage:

$ cuiman list-jobs [OPTIONS]

Options:

  • -c, --config PATH: Client configuration file.
  • -f, --format [simple|json|yaml]: Output format. [default: yaml]
  • --help: Show this message and exit.

cuiman get-job

Get job details.

Usage:

$ cuiman get-job [OPTIONS] JOB_ID

Arguments:

  • JOB_ID: Job identifier. [required]

Options:

  • -c, --config PATH: Client configuration file.
  • -f, --format [simple|json|yaml]: Output format. [default: yaml]
  • --help: Show this message and exit.

cuiman dismiss-job

Cancel a running or delete a finished job.

Usage:

$ cuiman dismiss-job [OPTIONS] JOB_ID

Arguments:

  • JOB_ID: Job identifier. [required]

Options:

  • -c, --config PATH: Client configuration file.
  • -f, --format [simple|json|yaml]: Output format. [default: yaml]
  • --help: Show this message and exit.

cuiman get-job-results

Get job results.

Usage:

$ cuiman get-job-results [OPTIONS] JOB_ID

Arguments:

  • JOB_ID: Job identifier. [required]

Options:

  • -c, --config PATH: Client configuration file.
  • -f, --format [simple|json|yaml]: Output format. [default: yaml]
  • --help: Show this message and exit.

cuiman show-app

Show the client app in a browser.

Usage:

$ cuiman show-app [OPTIONS]

Options:

  • -c, --config PATH: Client configuration file.
  • -d, --debug: Output debugging information to the browser's dev console.
  • --help: Show this message and exit.