cosmo CLI is your one-stop-shop for all things Cosmonic. It puts at your fingertips the ability to interact with and manage your account, preferences, your constellations, and more. As we progress through the developer preview phase, more and more functionality will be added to
Installing the CLI
Installing the CLI is simple and requires just one command. Pick the appropriate OS below and run the indicated command.
bash -c "$(curl -fsSL https://cosmonic.sh/install.sh)"
powershell -Command "iwr -useb https://cosmonic.sh/install.ps1 | iex"
cosmo comes with a built-in tutorial that is triggered the first time you run
cosmo. This flow will walk you through authenticating, starting a host, and launching a tutorial actor to your super constellation. You can also repeat this tutorial in the future by running
Logging in requires just a single command:
cosmo login. When you run this, you will see some output with a login URL, but a new browser tab/window should also bring you to the device registration page in Cosmonic. (If you don't have an active session in this browser, you will be asked to log in first). Once you've authenticated, you're all set! You can close the tab.
Currently, credentials generated via the login flow do not expire. This means you only have to run
cosmo login once per system.
Starting a host
To start a local wasmCloud host, run
cosmo up. This will start wasmCloud as well as a NATS leaf node. This leaf node is connected to the Cosmonic infrastructure using the credentials you generated with
cosmo login. While this NATS server is running, wasmCloud hosts started with
cosmo form a super constellation with your Cosmonic-managed resources.
Stopping a host
To shut down a local wasmCloud host started by
cosmo down. This will also stop your NATS leaf node.
Launching an actor
To start an actor on your local wasmCloud host, run
cosmo launch from within the actor's directory.
cosmo can only launch actors that have already been compiled and signed. Follow the instructions about the developer loop to compile and sign your actor.
If you're looking for something to do with the
cosmo CLI, then take a look at our user guide about the developer loop.
To see what commands are available, run
C O S M O N I C
Usage: cosmo [OPTIONS] <COMMAND>
down Stop the wasmCloud host and NATS leaf launched by `up`
launch Launch an actor on a local wasmCloud host
login Securely download credentials to authenticate this machine with Cosmonic infrastructure
up Start a NATS leaf and wasmCloud host connected to Cosmonic infrastructure, forming a super constellation
tutorial Run through the tutorial flow
whoami Check connectivity to Cosmonic and query device identity information
help Print this message or the help of the given subcommand(s)
-o, --output <OUTPUT> Specify output format (text or json) [default: text]
-h, --help Print help information
-V, --version Print version information