Installation
If you're looking for the latest stable version of the sprocket
command line tool, you can either download it from the release page, build it from source (most common), get Sprocket through a package manager (support still being added), or use Docker.
Package managers
Homebrew
Sprocket is available through the Homebrew package manager on both MacOS and Linux. After installing Homebrew, you can install Sprocket with the following command.
brew install sprocket
Other package managers
Note
If you know of other, community-maintained packages for sprocket
, please let us know by opening up a pull request.
Docker images
Every released version of sprocket
is available through the GitHub Container Registry.
docker run ghcr.io/stjude-rust-labs/sprocket:v0.13.0 -h
Direct download
A pre-built binary for sprocket
can be downloaded from the latest release entry on GitHub. Each platform has different requirements regarding shared libraries that are expected to be installed.
Build from source
There are also a number of options to build sprocket
from source, including pulling in the released source from crates.io or downloading the source directly from GitHub.
All methods for building sprocket
from source require Rust and cargo
to be installed. We recommend using rustup to accomplish this.
Crates.io
You can use cargo
to install the latest version of sprocket
from crates.io.
cargo install sprocket
If desired, you can also check out a specific version of sprocket
.
cargo install sprocket@0.13.0
GitHub
Both the source code and the instructions to build the sprocket
command line tool are available on GitHub at stjude-rust-labs/sprocket
.
- The releases page contains all of the official releases for the project.
- If desired, you can install either the latest unpublished version (the code available on
main
) or any experimental features by checking out the associated feature branch (git checkout <branch-name>
).
The simplest way is just to clone the repository and build the main
branch, which is expected to always contained a compilable and correct (though, perhaps unreleased) version of Sprocket.
git clone git@github.com:stjude-rust-labs/sprocket.git
cd sprocket
cargo run --release
Shell completions
sprocket
can generate command-line completion scripts for various shells, allowing you to use tab completion for commands and arguments.
Warning
The sprocket
command line tool is currently under active development and is not yet considered stable. This means commands, flags, or arguments might change between versions. You will need to regenerate the shell completion script using the steps below each time you update sprocket
.
To generate a completion script, use the completions
subcommand, specifying your shell:
sprocket completions <SHELL>
Supported shells are: bash
, elvish
, fish
, powershell
and zsh
.
Enabling Completions
The exact steps to correctly enable shell completions depend on your specific shell and how it's configured. Generally it involves two main steps:
- Run the
sprocket completions <your shell>
command and redirect its standard output into a file, often somewhere in your home directory. For example, a Bash user might run:
sprocket completions bash > ~/.bash_completions/sprocket.bash
- Modify you shell's startup configuration file (e.g.
~/.bashrc
,~/.zshrc
,~/.config/fish/config.fish
, PowerShell's$PROFILE
, Elvish's~/.config/elvish/rc.elv
) to source the file you just created. Continuing the Bash example, add this line to your~/.bashrc
source ~/.bash_completions/sprocket.bash