Appearance
CLI Reference
The Command Line Interface (CLI) lets you interact with the Kipu Quantum Hub directly from your terminal. We have installation instructions to guide you through the initial setup in our quickstart guide.
Installation
To install the 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 CLI globally using npm:
bash
npm install -g @planqk/planqk-cliYou can use the help command to get information about the supported commands:
bash
planqk helpYou may also get information about a specific command:
bash
planqk help <command>
# or
planqk <command> --helpAuthentication
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.41.0 darwin-arm64 node-v22.17.1
$ planqk --help [COMMAND]
USAGE
$ planqk COMMAND
...Commands
planqk autocomplete [SHELL]planqk compressplanqk datapool uploadplanqk get-contextplanqk help [COMMAND]planqk initplanqk list-contextsplanqk loginplanqk logoutplanqk openapiplanqk run [SERVICEID]planqk serveplanqk servicesplanqk set-context [CONTEXTID]planqk upplanqk 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-cacheSee 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 compressSee code: src/commands/compress/index.ts
planqk datapool upload
Upload files to a data pool
USAGE
$ planqk datapool upload -f <value>... [-d <value>]
FLAGS
-d, --datapool-id=<value> ID of the data pool to upload the files to (optional - will prompt to create a new one if
not provided)
-f, --file=<value>... (required) Path to a file to upload (can be specified multiple times)
DESCRIPTION
Upload files to a data pool
EXAMPLES
$ planqk datapool upload --file ./data/dataset.csv
$ planqk datapool upload --file ./data/dataset.csv --file ./data/metadata.json
$ planqk datapool upload -f ./data/dataset.csv -f ./data/metadata.json --datapool-id 550e8400-e29b-41d4-a716-446655440000See code: src/commands/datapool/upload.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-contextSee 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 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 service.
EXAMPLES
$ planqk initSee 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-contextsSee code: src/commands/list-contexts/index.ts
planqk login
Login with your credentials
USAGE
$ planqk login [-t <value>] [--base-path <value>]
FLAGS
-t, --token=<value> Your personal access token
--base-path=<value> Custom base path for authentication (development)
DESCRIPTION
Login with your credentials
EXAMPLES
$ planqk login -t <personal access token>
$ planqk login -t <personal access token> --base-path https://api.hub.kipu-quantum.comSee code: src/commands/login/index.ts
planqk logout
Logout
USAGE
$ planqk logout
DESCRIPTION
Logout
EXAMPLES
$ planqk logoutSee 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. The output of this command will be used when creating or updating your service. Supports PYTHON_TEMPLATE (with src/program.py), PYTHON and DOCKER runtimes (with explicit entrypoint). The Python dependency "planqk-commons" must be installed in your activated Python environment to use this command.
USAGE
$ planqk openapi [-f] [--file <value>] [--format yaml] [--entrypoint <value>] [--package <value>] [--method
<value>]
FLAGS
-f, --force Overwrite the output file if it already exists
--entrypoint=<value> The entrypoint to your program in the format "package.module:function" (default:
"src.program:run"). Overrides package and method flags.
--file=<value> The file to write the OpenAPI description to
--format=<option> The format to generate the OpenAPI description [possible values: yaml]
<options: yaml>
--method=<value> The method/function name in your program (default: "run"). Only used if entrypoint is not
provided.
--package=<value> The package/module path to your program (e.g., "src.program" or "my_package.main"). Only
used if entrypoint is not provided.
DESCRIPTION
Generates the OpenAPI description for your project based on the parameter and return types of your run() method. The
output of this command will be used when creating or updating your service. Supports PYTHON_TEMPLATE (with
src/program.py), PYTHON and DOCKER runtimes (with explicit entrypoint). The Python dependency "planqk-commons" must be
installed in your activated Python environment to use this command.
EXAMPLES
$ planqk openapi
$ planqk openapi --file=./openapi.yaml --format=yaml --force
$ planqk openapi --entrypoint=src.program:run
$ planqk openapi --package=src.program --method=run
$ planqk openapi --package=src.programSee code: src/commands/openapi/index.ts
planqk run [SERVICEID]
Creates a job execution
USAGE
$ planqk run [SERVICEID] [-i <value>] [--input-files <value>] [--detached]
FLAGS
-i, --input=<value> Input as JSON string.
--detached Executes the job in detached mode, i.e., without waiting for it to finish.
--input-files=<value> Comma-separated paths to files containing input to be merged (default:
./input/data.json,./input/params.json).
DESCRIPTION
Creates a job execution
EXAMPLES
$ planqk run
$ planqk run --detached
$ planqk run -i '{"values": [10,12], "round_up": true}'
$ planqk run --input-files=./input/data.json,./input/params.json
$ planqk run --input-files=./config.json,./overrides.jsonSee 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 Kipu Quantum Hub 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 Kipu
Quantum Hub 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 [--json] [--name <value>] [--all]
FLAGS
--all display all service properties (only available with --json)
--json output in JSON format
--name=<value> filter services by name (case-insensitive full match)
DESCRIPTION
List all services of the current context.
EXAMPLES
$ planqk services
$ planqk services --json
$ planqk services --name "my-service"
$ planqk services --name "my-service" --json
$ planqk services --json --allSee 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 service
USAGE
$ planqk up [--silent] [--no-save-id] [--name <value>]
FLAGS
--name=<value> Override the service name from planqk.json with a custom name.
--no-save-id Prevents storing the created service ID in planqk.json file.
--silent Suppresses all outputs, helpful when executed in a CI/CD pipeline.
DESCRIPTION
Creates or updates a service
EXAMPLES
$ planqk up
$ planqk up --no-save-id
$ planqk up --name "my-custom-service-name"
$ planqk up --name "test-service" --no-save-idSee 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

