Skip to main content

Easily run commands and gather info across multiple servers

Project description


quickrun is a module designed to make it easy to run commands and gather info from multiple servers.


  • python3.8
  • jq
  • aws cli (v1)

Getting started



pip3 install quickrun


import quickrun
from import find_instances

# Define instance
qr = quickrun.QuickRun()

# Configure

qr.servers = [ quickrun.Server(host="my-ip-address-or-hostname", name="my-web-server", user="username") ]
# or from aws cli
qr.servers = quickrun.Servers.from_list(find_instances({ 'tag:environment': 'production' }, region='eu-west-1'))

qr.commands = [ quickrun.Command(name="Get openssl version", cmd="openssl version") ]
qr.formatter = quickrun.formatters.table

# Call

This will display something like:

┃ server             ┃ host        ┃ command         ┃ output                     ┃
│ my-instance-name-1 │ │ openssl version │ OpenSSL 1.1.1  11 Sep 2018 │
│ my-instance-name-2 │ │ openssl version │ OpenSSL 1.1.1  11 Sep 2018 │
│ my-instance-name-3 │ │ openssl version │ OpenSSL 1.1.1  11 Sep 2018 │
│ my-instance-name-4 │ │ openssl version │ OpenSSL 1.1.1  11 Sep 2018 │

Making a script

Option 1: Basic script using some of the functions

You can just write a normal python script and use some of the functions from this module.
See examples/ as an example.

Option 2: Calling out to QuickRun

There is also the base QuickRun class which can be configured and called.
See examples/ and examples/ as examples.

Option 3: Extending QuickRun

You could also create your own class extending from QuickRun.
This is handy since you can override the hook methods.
See examples/ as an example.


There are a few core helpers built in to quickrun.


There are a few formatters defined in quickrun.formatters

  • default: Just prints out the python object
  • none: Does nothing
  • fake_shell: Formats the run as if it was ran directly
  • table: Outputs the run as a table

There is also a helpful quickrun.aws_cli.find_instances() function that takes a string and region and returns all instances with the name tag containing that string.



Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

quickrun-0.0.3.tar.gz (6.7 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page