Redirect CLI commands
The commands in this section allow you to manage project assets that involve Uniform's redirect features. This includes:
Project asset | Command | More information |
---|---|---|
Redirect commands | redirect | Capabilities |
Redirect commands#
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:
Get redirects#
command
Fetch a redirect definition from the Uniform project.
Command | Output details |
---|---|
-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. |
-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 |
--proxy | Proxy server. If not specified, the following environment variables are used (with the first match being used): |
List Redirects#
command
List redirect definitions from the Uniform project.
Command | Output details |
---|---|
--offset | Number of rows to skip before fetching. |
limit | Number of rows to fetch. |
-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. |
-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 |
--proxy | Proxy server. If not specified, the following environment variables are used (with the first match being used): |
Pull Redirect#
command
Fetch all Redirect definitions from the Uniform project and save them locally.
- If a directory path is specified, a separate file is created for each Redirect.
- If a file path is specified, all Redirect definitions are saved in a single file.
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 |
--proxy | Proxy server. If not specified, the following environment variables are used (with the first match being used): |
Push redirect#
command
Insert or update all Redirect definitions from local disk to the Uniform project.
- If a directory path is specified, the Redirect defined in the files in the directory used.
- If a file path is specified, the Redirect in the file 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. |
-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 |
--proxy | Proxy server. If not specified, the following environment variables are used (with the first match being used): |
Remove Redirect#
command
Delete a Redirect definition from the Uniform project.
Command | Output details |
---|---|
-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 |
--proxy | Proxy server. If not specified, the following environment variables are used (with the first match being used): |
Update Redirect#
command
Insert or update a Redirect definition from a local file to the Uniform project.
Command | Output details |
---|---|
-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 |
--proxy | Proxy server. If not specified, the following environment variables are used (with the first match being used): |