Command Line Quick Start Guide

  1. Create an account

    Start the account creation process by navigating to the Sign Up page or by clicking here. If you encounter an issue, please contact account support at accounts@leolabs.space for assistance.

    We automatically create a personal organization for you to use with LeoLabs, but you may want to join or create another organization to use with your colleagues.

  2. Create an API key

    Once you've created your new account and are logged in, create a new API key on the API Keys page. Navigate there by clicking on "Manage API Keys" in the top menu or by clicking here.

  3. Upgrade to a standard subscription for your organization

    New organizations start out with a Trial Subscription and have certain restrictions. In order to gain full access to the LeoLabs API, please contact us at accounts@leolabs.space to start the upgrade process.

  4. Install the CLI

    The LeoLabs CLI requires Python 2.7.9+ or 3.4+.

    After installing Python, run this at the command line to install the LeoLabs CLI:

    $ pip install leolabs --upgrade
  5. Configure the CLI

    Configure the CLI by running this at the command line and enter the access and secret keys from your new API key when prompted:

    $ leolabs configure Access Key: xxxxx Secret Key: xxxxx
  6. Different commands

    The CLI takes on the following format:

    $ leolabs [resource] [command] [arguments]

    The two available resources are instruments and catalog. The commands available for each resource vary, but we can see them using the CLI's built-in help.

    $ leolabs instruments Did not recognize command "" for resource "instruments", valid choices are: dict_keys(['list', 'get', 'list-tasks', 'create-task', 'get-task', 'get-task-measurements', 'get-statistics']) $ leolabs catalog Did not recognize command "" for resource "catalog", valid choices are: dict_keys(['list', 'get', 'get-statistics', 'get-measurements', 'get-planned-passes', 'list-states', 'get-state', 'get-propagation', 'create-task'])

    The CLI documentation goes into greater detail about all the different commands you can perform and their required arguments. Here are some example commands:

    Get the list of instruments:

    $ leolabs instruments list { "instruments": [ { "altitude": 213.0, "longitude": -147.47104, "latitude": 65.12992, "transmitFrequency": 450000000.0, "id": "pfisr", "transmitPower": 2000000.0 }, { "altitude": 855.0, "longitude": -103.233245, "latitude": 31.9643, "transmitFrequency": 440000000.0, "id": "msr", "transmitPower": 65000.0 } ] }

    Get a catalog object by a LeoLabs catalog number:

    $ leolabs catalog get --catalog-number L335 { "name": "ENVISAT", "noradCatalogNumber": 27386, "catalogNumber": "L335" }
  7. Full list of commands

    To view the full list of CLI commands, see the CLI documentation.