cargo-shuttle
cargo-shuttle is your commandline tool for deploying web apps on shuttle, the stateful serverless web platform for Rust.
README Sections: Installation β Subcommands β Development
cargo-shuttle brings shuttle, the open source serverless platform for Rust web applications, into your terminal. With a dedicated focus on productivity, reliability, and performance, cargo-shuttle makes deploying your code to the cloud as easy as deriving a trait.
Installation
cargo-shuttle is available for macOS, Linux, and Windows.
To install on Linux or macOS, run:
|
On Windows, you can default to installing from source:
Distro Packages
Arch Linux
cargo-shuttle can be installed from the extra repository using pacman:
Alpine Linux
cargo-shuttle is available for Alpine Edge. It can be installed via apk after enabling the testing repository.
Subcommands
cargo-shuttle's subcommands help you build and deploy web apps from start to finish.
Run cargo shuttle help to see the basic usage:
Usage: cargo-shuttle [OPTIONS] <COMMAND>
Commands:
init Create a new shuttle project
run Run a shuttle service locally
deploy Deploy a shuttle service
deployment Manage deployments of a shuttle service
status View the status of a shuttle service
stop Stop this shuttle service
logs View the logs of a deployment in this shuttle service
project List or manage projects on shuttle
resource Manage resources of a shuttle project
clean Remove cargo build artifacts in the shuttle environment
login Login to the shuttle platform
logout Log out of the shuttle platform
generate Generate shell completions and man page
feedback Open an issue on GitHub and provide feedback
help Print this message or the help of the given subcommand(s)
Options:
--working-directory <WORKING_DIRECTORY> Specify the working directory [default: .] [aliases: wd]
--name <NAME> Specify the name of the project (overrides crate name)
--api-url <API_URL> Run this command against the API at the supplied URL (allows targeting a custom deployed instance for this command only, mainly
for development) [env: SHUTTLE_API=]
-h, --help Print help
-V, --version Print version
Subcommand: init
To initialize a shuttle project with boilerplates, run cargo shuttle init [OPTIONS] [PATH].
Currently, cargo shuttle init supports the following frameworks:
--template actix-web: for actix web framework--template axum: for axum framework--template poem: for poem framework--template poise: for poise discord bot framework--template rocket: for rocket framework--template salvo: for salvo framework--template serenity: for serenity discord bot framework--template thruster: for thruster framework--template tide: for tide framework--template tower: for tower library--template warp: for warp framework
For example, running the following command will initialize a project for rocket:
This should generate the following dependency in Cargo.toml:
= "0.5.0"
= "0.36.0"
= "0.36.0"
= "1.26.0"
The following boilerplate code should be generated into src/lib.rs:
extern crate rocket;
async
Subcommand: run
To run the shuttle project locally, use the following command:
# Inside your shuttle project
This will compile your shuttle project and start it on the default port 8000. Test it by:
Subcommand: login
Use cargo shuttle login inside your shuttle project to generate an API key for the shuttle platform:
# Inside a shuttle project
This should automatically open a browser window with an auto-generated API key for your project. Simply copy-paste the API key back in your terminal or run the following command to complete login:
Subcommand: deploy
To deploy your shuttle project to the cloud, run:
Your service will immediately be available at {crate_name}.shuttleapp.rs. For instance:
Subcommand: status
Check the status of your deployed shuttle project with:
Subcommand: logs
Check the logs of your deployed shuttle project with:
Subcommand: stop
Once you are done with a deployment, you can stop it by running:
Development
Thanks for using cargo-shuttle! Weβre very happy to have you with us!
To contribute to cargo-shuttle or stay updated with our development, please open an issue, discussion or PR on Github and join our Discord! π