Skip to content
sloop

Start here

Installation

One line on Windows, Linux or macOS. It checks what it downloads before it unpacks anything, puts the binary on PATH, and tells you to restart your shell — which is the one step people miss.

sloop is a single binary with nothing beside it: no runtime to install first, no service to register, no account. It builds for Windows, Linux and macOS on both x86-64 and aarch64, and the installer picks the right one by asking the machine rather than asking you.

Showing Linux. Change it in the strip above and the whole page follows.

Install it

In any POSIX shell. No sudo: everything goes under your home directory, and the binary is statically linked against musl, so it runs on a distribution sloop has never heard of.

a shell, on Linux
$ curl -fsSL https://dbsloop.github.io/install.sh | shsloop latest for x86_64-unknown-linux-musl checksum verified installed /home/you/.local/bin/sloop PATH entry added to /home/you/.bashrc sloop 0.1.5 is installed. Restart your shell, or start a new terminal, before running sloop.A shell reads /home/you/.bashrc once, when it starts -- this one has already read it. To use it in this shell without restarting: export PATH="/home/you/.local/bin:$PATH" Then: sloop setup

Then restart your shell. A shell reads its startup environment once, when it starts, and the one you just ran that in has already done so — so sloop will not be found in it however correct the install was. Open a new terminal, or paste the export the installer prints for this window only.

After that, getting started takes you from here to a verified backup you can restore.

What it just did

It worked out that this machine is x86_64-unknown-linux-musl, downloaded sloop-x86_64-unknown-linux-musl.tar.gz and SHA256SUMS from the same release, checked the first against the second before unpacking a byte of it, and put sloop in ~/.local/bin.

Then it appended a marked block to the startup file your login shell actually reads. Which file that is depends on the shell, and getting it wrong is how an installer reports success and leaves you with sloop: command not found:

Your shellThe file it writes
zsh${ZDOTDIR:-~}/.zshrc
bash~/.bashrc
fish~/.config/fish/conf.d/sloop.fish
ksh~/.kshrc
anything else~/.profile

The block is fenced between # >>> sloop >>> and # <<< sloop <<<, and the path inside it is written with $HOME rather than expanded. The markers are what makes removing it later an exact operation rather than a person editing a file by hand. Running the installer twice leaves one block, not two.

Installer options

Four of them, and they do the same four things on every platform. The last one is the one to reach for if you manage PATH yourself.

OptionWhat it does
--version <x.y.z>install that release instead of the latest. A leading v is fine
--dir <path>install there instead of ~/.local/bin
--from <url|dir>fetch from there instead of GitHub releases — an internal mirror, or a directory
--no-modify-pathinstall, and touch no startup file at all

Passing one through the pipe needs sh told where its own arguments stop, which is what the bare -- after -s is for:

with options
$ curl -fsSL https://dbsloop.github.io/install.sh | sh -s -- --version 1.2.3 --dir ~/bin

…or as environment variables

All four also arrive from the environment, which is what a configuration-management tool usually wants:

VariableThe same as
SLOOP_VERSION--version
SLOOP_INSTALL_DIR--dir
SLOOP_INSTALL_BASE--from
SLOOP_NO_MODIFY_PATH--no-modify-path, when set to anything at all

Or take the archive by hand

Every release carries six archives and a single SHA256SUMS over all of them, in sha256sum -c format so you can check one without trusting a script to do it. No version appears in an asset name, which is what makes /releases/latest/download/<asset> resolve to the newest release with no API call and no token.

This machine takes sloop-x86_64-unknown-linux-musl.tar.gz. Swap x86_64 for aarch64 if yours is ARM .

checking it yourself
$ base=https://github.com/DBSloop/sloop/releases/latest/download$ curl -fsSLO "$base/sloop-x86_64-unknown-linux-musl.tar.gz"$ curl -fsSLO "$base/SHA256SUMS"$ grep sloop-x86_64-unknown-linux-musl.tar.gz SHA256SUMS | sha256sum -c -sloop-x86_64-unknown-linux-musl.tar.gz: OK$ tar -xzf sloop-x86_64-unknown-linux-musl.tar.gz$ install -m 755 sloop ~/.local/bin/sloop$ sloop --versionsloop 0.1.5

Nothing signs or quarantines a binary on Linux, so there is no extra step. The archive holds the binary at the top level and nothing else.

Or build it with cargo

The crate is dbsloop and the command is sloop — sloop on crates.io belongs to an abandoned 2019 project, and Cargo lets a binary be named independently of the package that ships it.

from crates.io
$ cargo install dbsloop Updating crates.io index Downloaded dbsloop v0.1.5 Installing dbsloop v0.1.5 Compiling dbsloop v0.1.5 … Finished `release` profile [optimized] target(s) in 1m 49s Installing /home/you/.cargo/bin/sloop Installed package `dbsloop v0.1.5` (executable `sloop`)

That puts the binary in ~/.cargo/bin, which cargo's own installer already put on your PATH — so none of the PATH handling above applies. To build the working tree instead:

git clone https://github.com/DBSloop/sloop then cd sloop/cli && cargo install --path .

Removing it

sloop uninstall is the one to run first, while the binary still works. It knows what sloop built on this machine — a PostgreSQL it downloaded, its own database, the role that owns it, the registry — and it removes all of that, then the binary and the PATH entry, at the end. A script cannot do that, because a script cannot know which PostgreSQL was sloop's.

the one to run
$ sloop uninstall

The script below is the fallback, for a machine where the binary is gone, or broken, or was never on PATH. It removes the binary and the PATH entry and nothing else — so it is not a shorter way of doing the command above, it is what is left when that command cannot run. If sloop's own state is still there and the binary could still remove it, the script stops and names the flag rather than deciding for you.

only if sloop uninstall cannot run
$ curl -fsSL https://dbsloop.github.io/uninstall.sh | sh removed /home/you/.local/bin/sloop removed sloop's PATH block from /home/you/.bashrc sloop is off this machine.Open shells still have the old PATH; the next one will not.

--binary-only says take the binary and the PATH entry and leave sloop's database, registry and config alone — for replacing sloop rather than removing it. Reset and uninstall covers what each of them destroys and what it leaves.

Backups are never deleted. Not by the uninstall script, not by sloop uninstall, not by sloop reset, not ever. A registry is a minute of typing and a PostgreSQL is a download; a dump that is gone is gone.

sloop — a database operations CLI for PostgreSQL, MySQL and MariaDB. MIT or Apache-2.0.