DataOps CLI
The DataOps CLI (Command-line Interface) tool is a superset of multiple CLI sub-tools whose purpose is to make use of the DataOps.live platform easier.
Each of the sub-tools has its purpose and you can find out more about it by checking the SOLE Generator topic.
Prerequisites
Before installing the DataOps CLI, make sure you have the following prerequisites installed on your machine:
- Linux / MacOS
- Windows Powershell
Installation
Once you have the prerequisites, you can then install the DataOps CLI tool similarly to any other Python package.
Step 1 - Create a personal access token
Create a personal access token (PAT) that you will use to gain access to the CLI package. Open https://app.dataops.live/-/profile/personal_access_tokens
Token name
is a friendly name to remind you of its purpose, for exampledataops-pypi
Expiration date
is optionalSelect scopes
are the permissions you are allowing for the new token. Tick the following required scopes:read_api
Create the token by clicking the "Create personal access token" button
The page will refresh and a new token will be shown at the top
cautionThis will be the only time you will see this token. When you navigate away from this page, the token will not re-appear, please make a copy in a secure place
Get your username from your account menu in the top right of DataOps.live (Your username does not include the
@
symbol)
Step 2 - Set up your Python environment
- Linux / MacOS
- Windows Powershell
Add the two credentials into your terminal environment so that they are available during configuration:
export DATAOPS_USERNAME=<username-from-step-1> DATAOPS_PAT=<personal-access-token-from-step-1>
(Optionally) If you do not want to install
dataops-cli
globally on your machine, create a Python virtual environment:python3 -m venv venv
source venv/bin/activateAdd the DataOps.live package repository by updating your "pip" configuration:
pip config set global.index-url https://$DATAOPS_USERNAME:$DATAOPS_PAT@app.dataops.live/api/v4/projects/5844/packages/pypi/simple
The
pip config set
command adds the configuration you describe to your pip configuration file (usually located in your home directory).Install the package using pip:
pip install dataops-cli
Running into errors?For
401
errors, check yourDATAOPS_USERNAME
andDATAOPS_PAT
credentials are correct. For other issues, consider reaching out to our support team with a copy of the error.To confirm that the installation was successful try showing the
--help
or--version
:dataops --help
This should give you a brief description of the available options for the dataops CLI as shown in the image below:
Use the help menu to discover the tools available.
(Optionally) If you do not want to install
dataops-cli
globally on your machine, create a Python virtual environment:python3 -m venv venv
.\venv\Scripts\activateAdd the DataOps.live package repository by updating your "pip" configuration. You will need to substitute the two credentials from "Step 1" in the command below:
python3 -m pip config set global.index-url https://DATAOPS_USERNAME:DATAOPS_PAT@app.dataops.live/api/v4/projects/5844/packages/pypi/simple
The
pip config set
command adds the configuration you describe to your pip configuration file (usually located in your home directory).Install the package using pip:
python3 -m pip install dataops-cli
Running into errors?For
401
errors, check yourDATAOPS_USERNAME
andDATAOPS_PAT
credentials are correct. For other issues, consider reaching out to our support team with a copy of the error.To confirm that the installation was successful try showing the
--help
or--version
:dataops --help
This should give you a brief description of the available options for the dataops CLI as shown in the image below:
Use the help menu to discover the tools available.
Once you have the DataOps CLI tool installed, you can check the separate sub-tools for more details on how to use it.
Sub-tools:
Step 3 - Install autocomplete (optional)
After you have installed the dataops-cli
you can optionally install the
command-line autocomplete helper. Only currently works for bash
/zsh
/fish
shells.
Autocomplete for the dataops-cli
lets you use the TAB
key to complete
commands and options. For example, you could type: dataops -
and press TAB
you will see additional options:
Continuing to press TAB
will cycle through the options, highlighting the next,
pre-filling your command line:
Install the command-line autocomplete by using the
dataops-autocomplete
command installed automatically when installing thedataops-cli
. For example, you can install autocomplete forzsh
using the following:dataops-autocomplete zsh
This adds a line to your shell file to load into your shell environment.
Important: Follow the onscreen instructions or start a new terminal to enable autocomplete.
Uninstall
To uninstall the dataops-cli
tool use pip commands:
pip uninstall dataops-cli
To uninstall autocomplete, remove the added DATAOPS-AUTOCOMPLETE
line in your
shell file:
- For
bash
shell users, look in your~/.bashrc
- For
zsh
shell users, look in your~/.zshrc
fish
shell users will need to remove .config/fish/completions/dataops.fish
.