Using the CLI
The cosmo
CLI is your one-stop-shop for all things Cosmonic. It puts at your fingertips the
ability to interact with and connect to your constellations. ✨
Installing the CLI
Installing the CLI is simple. Select your OS below and run the associated command:
- Unix
- Windows
bash -c "$(curl -fsSL https://cosmonic.sh/install.sh)"
powershell -Command "iwr -useb https://cosmonic.sh/install.ps1 | iex"
Logging in
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
, run 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.
Today, 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.
What's Next?
If you're looking for something to do with the cosmo
CLI, then take a look at our user guide about
the developer loop.
Help
To see what commands are available, run cosmo
or cosmo --help
:
> cosmo
cosmo 0.25.0
⣀⣴⣶⣶⣦⣀
⢀⣠⣴⣾⣿⣿⣿⣿⣿⣿⣷⣦⣄⡀
⣀⣤⣶⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣤⣀
⢀⣴⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⠋⠹⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣦⡀
⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏ ⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷
⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠁ ⠙⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⡿⠛⠁ ⠈⠛⠛⠿⠿⠿⣿⣿⡿
⣿⣿⣿⣿⣏
⣿⣿⣿⣿⣿⣿⣷⣦⣀ ⣀⣤⣶⣶⣾⣿⣿⣿⣷
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⡄ ⣴⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿
⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣆ ⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿
⠈⠛⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣄⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠛⠁
⠈⠛⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠛⠁
⠙⠻⢿⣿⣿⣿⣿⣿⣿⡿⠛⠋
⠈⠛⠿⠿⠛⠁
C O S M O N I C
Usage: cosmo [OPTIONS] <COMMAND>
Commands:
app Manage declarative applications and deployments (wadm) (experimental)
build Build (and sign) an actor, provider, or interface
completions Generate shell completions
connect Connect to external services and deploy actors
create Create a wormhole to connect to an actor
disconnect Disconnect from external services and stop resources
down Stop the wasmCloud host and NATS leaf launched by `up`
get Retrieves information about the lattice
inspect Inspect an actor or a provider
launch Launch an actor on a local wasmCloud host
link Link an actor and a provider
login Securely download credentials to authenticate this machine with Cosmonic infrastructure
new Create a new project from template
par Create or insert a new provider archive
reg Interact with OCI compliant registries
scale Scale an actor or a provider
up Start a NATS leaf and wasmCloud host connected to Cosmonic infrastructure, forming a super constellation
update Update an actor running in a host
whoami Check connectivity to Cosmonic and query device identity information
help Print this message or the help of the given subcommand(s)
Options:
-o, --output <OUTPUT> Specify output format (`text` or `json`) [default: `text`]
-h, --help Print help information
-V, --version Print version information