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.tomlEnvironment variables
| Variable | Meaning |
|---|---|
AGENTSPACES_PROFILE | Profile to use. |
AGENTSPACES_URL | Portal URL (default https://app.agent-spaces.eu). |
AGENTSPACES_API_KEY | API key. Overrides the profile’s key, also with --profile; no config file is needed. |
AGENTSPACES_ORG | Organization slug. |
AGENTSPACES_PROJECT | Project slug. |
AGENTSPACES_SSH | The ssh binary space ssh runs (default: ssh from PATH). |
AGENTSPACES_CONFIG_DIR | Directory for the config file, known_hosts and ssh_config. |
XDG_CONFIG_HOME | Base directory for the config when AGENTSPACES_CONFIG_DIR is unset (default ~/.config). |
AGENTSPACES_CACHE_DIR | Directory for what the CLI keeps for a while: the git credential of space git-credential. |
XDG_CACHE_HOME | Base 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:
| Value | Order |
|---|---|
| Portal URL | --url, AGENTSPACES_URL, the profile’s url, https://app.agent-spaces.eu |
| API key | AGENTSPACES_API_KEY, the profile’s api_key (there is no flag) |
| Organization | see below |
| Project | see 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:
--org(-o)AGENTSPACES_ORG- the
orgof the nearest.spacefile - the profile’s
org - 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:
--project(-p)AGENTSPACES_PROJECT- the
projectof the nearest.spacefile - the profile’s
project(space use) - 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
| Path | Written by | Contents |
|---|---|---|
~/.config/agentspaces/known_hosts | space ssh, space ssh-config | Machine host keys from the portal. |
~/.config/agentspaces/ssh_config | space ssh-config --write | Host blocks for your machines. |
~/.config/agentspaces/ssh_identity.pub | space ssh | The agent key it offers (which key). |
~/.cache/agentspaces/git-<profile>-<host>.json | space git-credential | Your 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 forlocalhost,127.0.0.1and::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.