Skip to content
Python API Client and CLI for StoplightIO
Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.MD
redirect_manager.py
stoplightio.py

README.MD

stoplightio.py

Python3 API Client and CLI for StoplightIO

Installation

# clone the repo
git clone git@github.com:aglensmith/stoplightiopy.git

# install requests python module used for HTTP calls
pip3 install requests

# move .py to user bin folder
cp stoplightiopy/stoplightio.py ~/bin

Authentication

To authenticate API requests from the CLI, supply a token using the --token switch:

python stoplightio.py --token {token} --build {domain_id}

Or, store the token in an environment variable called SL_API_TOKEN:

# run in terminal or add to .bashrc
export SL_API_TOKEN={token}

python stoplightio.py --build {domain_id}

CLI Usage

usage: python stoplightio.py [-h] [--build ID [ID ...]] [--token TK]
                             [--domains ID] [--config ID] [--redirects ID]

stoplightio.py CLI

optional arguments:
  -h, --help           show this help message and exit
  --build ID [ID ...]  build a list of domain ids
  --token TK           StoplightIO API Token
  --domains ID         return a list of domains for project [ID]
  --config ID          get the config for domain [ID]
  --redirects ID       get the redirects for domain [ID]
You can’t perform that action at this time.