Skip to content
Configuration

Configuration

Config file

space login writes ~/.config/agentspaces/config.toml, on macOS too. The directory is $AGENTSPACES_CONFIG_DIR if set, else $XDG_CONFIG_HOME/agentspaces. You rarely need to edit it by hand.

default_profile = "default"

[profiles.default]
url = "https://app.agent-spaces.eu"
api_key = "asp_…"
org = "acme"            # default organization (optional)
project = "web"         # default project (optional; space use acme/web)

[profiles.staging]
url = "https://staging.example.eu"
api_key = "asp_…"

The file holds API keys, so it must be readable only by you: the CLI writes the directory with mode 0700 and the file with 0600. It refuses to read a config file that other users have any access to (group or other bits set), and says how to fix it:

chmod 700 ~/.config/agentspaces
chmod 600 ~/.config/agentspaces/config.toml

Environment variables

VariableMeaning
AGENTSPACES_PROFILEProfile to use.
AGENTSPACES_URLPortal URL (default https://app.agent-spaces.eu).
AGENTSPACES_API_KEYAPI key. Overrides the profile’s key, also with --profile; no config file is needed.
AGENTSPACES_ORGOrganization slug.
AGENTSPACES_PROJECTProject slug.
AGENTSPACES_SSHThe ssh binary space ssh runs (default: ssh from PATH).
AGENTSPACES_CONFIG_DIRDirectory for the config file, known_hosts and ssh_config.
XDG_CONFIG_HOMEBase directory for the config when AGENTSPACES_CONFIG_DIR is unset (default ~/.config).
AGENTSPACES_CACHE_DIRDirectory for what the CLI keeps for a while: the git credential of space git-credential.
XDG_CACHE_HOMEBase directory for it when AGENTSPACES_CACHE_DIR is unset (default ~/.cache).

Precedence

The profile is --profile, else AGENTSPACES_PROFILE, else the config file’s default_profile, else default. Values come from the first of:

ValueOrder
Portal URL--url, AGENTSPACES_URL, the profile’s url, https://app.agent-spaces.eu
API keyAGENTSPACES_API_KEY, the profile’s api_key (there is no flag)
Organizationsee below
Projectsee below

A value missing from the selected profile is not taken from another profile.

Choosing the organization

Commands that act on machines and checkpoints need an organization. The CLI takes the first of:

  1. --org (-o)
  2. AGENTSPACES_ORG
  3. the org of the nearest .space file
  4. the profile’s org
  5. the only organization the key can see.

If the key sees several organizations and none is chosen, the command exits with code 2 and lists them.

Choosing the project

An API key reaches all projects of its organization or selected ones. A command works in one, the first of:

  1. --project (-p)
  2. AGENTSPACES_PROJECT
  3. the project of the nearest .space file
  4. the profile’s project (space use)
  5. the only project the key reaches.

If the key reaches several projects and none is chosen, the command exits with the portal’s error, which lists them. space projects lists them too.

.space files

A .space file in a directory names the organization and project for commands run there and in the directories below it, so a checkout of a project’s code works in that project. The nearest one wins; either line may be left out.

org = "acme"
project = "web"

The file holds no key. Other keys in it are an error.

Other files

PathWritten byContents
~/.config/agentspaces/known_hostsspace ssh, space ssh-configMachine host keys from the portal.
~/.config/agentspaces/ssh_configspace ssh-config --writeHost blocks for your machines.
~/.config/agentspaces/ssh_identity.pubspace sshThe agent key it offers (which key).
~/.cache/agentspaces/git-<profile>-<host>.jsonspace git-credentialYour org’s git credential, for at most an hour, one per profile (details). Mode 0600.

Security

  • The CLI only talks to the portal over HTTPS (plain http:// only for localhost, 127.0.0.1 and ::1), and never skips certificate checks.
  • It does not follow redirects, so your key is never sent to another host.
  • It never prints your API key, also not in errors.
Last updated on