Appearance
CLI Reference
The PLANQK Command Line Interface (CLI) lets you interact with the PLANQK Platform directly from your terminal. We have installation instructions to guide you through the initial setup in our quickstart guide.
Installation
To install the PLANQK CLI, you must install Node.js 18 or higher and the npm command line interface using either a Node version manager or a Node installer.
Then install the PLANQK CLI globally using npm:
bash
npm install -g @planqk/planqk-cli
IMPORTANT
Make sure you have uninstalled the deprecated CLI:
bash
npm uninstall -g @anaqor/planqk
You can use the help
command to get information about the supported commands:
bash
planqk help
You may also get information about a specific command:
bash
planqk help <command>
# or
planqk <command> --help
Authentication
Please copy your personal access token to your clipboard.
Login to your account using your access token:
bash
planqk login -t <your access token>
Usage
sh-session
$ npm install -g @planqk/planqk-cli
$ planqk COMMAND
running command...
$ planqk (--version)
@planqk/planqk-cli/2.24.1 darwin-arm64 node-v22.11.0
$ planqk --help [COMMAND]
USAGE
$ planqk COMMAND
...
Commands
planqk autocomplete [SHELL]
planqk compress
planqk get-context
planqk help [COMMAND]
planqk init
planqk list-contexts
planqk login
planqk logout
planqk openapi
planqk run [SERVICEID]
planqk serve
planqk services
planqk set-context [CONTEXTID]
planqk up
planqk version
planqk autocomplete [SHELL]
Display autocomplete installation instructions.
USAGE
$ planqk autocomplete [SHELL] [-r]
ARGUMENTS
SHELL (zsh|bash|powershell) Shell type
FLAGS
-r, --refresh-cache Refresh cache (ignores displaying instructions)
DESCRIPTION
Display autocomplete installation instructions.
EXAMPLES
$ planqk autocomplete
$ planqk autocomplete bash
$ planqk autocomplete zsh
$ planqk autocomplete powershell
$ planqk autocomplete --refresh-cache
See code: @oclif/plugin-autocomplete
planqk compress
Compresses the current project and creates a ZIP file. Use the '.planqkignore' file to exclude files and directories from the ZIP file.
USAGE
$ planqk compress
DESCRIPTION
Compresses the current project and creates a ZIP file. Use the '.planqkignore' file to exclude files and directories
from the ZIP file.
EXAMPLES
$ planqk compress
See code: src/commands/compress/index.ts
planqk get-context
Get the current context, i.e., the personal or organization account you are currently working with.
USAGE
$ planqk get-context
DESCRIPTION
Get the current context, i.e., the personal or organization account you are currently working with.
EXAMPLES
$ planqk get-context
See code: src/commands/get-context/index.ts
planqk help [COMMAND]
Display help for planqk.
USAGE
$ planqk help [COMMAND...] [-n]
ARGUMENTS
COMMAND... Command to show help for.
FLAGS
-n, --nested-commands Include all nested commands in the output.
DESCRIPTION
Display help for planqk.
See code: @oclif/plugin-help
planqk init
Bootstrap project to create a PLANQK Service.
USAGE
$ planqk init [--name <value>] [--non-interactive]
FLAGS
--name=<value> The name of the service
--non-interactive Run it in non-interactive mode
DESCRIPTION
Bootstrap project to create a PLANQK Service.
EXAMPLES
$ planqk init
See code: src/commands/init/index.ts
planqk list-contexts
Retrieves the available contexts, i.e., the personal or organizational accounts available to you to work with.
USAGE
$ planqk list-contexts
DESCRIPTION
Retrieves the available contexts, i.e., the personal or organizational accounts available to you to work with.
EXAMPLES
$ planqk list-contexts
See code: src/commands/list-contexts/index.ts
planqk login
Login with your PLANQK credentials
USAGE
$ planqk login [-t <value>]
FLAGS
-t, --token=<value> Your personal access token
DESCRIPTION
Login with your PLANQK credentials
EXAMPLES
$ planqk login -t <personal access token>
See code: src/commands/login/index.ts
planqk logout
Logout from PLANQK
USAGE
$ planqk logout
DESCRIPTION
Logout from PLANQK
EXAMPLES
$ planqk logout
See code: src/commands/logout/index.ts
planqk openapi
Generates the OpenAPI description for your project based on the parameter and return types of your run() method. You can use this command to verify how the API of your project would look like when deployed on PLANQK. The output of this command will be used when creating or updating your service.
USAGE
$ planqk openapi [-f] [--file <value>] [--format <value>]
FLAGS
-f, --force Overwrite the output file if it already exists
--file=<value> The file to write the OpenAPI description to
--format=<value> The format to generate the OpenAPI description [possible values: yaml]
DESCRIPTION
Generates the OpenAPI description for your project based on the parameter and return types of your run() method. You
can use this command to verify how the API of your project would look like when deployed on PLANQK. The output of this
command will be used when creating or updating your service.
EXAMPLES
$ planqk openapi
$ planqk openapi --file=./openapi.yaml --format=yaml --force
See code: src/commands/openapi/index.ts
planqk run [SERVICEID]
Creates a job execution of a PLANQK Service
USAGE
$ planqk run [SERVICEID] [-d <value>] [--data-file <value>] [--detached] [-p <value>] [--params-file
<value>]
FLAGS
-d, --data=<value> Input data as JSON string.
-p, --params=<value> Parameters as JSON string.
--data-file=<value> Relative path to file containing input data.
--detached Executes the job in detached mode, i.e., without waiting for it to finish.
--params-file=<value> Relative path to file containing params.
DESCRIPTION
Creates a job execution of a PLANQK Service
EXAMPLES
$ planqk run
$ planqk run --detached
$ planqk run -d '{"values": [10,12]}' -p '{"round_up": true}'
$ planqk run --data-file=./input/data.json --params-file=./input/params.json
See code: src/commands/run/index.ts
planqk serve
Runs your project in a containerized environment and expose it through a local web server, similarly to how PLANQK would run your code. The local web server exposes the same HTTP endpoints to start a service execution, to check the status of running executions, to cancel executions, and to retrieve execution results.
USAGE
$ planqk serve [-p <value>] [--log_level <value>]
FLAGS
-p, --port=<value> The port on which the local web server accepts requests
--log_level=<value> [default: INFO] The log level for the service, possible values: DEBUG, INFO, WARNING, ERROR,
CRITICAL
DESCRIPTION
Runs your project in a containerized environment and expose it through a local web server, similarly to how PLANQK
would run your code. The local web server exposes the same HTTP endpoints to start a service execution, to check the
status of running executions, to cancel executions, and to retrieve execution results.
EXAMPLES
$ planqk serve
$ planqk serve -p <port> --log_level <log_level>
See code: src/commands/serve/index.ts
planqk services
List all services of the current context.
USAGE
$ planqk services
DESCRIPTION
List all services of the current context.
EXAMPLES
$ planqk services
See code: src/commands/services/index.ts
planqk set-context [CONTEXTID]
Set the current context, i.e., the personal or organization account you are currently working with.
USAGE
$ planqk set-context [CONTEXTID]
DESCRIPTION
Set the current context, i.e., the personal or organization account you are currently working with.
EXAMPLES
$ planqk set-context
$ planqk set-context <context-id>
See code: src/commands/set-context/index.ts
planqk up
Creates or updates a PLANQK service
USAGE
$ planqk up [--silent]
FLAGS
--silent Suppresses all outputs, helpful when executed in a CI/CD pipeline.
DESCRIPTION
Creates or updates a PLANQK service
EXAMPLES
$ planqk up
See code: src/commands/up/index.ts
planqk version
USAGE
$ planqk version [--json] [--verbose]
FLAGS
--verbose Show additional information about the CLI.
GLOBAL FLAGS
--json Format output as json.
FLAG DESCRIPTIONS
--verbose Show additional information about the CLI.
Additionally shows the architecture, node version, operating system, and versions of plugins that the CLI is using.
See code: @oclif/plugin-version