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:

klyra help
# or
klyra <command> --help

Commands

CommandDescription
initGenerate a Klyra project from a template
runRun a Klyra service locally
deployDeploy a Klyra service
deploymentManage deployments of a Klyra service [aliases: depl]
logsView logs of a Klyra service
projectManage projects on Klyra [aliases: proj]
resourceManage resources [aliases: res]
certificateManage SSL certificates for custom domains [aliases: cert]
accountShow info about your Klyra account [aliases: acc]
loginLogin to the Klyra platform
logoutLog out of the Klyra platform
generateGenerate shell completions and man page
feedbackOpen an issue on GitHub and provide feedback
upgradeUpgrade the cargo-klyra binary
helpPrint 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 on 0.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

All project-related commands can use:

  • --working-directory <path> or --wd <path> to execute the command in a different folder.
  • --name <name> to specify project name explicitly (see Project).
  • --id <id> to specify project id explicitly (see Project).
  • 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 the run and deploy 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.