Pular para o conteúdo principal
informação
Esta página ainda não foi traduzida. Você está lendo a versão em English.

Global Config (~/.envshed/config.json)

The global config stores user-level settings. The authentication token goes to the OS keychain when there is one, and to this file otherwise.

Location​

~/.envshed/config.json (in your home directory).

Format​

json
{
"apiUrl": "https://app.envshed.com",
"locale": "es"
}
FieldDescription
tokenAPI token, only where no keychain is available
apiUrlDefault API URL (overrides the built-in default)
localeDisplay language for CLI output (e.g., en, es)

How it's created​

  • envshed login saves the token after successful device authorization
  • envshed login --token-stdin and envshed token set --token-stdin save a token you already have
  • envshed token clear removes the token from the keychain and from this file

Where the token is stored​

PlatformStoreTool
macOSKeychainsecurity
LinuxSecret Service (GNOME Keyring, KWallet)secret-tool, from libsecret-tools
Anything else, or the tool is missing or locked~/.envshed/config.json, mode 0600none

Migration. The first time the CLI needs your token and finds one in config.json, it copies it to the keychain, reads it back to confirm, and only then removes it from the file. If the keychain is not available, the file stays as it is and the CLI tries again on a later run.

Fallback. On CI (CI is set) the CLI does not touch the keychain. Set ENVSHED_KEYCHAIN=off to get the same behavior anywhere. For CI and containers, ENVSHED_TOKEN is usually the better choice, and it always takes precedence.

The CLI never passes the token to these tools as an argument, so it does not show up in ps.

Agent sessions keep their tokens in the same keychain. Their details, and their tokens where there is no keychain, are in ~/.envshed/sessions.json (mode 0600). See envshed agent session.

Security​

The token grants full access to your Envshed account. Never commit this file to version control. It is stored in your home directory and is not project-specific.

A keychain keeps the token away from anything that just reads files, such as an agent opening config.json. It does not stop a process running as you that deliberately asks for it: on macOS, security find-generic-password returns an item created by security without a prompt. To limit what an agent can do, use an agent session, whose limits are enforced by the server.

Personal environment selections​

~/.envshed/contexts.json stores environment selections separately from credentials. Entries are indexed by a hash of the canonical checkout path, workspace, API destination and organization/project binding. Each value is an environment slug. The owner-only file is atomically updated under a lock. If a command crashes while holding contexts.json.lock, verify no selection update is running before removing that lock. Invalid JSON is reported and preserved. Moving a checkout or changing its binding results in fallback to the next configured source.