Skip to main content

Command line utility for K as a Service

Project description

KaaS CLI

Simple Installation

Our deployments can be found on Pypi.

Installation

pip install --user kaas-cli or sudo pip install kaas-cli

For Developers

Prerequisites: python >= 3.11, pip >= 20.0.2, poetry >= 1.3.2.

Installation

To install the package using pip, start by building from Source

make build
pip install dist/*.whl

Installation with uv

uv is a fast Python package manager that can be used as an alternative to pip and poetry.

uv sync

This will create a virtual environment and install all dependencies.

Environment Variables

Configure the CLI by copying the example environment file and setting up the necessary environment variables:

cp .flaskenv.example .flaskenv

Then, edit the .flaskenv file to match your settings.

Usage

After installing the dependencies with poetry install, you can spawn a shell using poetry shell, or alternatively, use make:

make shell
kaas-cli hello
kaas-cli --version

Usage with uv

After installing the dependencies with uv sync, you can run CLI commands directly:

uv run kaas-cli hello
uv run kaas-cli --version

Or activate the virtual environment and use the CLI as usual:

source .venv/bin/activate
kaas-cli hello
kaas-cli --version

To verify the installation, run kaas-cli hello. If you see the message Hello World!, the CLI is set up correctly.

Static Analysis

kaas-cli uses Pyright for static type checking.

make check-pyright
make check

Run Command by Mode

kaas-cli run supports multiple test modes. Flags are mode-specific:

  • kontrol: --build-only, --prove-only-profile, --kontrol-version, --kontrol-docker-image, --extra-build-args, --extra-prove-args
  • forge: --foundry-version, --foundry-docker-image, --extra-build-args, --extra-test-args
  • go (remote only): --fuzz-targets, --go-version, --go-build-directory, --execution-timeout
  • rust (remote only): --fuzz-targets, --rust-version, --rust-build-directory, --rust-fuzz-engine, --rust-fuzz-args, --execution-timeout

Remote Fuzzing Jobs

kaas-cli run supports remote fuzzing with --test-mode go and --test-mode rust.

Use --fuzz-targets with a comma-separated list (up to 5 targets). Each target starts a separate remote job.

The CLI checks available fuzzing capacity before submitting jobs. If the vault's concurrent job limit is reached, you'll see a message indicating how many slots are available.

Go fuzzing

kaas-cli run \
  --mode remote \
  --test-mode go \
  --vault-spec org/vault \
  --token "$KAAS_TOKEN" \
  --branch main \
  --fuzz-targets "^FuzzTransfer$,^FuzzMint$" \
  --go-version 1.23.8 \
  --go-build-directory "./..."

kaas go test shorthand

The kaas go test command mirrors go test -fuzz syntax for a more familiar interface. It supports persistent configuration via .kaas-cli.toml (see below).

kaas go test -fuzz='^FuzzVerifyInteropMessagesValid$' ./op-supernode/supernode/activity/interop/

Multiple fuzz targets can be specified as a comma-separated list:

kaas go test -fuzz='^FuzzTransfer$,^FuzzMint$' ./path/to/pkg/

Each target starts a separate remote job (up to 5 targets).

Additional flags for kaas go test:

  • --commit: Pin a specific git commit hash (defaults to HEAD)
  • --fuzztime: Go-style duration of at least 1m (e.g. '1m', '5m', '1h'), converted to execution timeout
  • --execution-timeout: Execution timeout in minutes (mutually exclusive with --fuzztime)

Rust fuzzing

kaas-cli run \
  --mode remote \
  --test-mode rust \
  --vault-spec org/vault \
  --token "$KAAS_TOKEN" \
  --branch main \
  --fuzz-targets "fuzz_transfer,fuzz_mint" \
  --rust-version stable \
  --rust-build-directory "." \
  --rust-fuzz-engine libfuzzer

Configuration File (.kaas-cli.toml)

The kaas go test command supports persistent configuration via a .kaas-cli.toml file. If no config file is found, the CLI will interactively prompt you to create one.

CLI flags always take priority over config values. The config file is automatically added to .gitignore.

[default]
vault_spec = "org/vault"
token = "your-token"
branch = "main"
url = "https://kaas.runtimeverification.com/"

[go]
go_version = "latest"
go_build_directory = "./..."
execution_timeout = 480

Documentation

For detailed usage instructions of the kaas-cli tool, please refer to the official documentation.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kaas_cli-0.1.301.tar.gz (36.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kaas_cli-0.1.301-py3-none-any.whl (40.4 kB view details)

Uploaded Python 3

File details

Details for the file kaas_cli-0.1.301.tar.gz.

File metadata

  • Download URL: kaas_cli-0.1.301.tar.gz
  • Upload date:
  • Size: 36.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for kaas_cli-0.1.301.tar.gz
Algorithm Hash digest
SHA256 e624b523c58ca4e57fd5bfed9188efe30dd0b85d8a7cd36043192b35383ec836
MD5 0c785e6392b75ac1c52dc7d7de00f4dd
BLAKE2b-256 bb43c768fdebffad4ea0d74d579fd1e1398a1c9380d7ef5726b736d825e82de8

See more details on using hashes here.

File details

Details for the file kaas_cli-0.1.301-py3-none-any.whl.

File metadata

  • Download URL: kaas_cli-0.1.301-py3-none-any.whl
  • Upload date:
  • Size: 40.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for kaas_cli-0.1.301-py3-none-any.whl
Algorithm Hash digest
SHA256 7f29529788424a05350e14f78e8be2d9a03f56ba4438b778bbb8084a8d341a3c
MD5 74f0fa7a14f14662c5bf7ef372a9a1b7
BLAKE2b-256 cd2b1cb5498218ac4f706f5279c050c43c14e96298e2292148bf7cc24637debc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page