Skip to content

Logging in

aegis login connects the aegis command to your organisation. You need the address and the API key your administrator gave you.

aegis login

It asks three things:

  1. The address, such as https://acme.aegis.krathos.systems. You can leave off https://.
  2. Where to keep your API key. Press Enter for the default, ~/.config/aegis/api_key. This is asking for a file location. The key comes next.
  3. Your API key. Nothing appears on screen as you paste it.

If the address is wrong or the key isn't accepted, nothing is saved and the message says what happened. See Troubleshooting.

Then aegis login lists the files in your home folder that Aegis would manage, such as ~/.claude/CLAUDE.md, and asks you to type yes, manage this machine. Press Enter to skip; you can agree later with aegis manage. See Letting Aegis manage your machine.

Using a new API key

If you already have a key saved, aegis login uses it and doesn't ask for a new one. To switch to a new key, for example after your administrator rotated it, run:

aegis login --server https://acme.aegis.krathos.systems --key-stdin

Paste the new key, press Enter, then press Ctrl+D (on Windows, Ctrl+Z then Enter). Aegis checks the key and saves it in place of the old one. If the new key isn't accepted, the old one is kept.

Logging in from a script

To log in without questions, give the address with --server and the key in the AEGIS_KEY environment variable:

AEGIS_KEY=<your key> aegis login --server https://acme.aegis.krathos.systems

or on standard input with --key-stdin:

aegis login --server https://acme.aegis.krathos.systems --key-stdin < key.txt

There's no option that takes the key itself on the command line, because other people on the same computer can see command lines.

Logging in like this doesn't write any rules. Run aegis manage afterwards.

What it saves

File Holds
~/.config/aegis.json The address, and where your key is kept
~/.config/aegis/api_key Your API key, readable only by you

Files the CLI writes lists everything else.

Next

Run aegis init in a repository to get its rules.