# 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 and the npm command line interface using either a Node version manager (opens new window) or a Node installer (opens new window).
Then install the PlanQK CLI globally using npm:
npm install -g @anaqor/planqk
You can use the --help
flag to get information about the supported commands:
planqk --help
You may also get information about a specific command:
planqk <command> --help
# Authentication
Create a Personal Access Token (opens new window) with api
and quantum_tokens
scopes.
Please copy the access token to your clipboard, since you will need it in the next steps.
Login to your account using your access token:
planqk login -t <your access token>
# Usage
$ npm install -g @anaqor/planqk
$ planqk COMMAND
running command...
$ planqk (--version)
@anaqor/planqk/2.9.7 darwin-arm64 node-v18.19.1
$ planqk --help [COMMAND]
USAGE
$ planqk COMMAND
...
2
3
4
5
6
7
8
9
# Commands
planqk autocomplete [SHELL]
planqk create-openapi
planqk get-context
planqk init
planqk list-contexts
planqk login
planqk logout
planqk run [SERVICEID]
planqk serve
planqk services
planqk set-context [CONTEXTID]
planqk up
# planqk autocomplete [SHELL]
display autocomplete installation instructions
USAGE
$ planqk autocomplete [SHELL] [-r]
ARGUMENTS
SHELL 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 --refresh-cache
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
See code: @oclif/plugin-autocomplete (opens new window)
# planqk create-openapi
Creates the OpenAPI definition based on the sample data in the "input" directory. The generated OpenAPI definition is saved in the file "openapi-spec.yml". An existing "openapi-spec.yml" file is saved as "openapi-spec-saved.yml" before it is overwritten.After the generation you may check the generated OpenAPI definition and correct it manually if necessary.
USAGE
$ planqk create-openapi [--wd <value>]
FLAGS
--wd=<value> Working dir (e.g., for tests)
DESCRIPTION
Creates the OpenAPI definition based on the sample data in the "input" directory. The generated OpenAPI definition is
saved in the file "openapi-spec.yml". An existing "openapi-spec.yml" file is saved as "openapi-spec-saved.yml" before
it is overwritten.After the generation you may check the generated OpenAPI definition and correct it manually if
necessary.
EXAMPLES
$ planqk create-openapi
2
3
4
5
6
7
8
9
10
11
12
13
14
See code: dist/commands/create-openapi/index.ts (opens new window)
# 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
2
3
4
5
6
7
8
See code: dist/commands/get-context/index.ts (opens new window)
# planqk init
Initialize a PlanQK project to create a service.
USAGE
$ planqk init [--non-interactive] [--name <value>]
FLAGS
--name=<value> The name of the service
--non-interactive Run it in non-interactive mode
DESCRIPTION
Initialize a PlanQK project to create a service.
EXAMPLES
$ planqk init
2
3
4
5
6
7
8
9
10
11
12
See code: dist/commands/init/index.ts (opens new window)
# 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
2
3
4
5
6
7
8
See code: dist/commands/list-contexts/index.ts (opens new window)
# planqk login
Login with your PlanQK Platform credentials
USAGE
$ planqk login [-t <value>]
FLAGS
-t, --token=<value> Your personal access token
DESCRIPTION
Login with your PlanQK Platform credentials
EXAMPLES
$ planqk login -t <personal access token>
2
3
4
5
6
7
8
9
10
11
See code: dist/commands/login/index.ts (opens new window)
# planqk logout
Logout of the PlanQK Platform
USAGE
$ planqk logout
DESCRIPTION
Logout of the PlanQK Platform
EXAMPLES
$ planqk logout
2
3
4
5
6
7
8
See code: dist/commands/logout/index.ts (opens new window)
# planqk run [SERVICEID]
Creates a job execution of a PlanQK Service
USAGE
$ planqk run [SERVICEID] [-d <value>] [-p <value>] [--data-file <value>] [--params-file <value>]
[--detached]
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
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
See code: dist/commands/run/index.ts (opens new window)
# planqk serve
Runs your current service code within a containerized environment, accessible through a local web server, mirroring the functionality of the PlanQK Platform. The local web server exposes the RESTful HTTP endpoints to start a service execution, to check the status of running executions, to cancel executions, and to retrieve execution results. If the port flag is not specified, then 8081 will be used as the default port.
USAGE
$ planqk serve [-p <value>]
FLAGS
-p, --port=<value> The port on which the local web server accepts requests
DESCRIPTION
Runs your current service code within a containerized environment, accessible through a local web server, mirroring the functionality of the PlanQK Platform. The local web server exposes the RESTful HTTP endpoints to start a service execution, to check the status of running executions, to cancel executions, and to retrieve execution results. If the port flag is not specified, then 8081 will be used as the default port.
EXAMPLES
$ planqk serve -p <port>
2
3
4
5
6
7
8
9
10
11
See code: dist/commands/serve/index.ts (opens new window)
# planqk services
List all available services of the current selected context.
USAGE
$ planqk services
DESCRIPTION
List all available services of the current selected context.
EXAMPLES
$ planqk services
2
3
4
5
6
7
8
See code: dist/commands/services/index.ts (opens new window)
# 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>
2
3
4
5
6
7
8
9
10
See code: dist/commands/set-context/index.ts (opens new window)
# 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
2
3
4
5
6
7
8
9
10
11