# disruptive-cli
Unofficial Command-Line Interface (CLI) for the Disruptive Technologies (DT) API.
- [DT REST API](https://developer.disruptive-technologies.com/api)
- [DT Python API](https://developer.disruptive-technologies.com/api/libraries/python/)
- [DT Developer Documentation](https://developer.disruptive-technologies.com/docs/)
## Installation
The package is hosted on PyPI and is available through pip.
```bash
pip install --upgrade disruptive-cli
```
Supports Python 3.8+.
## Authentication
Using [Service Account](https://developer.disruptive-technologies.com/docs/service-accounts/introduction-to-service-accounts) credentials, set the following environment variables.
```bash
export DT_SERVICE_ACCOUNT_KEY_ID="<SERVICE_ACCOUNT_KEY_ID>"
export DT_SERVICE_ACCOUNT_SECRET="<SERVICE_ACCOUNT_SECRET>"
export DT_SERVICE_ACCOUNT_EMAIL="<SERVICE_ACCOUNT_EMAIL>"
```
## Usage
Call the `dt` command using a `dt NOUN VERB` syntax.
- List all available projects.
```bash
dt project list
```
- Get a single device.
```bash
dt device get <DEVICE_ID>
```
See `dt -h` for additional commands.
### Completion
Bash completion is currently supported. Copy the completion script in `disruptive-cli/completion` to your place of choice in path, then source it from either `.bashrc`, `.bash_profile`, or `.profile` depending on your environment.
```
source '/usr/local/bin/dt-completion.bash'
```
## Formatting
A tabular human readable output is prioritized.
### Headers
Column headers are removed for single columns or if the `--no-header` flag is provided.
### Filters
A select set of columns are shown per resource. Use the `--full` flag to output all available information.
On the other hand, the `--include` can be used to include only specified columns in output.
### Other Filetypes
The following formats are supported.
- `--json`
- `--csv`
- `--tsv`
## Chaining Commands
Pipes are supported using the `-` symbol to make chaining commands simpler.
The following example lists all projects, then pipes the `project-id` column to the `serviceaccount` command to list all available Service Accounts per project. The output is formatted as `.json` and piped into [jq](https://stedolan.github.io/jq/) for further processing.
```bash
dt project list --include project-id | dt serviceaccount list - --json | jq
```
## Development
Virtualenv is used for dependency isolation, wrapped by the following commands.
- Build the distribution:
```bash
make build
```
- Remove build-files:
```bash
make clean
```
Raw data
{
"_id": null,
"home_page": "https://github.com/jhgjeraker/disruptive-cli",
"name": "disruptive-cli",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "disruptive,technologies,dt,api,cli",
"author": "Johannes H. Gjeraker",
"author_email": "johannes.holm.gjeraker@disruptive-technologies.com",
"download_url": "https://files.pythonhosted.org/packages/59/68/1dc6f6fe705d70314a4d8487facaab7decca3341b582b65a0fe87b40813b/disruptive-cli-0.5.1.tar.gz",
"platform": null,
"description": "# disruptive-cli\nUnofficial Command-Line Interface (CLI) for the Disruptive Technologies (DT) API.\n\n- [DT REST API](https://developer.disruptive-technologies.com/api)\n- [DT Python API](https://developer.disruptive-technologies.com/api/libraries/python/)\n- [DT Developer Documentation](https://developer.disruptive-technologies.com/docs/)\n\n## Installation\nThe package is hosted on PyPI and is available through pip.\n```bash\npip install --upgrade disruptive-cli\n```\n\nSupports Python 3.8+.\n\n## Authentication\nUsing [Service Account](https://developer.disruptive-technologies.com/docs/service-accounts/introduction-to-service-accounts) credentials, set the following environment variables.\n```bash\nexport DT_SERVICE_ACCOUNT_KEY_ID=\"<SERVICE_ACCOUNT_KEY_ID>\"\nexport DT_SERVICE_ACCOUNT_SECRET=\"<SERVICE_ACCOUNT_SECRET>\"\nexport DT_SERVICE_ACCOUNT_EMAIL=\"<SERVICE_ACCOUNT_EMAIL>\"\n```\n\n## Usage\nCall the `dt` command using a `dt NOUN VERB` syntax.\n\n- List all available projects.\n```bash\ndt project list\n```\n\n- Get a single device.\n```bash\ndt device get <DEVICE_ID>\n```\n\nSee `dt -h` for additional commands.\n\n### Completion\nBash completion is currently supported. Copy the completion script in `disruptive-cli/completion` to your place of choice in path, then source it from either `.bashrc`, `.bash_profile`, or `.profile` depending on your environment.\n```\nsource '/usr/local/bin/dt-completion.bash'\n```\n\n## Formatting\nA tabular human readable output is prioritized.\n\n### Headers\nColumn headers are removed for single columns or if the `--no-header` flag is provided. \n\n### Filters\nA select set of columns are shown per resource. Use the `--full` flag to output all available information.\n\nOn the other hand, the `--include` can be used to include only specified columns in output.\n\n### Other Filetypes\nThe following formats are supported.\n- `--json`\n- `--csv`\n- `--tsv`\n\n## Chaining Commands\nPipes are supported using the `-` symbol to make chaining commands simpler.\n\nThe following example lists all projects, then pipes the `project-id` column to the `serviceaccount` command to list all available Service Accounts per project. The output is formatted as `.json` and piped into [jq](https://stedolan.github.io/jq/) for further processing.\n\n```bash\ndt project list --include project-id | dt serviceaccount list - --json | jq\n```\n\n## Development\nVirtualenv is used for dependency isolation, wrapped by the following commands.\n\n- Build the distribution:\n```bash\nmake build\n```\n\n- Remove build-files:\n```bash\nmake clean\n```\n",
"bugtrack_url": null,
"license": "",
"summary": "Disruptive Technologies CLI.",
"version": "0.5.1",
"project_urls": {
"Developers Page": "https://developer.disruptive-technologies.com/docs/",
"Homepage": "https://github.com/jhgjeraker/disruptive-cli"
},
"split_keywords": [
"disruptive",
"technologies",
"dt",
"api",
"cli"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "08c3d7db7f272e2cab7563385cd4a5c74924d1d67d607b03dea4703c0faa0e05",
"md5": "310f76dbe4f1c62cb44d64529a7039d7",
"sha256": "7665c000965bfb37608cc3acc7544681ece758856fa900bae88175176347b485"
},
"downloads": -1,
"filename": "disruptive_cli-0.5.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "310f76dbe4f1c62cb44d64529a7039d7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 36465,
"upload_time": "2023-11-20T09:29:30",
"upload_time_iso_8601": "2023-11-20T09:29:30.479684Z",
"url": "https://files.pythonhosted.org/packages/08/c3/d7db7f272e2cab7563385cd4a5c74924d1d67d607b03dea4703c0faa0e05/disruptive_cli-0.5.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "59681dc6f6fe705d70314a4d8487facaab7decca3341b582b65a0fe87b40813b",
"md5": "3ce90880d54d50417293b7f8b75e285d",
"sha256": "6f033c4e667e211accf281c5b3fcb7eedea4dc6874d75148be4c9eb5792d4241"
},
"downloads": -1,
"filename": "disruptive-cli-0.5.1.tar.gz",
"has_sig": false,
"md5_digest": "3ce90880d54d50417293b7f8b75e285d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 27096,
"upload_time": "2023-11-20T09:29:31",
"upload_time_iso_8601": "2023-11-20T09:29:31.687227Z",
"url": "https://files.pythonhosted.org/packages/59/68/1dc6f6fe705d70314a4d8487facaab7decca3341b582b65a0fe87b40813b/disruptive-cli-0.5.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-11-20 09:29:31",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "jhgjeraker",
"github_project": "disruptive-cli",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "disruptive-cli"
}