Space Operator CLI

Crates.io AGPLv3 licensed

CLI for Space Operator.

Install

Install using cargo install:

cargo install space-operator-cli --force

Binary name: spo

$ spo --help
Usage: spo [OPTIONS] [COMMAND]

Commands:
  login     Login to Space Operator using API key
  start     Start flow-server [aliases: s]
  node      Manage your nodes [aliases: n]
  generate  Generate various things [aliases: g]
  run       Run various binaries
  help      Print this message or the help of the given subcommand(s)

Options:
      --url <URL>  URL of flow-server to use (default: https://dev-api.spaceoperator.com)
  -h, --help       Print help

Login

Run spo login:

Enter your API key to login.

Run flow-server

Clone flow-backend repository:

cd into flow-backend and run spo start:

This will create a configuration file for flow-server then compile and run it (first compilation will take several minutes).

Example output:

Generate a new native node

Make sure you are inside flow-backend repository.

Generate with spo node new:

Because our workspace have several packages, you must specify one of them to use (our CLI can automatically choose one if you are inside one of them).

Fill the prompts for node definition, for example:

Generated Rust code:

Then, you can use spo start to run a local flow-server and test your node in flow editor.

Generate input and output struct

If you updated the node definition manually, you can use spo generate input and spo generate output to generate new type definitions.

For example

Upload node

Use spo node upload to upload new node definition or update existing one. We only support native node at the moment.

Command-Line Help for spo

This document contains the help content for the spo command-line program.

Command Overview:

  • spo

  • spo login

  • spo start

  • spo node

  • spo node new

  • spo node upload

  • spo generate

  • spo generate input

  • spo generate output

  • spo generate config

  • spo run

spo

Usage: spo [OPTIONS] [COMMAND]

Subcommands:

  • login — Login to Space Operator using API key

  • start — Start flow-server

  • node — Manage your nodes

  • generate — Generate various things

  • run — Run various binaries

Options:

  • --url <URL> — URL of flow-server to use (default: https://dev-api.spaceoperator.com)

spo login

Login to Space Operator using API key

Usage: spo login

spo start

Start flow-server

Usage: spo start [OPTIONS] [CONFIG]

Command Alias: s

Arguments:

  • <CONFIG> — Path to configuration file

Options:

  • --docker — Connect to local Docker instance

  • --release — Use --release build

spo node

Manage your nodes

Usage: spo node <COMMAND>

Command Alias: n

Subcommands:

  • new — Generate a new node

  • upload — Upload nodes

spo node new

Generate a new node

Usage: spo node new [OPTIONS]

Command Alias: n

Options:

  • --allow-dirty — Allow dirty git repository

  • -p, --package <PACKAGE> — Specify which Rust package to add the new node to

spo node upload

Upload nodes

Usage: spo node upload [OPTIONS] <PATH>

Command Alias: u

Arguments:

  • <PATH> — Path to JSON node definition file

Options:

  • --dry-run — Only print diff, don't do anything

  • --no-confirm — Don't ask for confirmation

spo generate

Generate various things

Usage: spo generate <COMMAND>

Command Alias: g

Subcommands:

  • input — Generate input struct

  • output — Generate output struct

  • config — Generate configuration file for flow-server

spo generate input

Generate input struct

Usage: spo generate input <PATH>

Command Alias: i

Arguments:

  • <PATH> — Path to node definition file

spo generate output

Generate output struct

Usage: spo generate output <PATH>

Command Alias: o

Arguments:

  • <PATH> — Path to node definition file

spo generate config

Generate configuration file for flow-server

Usage: spo generate config [PATH]

Command Alias: c

Arguments:

  • <PATH> — Path to save configuration file (default: config.toml)

spo run

Run various binaries

Usage: spo run [OPTIONS] <BIN>

Arguments:

  • <BIN> — Specify binary to run

    Possible values: all-cmds-server

Options:

  • --release — Run in release mode


This document was generated automatically by clap-markdown.

Last updated

Was this helpful?