Command Line Interface

A Command Line Interface ("CLI") is designed to provide rapid access to key Empower functions without the need to construct REST calls manually. The Empower CLI can be used to manage all Empower functions, and certain functions may only be available via the CLI.


Installation

To install the CLI, first make sure you have the package installed:

  1. Install python 3.8.x+

    • Verify python 3.8 or greater is installed, by opening a command line and typing:
      python --version or python3 --version (for mac)
    • For installing python, see this article.
  2. Install the CLI.

    • Run the following command: pip install empower-cli
  3. Verify success.

    • Run the following command: empowercli --help



📘

HELP

You can always type --help after a command to get help:
empowercli --help



General Philosophy and Structure

This document serves as a general guideline while using the Empower CLI commands.

empowercli {service} {command} {resource} {subcommands} {arguments...} --options...

The cadence of the Empower CLI is designed to mimic Azure CLI, so when in doubt, try to think about how Azure CLI would implement whatever it is you are working on. (If you are new to Azure CLI, here is a good resource for that).

  • empowercli: this command variable will be added to the OS PATH on install of the CLI tool.
  • service: the service the Empower CLI will be working with (e.g. "discovery", "api", "licensing", etc.).
  • resource: the specific resource, model, or entity associated with the command (e.g. "company", "enterprise", "source", "flow", etc.).
  • command: the specific command being executed (usually CRUD related, but could be anything).
  • subcommands: additional commands if required.
  • options: commands or subcommands required or optional options.
  • arguments: any required or optional arguments.



General CRUD Commands

empowercli {service} {command} {resource}

Standard Commands:

  • show: get an individual resource (likely requires an 'id' argument)
  • list: get all entities of a resource (should take simple query parameters as arguments)
  • create: create an entity
  • update: update an existing entity
  • delete: delete an existing entity

Standard Arguments for Create/Update commands:

  • --json-path [optional]: optional path to a JSON file with objects
  • --json [optional]: optional JSON string



The Empower CLI commands

  • auth

  • context

  • discovery

  • api

    For example:
    `empowercli api company create --json-path <json_path>`
    

For more information about these commands use the help:

empowercli auth --help
empowercli api --help
empowercli context --help
empowercli discovery --help

Available Authentication (AUTH) Commands

  • login (Login user within an opened browser tab)

      For example: 
      `empowercli auth login yourcompany.com`
    
      `empowercli login {command} --arguments`
    

  • login-pipeline (Pipeline authentication using 'client_credentials' flow)

    For example:
    `empowercli auth login-pipeline`
    

📘

Note

The API will attempt to authenticate using the API currently set in the context.



Available CONTEXT Commands

(Environment, User, Etc)

  • set

    Options:
    --discovery-url TEXT (URL for the empower discovery service)
    --env-path PATH (Relative or full path to optional .env file with context values)
    --help (Show this message and exit)

      For example:
      `empowercli context set --options`
    
  • show

    Options:
    --help Show this message and exit.



Available API Commands

  • company

    • create

      Options:
      --json TEXT
      --file-path FILENAME Relative or absolute path to file. Supported filetypes: '.json'

          For example: 
          `empowercli api company create --options`
      

          Use the --help command for more information: 
          `empowercli api company create --help`
      
    • list

    • show

  • data-model-config (more info about the utility of this command)

    • create

           For example:
           `empowercli api data-model-config create --options`
      

          Use the --help command for more information: 
          `empowercli api company create --help`
      
    • delete

    • list

    • show

    • update

  • environment-databricks (more info about the utility of this command)

    • create
    • delete
    • list
    • show
    • update
  • file-object-match (more info about the utility of this command)

    • create
    • delete
    • list
    • show
    • update
  • processing-step-command (more info about the utility of this command)

    • create
    • delete
    • list
    • show
    • update
  • source-list (more info about the utility of this command)

    • create
  • source-object-list (more info about the utility of this command)

    • create
  • source (more info about the utility of this command)

    • create
    • delete
    • list
    • show
    • update