Skip to content
[ 03 ]Commands

copia-cli alias import

copia-cli alias import [<filename> | -] [flags]

Import aliases from the contents of a YAML file.

Aliases should be defined as a map in YAML, where the keys represent aliases and the values represent the corresponding expansions. An example file should look like the following:

bugs: issue list --label=bug
igrep: '!copia-cli issue list --label="$1" | grep "$2"'
co: pr checkout

Use "-" to read aliases (in YAML format) from standard input; without an argument they are read from standard input too, unless it is a terminal.

The output of "copia-cli alias list" is such a file. Each alias is checked like "copia-cli alias set" checks it: an alias that is refused is reported on standard error, the others are imported, and the command fails at the end. An alias that already exists is kept unless "--clobber" is given.

Options

--clobber
Overwrite existing aliases of the same name

Options inherited from parent commands

--host <string>
Target Copia host
-R, --repo <string>
Select repository (owner/repo)
--token <string>
Authentication token

Examples

# Import aliases from a file
$ copia-cli alias import aliases.yml

# Import aliases from standard input
$ copia-cli alias import -

See also