CLI
Overview of the Klyra commands
Interaction with the Klyra platform is mainly done with the klyra
Command Line Interface (CLI).
Some tasks, such as viewing logs, can also be done in the Klyra Console.
After installation, you will have two commands: klyra
and cargo klyra
.
klyra
is used for interacting with the klyra.dev platform.cargo klyra
is used for interacting with the klyra.rs platform.
This documentation covers the klyra.dev platform.
To get an overview of available commands, subcommands, and options, run:
Commands
Command | Description |
---|---|
init | Generate a Klyra project from a template |
run | Run a Klyra service locally |
deploy | Deploy a Klyra service |
deployment | Manage deployments of a Klyra service [aliases: depl] |
logs | View logs of a Klyra service |
project | Manage projects on Klyra [aliases: proj] |
resource | Manage resources [aliases: res] |
certificate | Manage SSL certificates for custom domains [aliases: cert] |
account | Show info about your Klyra account [aliases: acc] |
login | Login to the Klyra platform |
logout | Log out of the Klyra platform |
generate | Generate shell completions and man page |
feedback | Open an issue on GitHub and provide feedback |
upgrade | Upgrade the cargo-klyra binary |
help | Print this message or the help of the given subcommand(s) |
Cookbook / Cheat Sheet
These are some useful sequences of commands that are handy to keep in your back pocket.
For full documentation, use --help
on the respective command.
Use the global --debug
flag to print detailed debug output.
Get started
cargo install cargo-klyra
: For more alternatives, see Installation.klyra login
: Log in via the Klyra Console.klyra init
: Generate a project from a template.klyra account
: Check account details.
Local run
For more tips, see Local Run.
klyra run
: Run the project locally so you can test your changes.klyra run --port 8080
: Change the local port.klyra run --port 8080 --external
: Expose to local network by listening on0.0.0.0
.klyra run --secrets <file>
: Use a non-default secrets file for this run.klyra run --release
: Compile with release mode.klyra run --bacon
: Run in watch mode, requires separate install of bacon.
Deploy a project
klyra project create
: Create a project on Klyra.klyra deploy
: Deploy the project to Klyra.klyra deploy --no-follow
: Don’t poll deployment state. Alias:--nf
.klyra deploy --secrets <file>
: Use a non-default secrets file for this deployment. It must be located in the same folder that Secrets.toml should be in.
Manage projects
klyra project list
: List your projects.klyra project status
: Check the state of this project.klyra project link
: Link this project folder to a project on Klyra.klyra project delete
: Delete a project.klyra project update name <new-name>
: Rename a project and its default subdomain.
Manage deployments and logs
klyra deployment list
: List deployments in this project.klyra deployment status
: Show status of the currently running deployment.klyra deployment stop
: Stop any currently running deployments.klyra deployment redeploy
: Redeploy the latest deployment without building.klyra deployment redeploy [id]
: Redeploy the specified deployment id without building.klyra logs
: Get all logs from the currently running deployment.klyra logs --latest
: Get all logs from the latest deployment.klyra logs <id>
: Get all logs from a specific deployment.klyra logs --raw
: Print the logs without timestamps and origin tags. The--raw
flag is also available for therun
anddeploy
commands.
Manage resources
klyra resource list
: List resources linked to this project.klyra resource delete <type>
: Delete a resource such as databases and secrets.
Shell completions
Use klyra generate shell <shell>
with one of: bash, elvish, fish, powershell, zsh.
Example configuration for Zsh on Linux: add eval "$(klyra generate shell zsh)"
to ~/.zshrc
.
Utility
klyra <command> --debug
: Turn on tracing output for Klyra libraries. (WARNING: can print sensitive data)klyra deploy --output-archive <path>
: Dump the deployment archive to disk instead of deploying it. Useful for debugging.klyra logout --reset-api-key
: Log out and reset your account’s API key.