Artipie CLI should parse configuration file and same global configuration options.
File
The file could be checked in order $HOME/.config/artictl/config.yaml, /etc/artictl/config.yaml. File should contain different context sections (for different servers), and ID of current context. Each context should have mandatory endpoint URI and authentication options. Endpoint is just a URI string, authentication options could be different, it's either user+password or auth token.
CLI uses currentContext but can choose another one: articl --context=myLocal get repo
Options
The same parameters could be provided as global options for CLI:
endpoint for endpoint URI
auth-user user for auth
auth-password password for auth
auth-token token for auth
CLI options has higher priority that config file options and CLI should use options on conflict.
auth-user and auth-password should be used only together.
It should be not possible to use auth-token with auth-user or auth-password.
Examples:
artictl --endpoint=https://central.artipie.com get repo
artictl --auth-token=12345 get repo
artictl --auth-user=test --auth-password=qwerty get repo
Artipie CLI should parse configuration file and same global configuration options.
File
The file could be checked in order
$HOME/.config/artictl/config.yaml
,/etc/artictl/config.yaml
. File should contain different context sections (for different servers), and ID of current context. Each context should have mandatory endpoint URI and authentication options. Endpoint is just a URI string, authentication options could be different, it's either user+password or auth token.Example:
CLI uses
currentContext
but can choose another one:articl --context=myLocal get repo
Options
The same parameters could be provided as global options for CLI:
endpoint
for endpoint URIauth-user
user for authauth-password
password for authauth-token
token for authCLI options has higher priority that config file options and CLI should use options on conflict.
auth-user
andauth-password
should be used only together. It should be not possible to useauth-token
withauth-user
orauth-password
.Examples: