login, logout, whoami, profiles
space login
space login [--url <url>] [--profile <name>] [--stdin]Reads an API key, checks it with the portal (GET /me), and saves the URL and key in the
profile (the current profile, default on a fresh
install). The URL is --url, or https://app.agent-spaces.eu. If the profile has no
organization yet and the key can see exactly one, that one is saved as its default. The
first profile you log in to becomes the default profile. Prints the portal, your email and
the key’s name, prefix, permission and the projects it reaches.
The key is read from the terminal without echo, or from stdin when stdin is not a terminal
or --stdin is given. It is never accepted as an argument, and must start with asp_.
space login
pass show agentspaces | space login --profile ci
space login --url https://<portal host> --profile stagingspace logout
space logout [--profile <name>]Removes the key from the profile (the URL and organization stay). The key stays valid until you revoke it in the portal (Account → API keys). Exits with code 2 if the profile has no key.
space whoami
space whoamiShows the user, the key in use (name, prefix, its organization, the projects it reaches or “all projects”, permission, expiry), the project commands work in, the profile, and the organization: slug, name, your role, region and SSH endpoint. A command works in one project (which one): the CLI sees that project’s machines and checkpoints only, and new machines go there.
space projects
space projects [list]The projects of the organization that the key reaches: slug and name, the one in use marked
with *. With -q, only the slugs.
space projectsspace use
space use [<org>/]<project>
space use --unsetMakes the project (and with <org>/, the organization) the profile’s default, once the
portal confirms the key reaches it. Without an argument, shows the organization and project
in use and where each comes from. --unset forgets the profile’s project.
A command works in the project named by, first to last: --project (-p) or
AGENTSPACES_PROJECT; the nearest .space file in the working directory or above it
(TOML: org = "acme", project = "web"); the profile’s default; else the key’s only
project. With none of these and a key that reaches several projects, the command exits
with the list.
space use acme/web
space use
space use --unsetspace profiles
space profiles
space profiles use <name>Lists the profiles in the config file (name, URL, organization, project and the key’s prefix) and
marks the default with *; use makes another profile the default.