re config
Operations for managing named contexts
are scoped under re config
command. These include subcommands to create, read,
update, delete contexts, as well as setting a default named context and
utilities.
Usage
re config [OPTIONS] <SUBCOMMAND>
Subcommands
Command | Description |
---|---|
re config add | Create or modify a named context in the configuration file |
re config current | Display the current context in use |
re config delete | Delete the specified context from the reinfer configuration file |
re config get-token | Print the token for a given context or the current one if unspecified |
re config ls | List all the available contexts in the configuration file |
re config use | Set the default context to use when none is specified for a command |
To see the available subcommands or help with a given subcommand
re config help
re config add
Create or modify a named context in the configuration file
Usage
re config add [FLAGS] [OPTIONS]
Options
Name | Description |
---|---|
-n, --name <name> | The name of the context that will be created or updated |
-e, --endpoint <endpoint> | The Re:infer cluster endpoint that will be used for this context |
-t, --token <token> | The Re:infer API token that will be used for this context |
--proxy <proxy> | URL for an HTTP proxy that will be used for all requests if specified |
-k, --accept-invalid-certificates | Whether to accept invalid TLS certificates. You should never have to use this, you running a Re:infer cluster locally for development |
Examples
# Add a new context called `acme`. The cli will interactively ask to provide an API token.
re config add --name acme --endpoint https://acme.reinfer.io
# Using `--name` with a context that already exists will modify it instead.
# For example, the next command changes the endpoint of the `acme` context.
re config add --name acme --endpoint https://acme-dev.reinfer.io
# Create a context specifying all information as arguments.
re config add -n staging -e https://localhost:9443 -k -t MYTOKEN
# If options are not provided, the cli will interactively prompt user to enter them
re config add
# Standard output:
* Context name: my-context
I A new context `my-context` will be created
* Enter API token [none]: SECRETTOKEN
W Be careful, API tokens are stored in cleartext in /home/marius/.config/reinfer/contexts.json
* Endpoint [https://reinfer.io/]: https://acme.reinfer.io
I New context `my-context` was created
re config current
Print the current context in use to standard output
Usage
re config current
Examples
# Print the currently used context to stdout
re config current
# Save the current context to an environment variable
export REINFER_CONTEXT=`re config current`
re config delete
Delete the specified context from the reinfer configuration file
Usage
re config delete [names]...
Examples
# Delete context acme
re config delete acme
# Delete multiple contexts
re config delete acme other-context
re config get-token
Print the API token for a given context or the current one if unspecified to standard output
Usage
re config get-token [name]
Examples
# Print the API token for the current context to stdout
re config get-token
# Save the API token for the current context in an environment variable
export REINFER_TOKEN=`re config get-token`
# Same, but get the API token for a specific context (acme)
export REINFER_TOKEN=`re config get-token`
re config ls
List all the available contexts in the configuration file
Usage
re config ls [OPTIONS]
Options
Option | Description |
---|---|
--tokens | Show API tokens (by default tokens are hidden) |
re config use
Set what context to use by default when running a command
Usage
re config use <name>
Options
Option | Description |
---|---|
<name> | The name of the context to make the new default |