The Spawn CLI is a powerful command-line tool designed to simplify the management and development of Spawn projects and infrastructure. This guide provides an overview of the available commands, their subcommands, and usage examples.
new: Create new Spawn projects targeting a specific programming language.
apply: Deploy actor resources to a Kubernetes cluster.
config: Configure Spawn applications, such as ActorSystem and ActorHost CRDs.
dev: Manage local development workflows.
install: Install orchestrators or runtimes, such as Kubernetes.
playground: Set up and run a complete Spawn tutorial.
Each command comes with its own set of options and subcommands, which are detailed below.
new CommandCreates a new Spawn project tailored for a specific target language.
spawn new <subcommand> [OPTIONS] <name>
dart: Generate a Spawn Dart project.new dart:--help: Print this help.-s, --actor-system: Defines the name of the ActorSystem. (Default: “spawn-system”)-d, --app-description: Defines the application description. (Default: “Spawn App.”)-t, --app-image-tag: Defines the OCI Container image tag. (Default:
“ttl.sh/spawn-dart-example:1h”)-n, --app-namespace: Defines the Kubernetes namespace to install app. (Default: “default”)-v, --sdk-version: Spawn SDK version.-S, --statestore-type: Spawn statestore provider. (Allowed Values: “native”, “mariadb”, “postgres”,)-U, --statestore-user: Spawn statestore username. (Default: “admin”)-P, --statestore-pwd: Spawn statestore password. (Default: “admin”)-K, --statestore-key: Spawn statestore key. (Default: “myfake-key”)spawn new dart --actor-system=spawn-system myapp
elixir: Generate a Spawn Elixir project.new elixir:--help: Print this help.-s, --actor-system: Defines the name of the ActorSystem. (Default: “spawn-system”)-d, --app-description: Defines the application description. (Default: “Spawn App.”)-t, --app-image-tag: Defines the OCI Container image tag. (Default:
“ttl.sh/spawn-elixir-example:1h”)-n, --app-namespace: Defines the Kubernetes namespace to install app. (Default: “default”)-e, --elixir-version: Defines the Elixir version.-v, --sdk-version: Spawn SDK version.-S, --statestore-type: Spawn statestore provider. (Allowed Values: “native”, “mariadb”, “postgres”,)-U, --statestore-user: Spawn statestore username. (Default: “admin”)-P, --statestore-pwd: Spawn statestore password. (Default: “admin”)-K, --statestore-key: Spawn statestore key. (Default: “myfake-key”)spawn new elixir --actor-system=spawn-system --statestore-type=postgres myapp
go: Generate a Spawn Dart project.new go:--help: Print this help.-s, --actor-system: Defines the name of the ActorSystem. (Default: “spawn-system”)-s, --actor-system: Defines the name of the ActorSystem. (Default: “spawn-system”)-d, --app-description: Defines the application description. (Default: “Spawn App.”)-t, --app-image-tag: Defines the OCI Container image tag. (Default:
“ttl.sh/spawn-go-example:1h”)-n, --app-namespace: Defines the Kubernetes namespace to install app. (Default: “default”)-v, --sdk-version: Spawn SDK version.-S, --statestore-type: Spawn statestore provider. (Allowed Values: “native”, “mariadb”, “postgres”,)-U, --statestore-user: Spawn statestore username. (Default: “admin”)-P, --statestore-pwd: Spawn statestore password. (Default: “admin”)-K, --statestore-key: Spawn statestore key. (Default: “myfake-key”)spawn new go --actor-system=spawn-system myapp
java: Generate a Spawn Java project.new java:--help: Print this help.-s, --actor-system: Defines the name of the ActorSystem. (Default: “spawn-system”)-d, --app-description: Defines the application description. (Default: “Spawn App.”)-t, --app-image-tag: Defines the OCI Container image tag. (Default:
“ttl.sh/spawn-java-example:1h”)-n, --app-namespace: Defines the Kubernetes namespace to install app. (Default: “default”)-v, --sdk-version: Spawn SDK version.-S, --statestore-type: Spawn statestore provider. (Allowed Values: “native”, “mariadb”, “postgres”,)-U, --statestore-user: Spawn statestore username. (Default: “admin”)-P, --statestore-pwd: Spawn statestore password. (Default: “admin”)-K, --statestore-key: Spawn statestore key. (Default: “myfake-key”)-g, --group-id: Java project groupId. (Default: “io.eigr.spawn.java”)-a, --artifact-id: Java project artifactId. (Default: “demo”)-V, --version: Java project version. (Default: “1.0.1”)spawn new java --actor-system=spawn-system myapp
node: Generate a Spawn NodeJS project.new node:--help: Print this help.-s, --actor-system: Defines the name of the ActorSystem. (Default: “spawn-system”)-d, --app-description: Defines the application description. (Default: “Spawn App.”)-t, --app-image-tag: Defines the OCI Container image tag. (Default:
“ttl.sh/spawn-node-example:1h”)-n, --app-namespace: Defines the Kubernetes namespace to install app. (Default: “default”)-v, --sdk-version: Spawn SDK version.-S, --statestore-type: Spawn statestore provider. (Allowed Values: “native”, “mariadb”, “postgres”,)-U, --statestore-user: Spawn statestore username. (Default: “admin”)-P, --statestore-pwd: Spawn statestore password. (Default: “admin”)-K, --statestore-key: Spawn statestore key. (Default: “myfake-key”)spawn new node --actor-system=spawn-system myapp
python: Generate a Spawn Python project.new python:--help: Print this help.-s, --actor-system: Defines the name of the ActorSystem. (Default: “spawn-system”)-d, --app-description: Defines the application description. (Default: “Spawn App.”)-t, --app-image-tag: Defines the OCI Container image tag. (Default:
“ttl.sh/spawn-python-example:1h”)-n, --app-namespace: Defines the Kubernetes namespace to install app. (Default: “default”)-v, --sdk-version: Spawn SDK version.-S, --statestore-type: Spawn statestore provider. (Allowed Values: “native”, “mariadb”, “postgres”,)-U, --statestore-user: Spawn statestore username. (Default: “admin”)-P, --statestore-pwd: Spawn statestore password. (Default: “admin”)-K, --statestore-key: Spawn statestore key. (Default: “myfake-key”)spawn new python --actor-system=spawn-system myapp
rust: Generate a Spawn Rust project.new rust:--help: Print this help.-s, --actor-system: Defines the name of the ActorSystem. (Default: “spawn-system”)-d, --app-description: Defines the application description. (Default: “Spawn App.”)-t, --app-image-tag: Defines the OCI Container image tag. (Default:
“ttl.sh/spawn-rust-example:1h”)-n, --app-namespace: Defines the Kubernetes namespace to install app. (Default: “default”)-v, --sdk-version: Spawn SDK version.-S, --statestore-type: Spawn statestore provider. (Allowed Values: “native”, “mariadb”, “postgres”,)-U, --statestore-user: Spawn statestore username. (Default: “admin”)-P, --statestore-pwd: Spawn statestore password. (Default: “admin”)-K, --statestore-key: Spawn statestore key. (Default: “myfake-key”)spawn new rust --actor-system=spawn-system myapp
apply CommandApplies Spawn actor resources to a Kubernetes cluster.
spawn apply [OPTIONS]
-c, --context -f, --file -n, --namespace -d, --dry-run: Preview the resources to be applied without making changes.-k, --kubeconfig: Load a Kubernetes kube config file. (Default: “~/.kube/config”)spawn apply --file=myapp-actor-host.yaml
config CommandConfigures Spawn applications, including ActorSystem and ActorHost CRDs.
TODO
dev CommandManages local development workflows.
spawn dev <subcommand> [options]
run: Run Spawn proxy in dev mode.dev run:--help: Print this help.-s, --actor-system: “Defines the name of the ActorSystem.-p, --protos: Path where your protobuf files reside.-W, --proto-changes-watcher: Watches changes in protobuf files and reload proxy.-A, --proxy-bind-address: Defines the proxy host address.-P, --proxy-bind-port: Defines the proxy host port.-G, --proxy-bind-grpc-port: Defines the proxy gRPC host port.-I, --proxy-image: Defines the proxy image.-H, --actor-host-port: Defines the ActorHost (your program) port.-S, --database-self-provisioning: Auto provisioning a local Database.-h, --database-host: Defines the Database hostname.-D, --database-port: Defines the Database port number.-T, --database-type: Defines the Database provider.O, --database-pool: Defines the Database pool size.-K, --statestore-key: Defines the Statestore Key.-L, --log-level: Defines the Logger level.”-N, --nats-image: Nats test image--nats-http-port: Nats http port”--nats-port: Nats port-n, --name: Defines the name of the Proxy instance.spawn dev run --actor-system "custom-system" \
--protos="./protos" \
--proxy-bind-address="192.168.1.1" \
--proxy-bind-port=8080 \
--proxy-image="custom/proxy:latest" \
--actor-host-port=9090 \
--database-self-provisioning=false \
--database-host="localhost" \
--database-port 5432 \
--database-type="postgres" \
--database-pool=50 \
--statestore-key="custom-key" \
--log-level="debug" \
--nats-image="nats" \
--nats-http-port=8222 \
--nats-port=4222 \
--name="custom-proxy"
install CommandInstalls orchestrators or runtimes, such as Kubernetes.
spawn install <runtime> [options]
kubernetes: Install k8s Operator Runtime.install kubernetes:--help: Print this help.-c, --context: Apply manifest on specified Kubernetes Context.-e, --env-config: Load a Kubernetes kube config from environment variable.-k, --kubeconfig: Load a Kubernetes kube config file. (Default: “~/.kube/config”)-V, --version: Install Operator with a specific version.spawn install --version=1.4.2
playground CommandSets up and runs a complete Spawn tutorial, providing a self-contained learning environment.
spawn playground <subcommand> [options]
new: Create and run a new Spawn playground.playground new:--help: Print this help.-n, --name: Defines the name of the Playground.-N, --namespace: Apply manifests on specified Kubernetes namespace.-r, --recipe: Playground recipe to install. See spawnctl playground list command.-t, --timeout: Defines the timeout for execution of command.-k, --k8s-flavour: Defines the kubernetes provider. (Allowed values: [“k3d”, “kind”, “minikube”])spawn playground new --name=test
list: List available recipes for playground.playground list:TODO
spawn playground list