Project policy documents CLI commands
The commands in this section allow you to manage project policy documents that define permissions for project roles.
Prerequisites
- Minimum CLI version:
20.49.0 - Managing policy documents requires an admin API key with team admin permissions.
Project policy document commands#
List policy documents#
command
List policy documents for a project.
| Command | Output details |
|---|---|
-p, --project | Uniform project id. If not specified, the environment variable |
-f, --format | Format for the output (YAML or JSON) |
-o, --filename | File name for the output. If not specified the output is written to stdout. |
-f, --format | Uniform API key. If not specified, the environment variable |
--apiHost | Uniform host. If not specified, the environment variable |
| --verbose | Include verbose logging (default: false) |
Pull policy documents#
command
Pull all policy documents from Uniform to local files. Each policy document is saved as a separate file named by role ID.
- If a directory path is specified, a separate file is created for each policy document.
| Command | Output details |
|---|---|
-w, --what-if | If true, reports what would be done but changes no files. |
-m, --mode | Specifies what kind of changes can be made. |
-d, --diff | Specifies which changes are written to stdout. If not specified, the environment variable UNIFORM_CLI_DIFF_MODE is used. If the environment variable isn't set, the default value is used. |
-f, --format | Format for the output (YAML or JSON) |
-p, --project | Uniform project id. If not specified, the environment variable |
-f, --format | Uniform API key. If not specified, the environment variable |
--apiHost | Uniform host. If not specified, the environment variable |
| --verbose | Include verbose logging (default: false) |
Push policy documents#
command
Push policy documents from local files to Uniform. Directory should contain one file per role ID.
- If a directory path is specified, the policy documents defined in the files in the directory are used.
| Command | Output details |
|---|---|
-w, --what-if | If true, reports what would be done but changes no files. |
-m, --mode | Specifies what kind of changes can be made. |
-d, --diff | Specifies which changes are written to stdout. If not specified, the environment variable UNIFORM_CLI_DIFF_MODE is used. If the environment variable isn't set, the default value is used. |
-f, --format | Format for the output (YAML or JSON) |
-p, --project | Uniform project id. If not specified, the environment variable |
-f, --format | Uniform API key. If not specified, the environment variable |
--apiHost | Uniform host. If not specified, the environment variable |
| --verbose | Include verbose logging (default: false) |
Example workflow#
Here's a typical workflow for managing policy documents:
1. List policy documents#
2. Pull policy documents to local directory#
3. Modify local files as needed#
Edit the policy document files in the ./policies directory as needed.
4. Preview changes with what-if mode#
5. Apply changes#
6. Cross-project sync#
You can sync policy documents between projects in the same team: