Space Operator CLI
CLI for Space Operator.
Install
Install using cargo install:
cargo install space-operator-cli --forceBinary 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 helpLogin
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
spoThis 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
spoUsage: spo [OPTIONS] [COMMAND]
Subcommands:
login— Login to Space Operator using API keystart— Start flow-servernode— Manage your nodesgenerate— Generate various thingsrun— Run various binaries
Options:
--url <URL>— URL of flow-server to use (default: https://dev-api.spaceoperator.com)
spo login
spo loginLogin to Space Operator using API key
Usage: spo login
spo start
spo startStart 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--releasebuild
spo node
spo nodeManage your nodes
Usage: spo node <COMMAND>
Command Alias: n
Subcommands:
new— Generate a new nodeupload— Upload nodes
spo node new
spo node newGenerate 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
spo node uploadUpload 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
spo generateGenerate various things
Usage: spo generate <COMMAND>
Command Alias: g
Subcommands:
input— Generate input structoutput— Generate output structconfig— Generate configuration file for flow-server
spo generate input
spo generate inputGenerate input struct
Usage: spo generate input <PATH>
Command Alias: i
Arguments:
<PATH>— Path to node definition file
spo generate output
spo generate outputGenerate output struct
Usage: spo generate output <PATH>
Command Alias: o
Arguments:
<PATH>— Path to node definition file
spo generate config
spo generate configGenerate 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
spo runRun various binaries
Usage: spo run [OPTIONS] <BIN>
Arguments:
<BIN>— Specify binary to runPossible values:
all-cmds-server
Options:
--release— Run in release mode
This document was generated automatically by clap-markdown.
Last updated
Was this helpful?