[data-reveal]{opacity:1!important;transform:none!important}
DocumentationConfiguration

Configuration

Reference for the AntelopeJS CLI configuration commands, which show, set, and reset the global CLI settings.

Overview

The ajs config command group manages the global CLI settings. Every project on the machine shares these settings. The CLI stores them in config.json in the .antelopejs folder of your home directory.

Configuration file location

PlatformPath
Linux, macOS~/.antelopejs/config.json
Windows%USERPROFILE%\.antelopejs\config.json
Note

Manage this file with the ajs config commands. You can edit it by hand, but a file that does not hold an object with a string git value makes every command that reads it fail. To recover, run ajs config reset, which writes the default settings whatever the file holds.

Configuration keys

The CLI has one configuration key:

KeyDescriptionDefault
gitURL of the interface repositoryhttps://github.com/AntelopeJS/interfaces.git

The interface repository lists the interfaces, the modules that implement them, and the module templates. ajs project modules install reads it to add the modules that implement unresolved interfaces. ajs module init and ajs project init read their templates from it. Set this value to point the CLI at a private or organization-specific interface repository. The --git option and the ANTELOPEJS_GIT environment variable override it for a single command.

ajs config show

Display all current CLI settings.

terminal
ajs config show

This command prints every setting as a key and value line. A value that differs from the default is marked (custom). Run it to confirm the active configuration before other commands.

text
git  https://github.com/acme/interfaces.git (custom)
OptionDescription
-j, --jsonPrint the configuration as JSON on stdout

ajs config get

Print the value of one configuration key.

terminal
ajs config get <key>
ArgumentDescription
keyThe configuration key to read, for example git
OptionDescription
-j, --jsonPrint the value as a JSON string

The command prints only the value on stdout, so scripts can read it. An empty value prints nothing on stdout and a notice on stderr. An unknown key exits with code 1 and lists the valid keys.

Example:

terminal
ajs config get git
# https://github.com/AntelopeJS/interfaces.git

REPOSITORY=$(ajs config get git)

ajs config set

Set a configuration key to a new value.

terminal
ajs config set <key> <value>
ArgumentDescription
keyThe configuration key to update
valueThe new value to assign

Example:

terminal
ajs config set git https://github.com/your-org/interfaces.git
text
▲ Using a non-default git repository
  Its interfaces are not official and may not adhere to community quality standards or best practices.
✔ Set git to https://github.com/your-org/interfaces.git
  Previous value: https://github.com/AntelopeJS/interfaces.git

The git value must be a repository that git clone can read. The command accepts an https or ssh URL, an scp-like address such as [email protected]:your-org/interfaces.git, or an absolute local path. It rejects any other value with exit code 2. Setting a key to the value it already has changes nothing and says so:

text
ℹ git is already set to https://github.com/your-org/interfaces.git

After this command, ajs project modules install, ajs module init and ajs project init use the new repository URL. The value stays in the configuration file until you change or reset it.

ajs config reset

Reset all CLI settings to their default values.

terminal
ajs config reset [options]
OptionDescription
-y, --yesSkip the confirmation

Examples:

terminal
# Reset with confirmation prompt
ajs config reset

# Reset without confirmation
ajs config reset --yes

When every setting already has its default value, the command says so and asks nothing. Otherwise it asks for confirmation. When standard input is not a terminal, or CI is set, the command cannot ask, so it exits with code 2 and asks for --yes. Answering no changes nothing and exits with code 0. Cancelling the confirmation with Ctrl+C exits with code 130.

Caution

A reset removes all custom settings. A custom interface repository URL goes back to the default AntelopeJS repository.

See also

  • Configuration describes the project configuration file and its options.