Skip to main content

Overview

Summary of Commands

Run the prv command to see a summary of commands.
If you don’t want to use or remember commands, you can use prv menu for an arrow navigation menu experience.

Resource Actions

Resource Commands

Roadmap Resources (Coming Soon)

The following resources are planned but not yet available. They appear in the CLI for discoverability, but currently only respond with a “Coming Soon” message. Command and shorthand names may change before release.

Interactive Prompts

With most industry CLI clients, you have to pass the argument or option with the CLI command. With Provisionr, we check for any options you’ve already provided, then prompt you for anything else you have not specified. This allows you to simply run the command without any options. You do not need to take a few moments to study the available options. As an added benefit, most options are presented as a searchable select menu to reduce the number of keystrokes needed, or the multiple terminal sessions to lookup records and copy IDs, etc.

Interactive Menus

You can navigate menus using the arrows keys on your keyboard and press ENTER/RETURN to make a selection. Some menus support undo functionality and you can press Ctrl+U to go back and change your selection. To exit a menu at any time, press Ctrl+C.

Command Options

Help Command

Use the --help option on any command to see details about it’s usage.

Equals vs Spaces

The --help command and documentation shows an equal sign between an option and the value (ex. --option=value). You can also use a space instead of the equal sign (--option value).

Quote Wrapped Strings

Any strings with a space must be wrapped in double quotes. Single quotes or backticks may work depending on your OS but are not tested or supported.

Multiple Options

You can pass multiple options by separating them with a space. Keep in mind that any strings with a space should be wrapped in quotes. You can mix and match whether to use an equal or a space between the key and value.

Boolean Flags

Boolean options do not take a true or false value. You either include the flag or you don’t. The common convention is --is_{boolean} for the positive case and --is_not_{boolean} for the negative case.

Table Tips

The :list commands support advanced filtering using exact and partial (fuzzy search). You can apply filters using the interactive menus below the list of results or by adding options when running the command. Animation

Exact vs Partial Matches

Most database columns are encrypted and do not allow partial string searching. Provisionr has functionality in some places that allow us to fetch the contents, decrypt them, then perform partial searches. Throughout the API and CLI, the search keyword is used to indicate that partial matches are supported. If search is not included, assume that only exact matches will appear in your results. Most list commands support exact string matches using {field_name}= and partial string matches using the search keyword {field_name}_search= on most string fields. You can use --search for a full text search across most or all fields if it is available on that command.

Filtering Columns Without an Option

CLI options are associated with API server-side filters. When a column is shown in the table but no CLI option exists for it, use --where and --where-partial to filter it. These run similar to a SQL query on the client side, providing additional filtering that the API does not offer. --where matches exactly; --where-partial matches a substring. Both can be passed multiple times. For terminal table-width brevity, the filter is always based on the column name shown in the table or export list of records, including the dot. Any nested relationships in the included. array are automatically stripped of the prefix. Any resource names separated by an underscore are abbreviated to the string after the last underscore. For example, included.user_manager.full_name is manager.full_name.
Are you looking for a filter that doesn’t exist, or is an existing filter not intuitive? Let us know in Slack or a support ticket.

Date Filters

Any date or datetime filter should be in the format of YYYY-MM-DD or YYYY-MM-DD HH:MM:SS. You can also use ISO 8601 timestamps such as YYYY-MM-DDTHH:MM:SS.00000Z. Some other formats may work, however they are not tested or supported. Try to avoid using month and date first when using dates since it may be interpreted as DD-MM-YYYY or MM-DD-YYYY. All times shown are in the UTC timezone.
When a datetime is shown in a table or describe method, it may be color coded based on how recent the timestamp is relative to now. Any difference less than 24 hours is green. Any difference less than 7 days is cyan blue.

Including Deactivated Records

When a record is deactivated, it enters a soft-deleted state in the database. A soft delete lets us retain the record for the audit trail without including it in day-to-day results. Only non-deleted records are shown by default, so add the --deleted (or -D) flag to include them.
Any PII in a deactivated record is anonymized with ghost-user information after the deactivated-user retention policy period has expired.

Customizing Table Columns

The API response for a record includes more fields than we can display in a Terminal window. We have selected opinionated defaults of which columns are most relevant. For example, directory-user:list --state=expiring does not show an expiration-date column by default, even though the data is available. There are only so many pixels and characters in a terminal window, and we cannot scroll right like you can in a web UI. You can customize which columns are shown from all of the available data three ways:
  • Choose the Edit Column Display Settings option in the menu after running a prv {namespace}-{resource}:list command.
  • Run the cli-settings:customize command directly.
  • Add --column=COLUMN_NAME when running a list command to show a column temporarily.
Column names use dot notation with periods. These are flattened JSON array keys, so if you fetch the JSON data (see below), you can replace a nested array with a dot to reference the field you want. All settings are saved locally on your machine and only impact you. They apply whenever you run the list command for that resource until you change them. To reset back to the defaults, for one type of record or all settings globally, run the cli-settings:reset command.
There is no built-in way to re-order the display order of table columns. If you are comfortable editing JSON files, you can carefully edit ~/.config/provisionr/settings.json and re-order the comma-separated list in the columns array for the respective resource.

Raw Output for Scripts

Our interactive prompts are designed for a pleasant UX. If you are using scripts that rely solely on outputs of a command, add the --json flag on any list or describe command to get the structured JSON data response that the CLI received from the API. This lets you explore detailed information we don’t show by default and parse it with jq, awk, grep, and similar tools.
When run interactively, you will be prompted whether you want to export the JSON results to a file, which saves in your ~/Downloads/provisionr/ folder.

Filtering JSON with jq

This is an advanced topic for those familiar with manipulating terminal output. Skip it if it isn’t relevant or useful to you.
Because --json emits standard JSON, you can pipe it straight into jq to pull out exactly the field you need. When using scripts, add --no-interaction (or -n) to disable interactive prompts, headers, and metadata. This ensures only the JSON data itself is returned, with a clean terminal exit code. Reference a key by its path to get a value. For example, a user’s job title lives under .org.title:
That prints the value with quotes ("IT Security Engineer"). Add the -r (raw) flag to strip the quotes. This is handy when assigning the result to a variable or feeding it into another command:
Keys that contain a hyphen must be quoted inside brackets, since jq reads a bare - as subtraction. To read a sibling field like cost-center, use .org["cost-center"].

Shorthand Commands

You can see a quick reference for all shorthand commands, including each namespace’s 2-character and resource’s 3-character shorthand, when running the prv command without any resources specified.
The 5-character shorthand also matches the prefix on any record ID, so if you know the ID, you already know the shorthand. For example, a drusr_01ky996whrvahxf482atvpg6wx ID belongs to the drusr (Directory User) resource. For a many-to-many relationship where one resource is attached to another, the shorthand uses the first character of each resource. A role-attached user is rau.
If you have additional muscle memory commands, you can add as many aliases to your Bash or ZSH profile as you’d like.

Shorthand Options

All options use a double hyphen prefix (ex. --name). Some options have shorthand variations that you can see when running --help for a command. We have standardized the alphabet for shorthand to maintain consistency. As a result, not all options have a shorthand letter if a suitable letter was not available.