#SSH #remote #experimentation #spur-py


Utilities for setting up and running experiments remotely

7 releases

✓ Uses Rust 2018 edition

0.3.0 Jan 25, 2019
0.2.0 Dec 31, 2018
0.1.4 Dec 6, 2018
0.1.3 Nov 5, 2018

#62 in Science

Download history 12/week @ 2018-11-10 5/week @ 2018-11-17 37/week @ 2018-11-24 36/week @ 2018-12-01 12/week @ 2018-12-08 4/week @ 2018-12-15 16/week @ 2018-12-22 19/week @ 2018-12-29 16/week @ 2019-01-05 6/week @ 2019-01-12 12/week @ 2019-01-19 6/week @ 2019-01-26 7/week @ 2019-02-16

72 downloads per month


926 lines


Latest version Documentation Build

Utilities for setting up and running experiments remotely.

spurs is heavily inspired by spur.py but it also contains a bunch of utility routines that I have found useful. I will periodically add more as I find useful ones or people submit PRs.


  • A straight-forward, well-typed, idiomatic interface for running commands remotely via SSH, similar to spur.py.
  • Utilities for common Linux admin operations, such as adding a user to a group or turning on a swap device or installing a package. This is by no means a complete set of such functions. So far it just includes the ones I have run into. Feel free to make PRs adding more.


use spurs::{cmd, ssh::{SshShell, Execute}};

const FOO: &str = "foo";
const HOST: &str = "";
const USER: &str = "user";

// Create an SSH connection with host.
// (host doesn't have to be a `&str`; it can be any `ToSocketAddrs` type)
let shell = SshShell::with_default_key(USER, HOST)?;

// Run some commands on HOST as USER.

// ps -e | grep foo
shell.run(cmd!("ps -e | grep {}", FOO).use_bash())?;

// cd /home/user ; ls -a | grep user
shell.run(cmd!("ls -a | grep user").cwd("/home/user/").use_bash())?;

// sudo yum install -y qemu-kvm

It's also possible to

  • run commands in another thread and later wait for that thread
  • capture the stdout and stderr
  • allow a command to fail

For more information please see the docs. Feel free to open an issue on the repo if anything is unclear.


Add the crate spurs to your Cargo.toml dependencies.

Requires stable Rust 1.32 or newer.


~147K SLoC