Webhook CLI commands

The commands in this section allow you to manage project assets that involve Uniform's webhook features.

Prerequisites

Managing webhooks currently requires an API key with team admin permissions.

These commands should be added as a script command in your project, rather than run directly in the terminal. For example, in the package.json file of a next.js project:

"scripts": { "uniform:fetch-webhooks": "uniform webhook pull" },
uniform webhook pull <directory or file path>

command
Fetch all webhook definitions from the Uniform project and save them locally.

  • If a directory path is specified, a separate file is created for each webhook.
  • If a file path is specified, all webhook definitions are saved in a single file.
CommandOutput details

-w, --what-if
boolean (optional)

If true, reports what would be done but changes no files.

-m, --mode
string (optional, default value: mirror)

Specifies what kind of changes can be made.
create - Create new files but don't update existing files.
createOrUpdate - Create new files and update existing files but delete no files.
mirror - Create new files, update existing files, and delete files that don't match existing objects in the Uniform project.

-d, --diff
string (optional, default value: off)

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.
off - No changes are written.
update - Only update changes are written.
on - Update, create, and delete changes are written.

-f, --format
string (optional, default value: YAML)

Format for the output (YAML or JSON)

-p, --project
string

Uniform project id. If not specified, the environment variable UNIFORM_CLI_PROJECT_ID is used.

-f, --format
string (optional, default value: YAML)

Uniform API key. If not specified, the environment variable UNIFORM_API_KEY is used.

--apiHost
string (optional, default value: https://uniform.app)

Uniform host. If not specified, the environment variable UNIFORM_CLI_BASE_URL is used. If the environment variable isn't set, the default value is used.

--proxy
string (optional)

Proxy server. If not specified, the following environment variables are used (with the first match being used): HTTPS_PROXY, https_proxy, ALL_PROXY, all_proxy. If no match is found, no proxy server is used.

uniform webhook push <directory or file path>

command
Insert or update all webhook definitions from local disk to the Uniform project.

  • If a directory path is specified, the webhook defined in the files in the directory used.
  • If a file path is specified, the webhook in the file are used.
CommandOutput details

-w, --what-if
boolean (optional)

If true, reports what would be done but changes no files.

-m, --mode
string (optional, default value: mirror)

Specifies what kind of changes can be made.
create - Create new files but don't update existing files.
createOrUpdate - Create new files and update existing files but delete no files.
mirror - Create new files, update existing files, and delete files that don't match existing objects in the Uniform project.

-d, --diff
string (optional, default value: off)

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.
off - No changes are written.
update - Only update changes are written.
on - Update, create, and delete changes are written.

-p, --project
string

Uniform project id. If not specified, the environment variable UNIFORM_CLI_PROJECT_ID is used.

-f, --format
string (optional, default value: YAML)

Uniform API key. If not specified, the environment variable UNIFORM_API_KEY is used.

--apiHost
string (optional, default value: https://uniform.app)

Uniform host. If not specified, the environment variable UNIFORM_CLI_BASE_URL is used. If the environment variable isn't set, the default value is used.

--proxy
string (optional)

Proxy server. If not specified, the following environment variables are used (with the first match being used): HTTPS_PROXY, https_proxy, ALL_PROXY, all_proxy. If no match is found, no proxy server is used.