--stdin when an agent provides the key or when you want to pipe it yourself; otherwise the command prompts for the key on a TTY.
default profile; any other profiles already present in the file are preserved.
Flags
| Flag | Description |
|---|---|
--stdin | Read the API key from standard input as a single line. Useful for agents and for keeping the key out of shell history. |
Output
| Field | Type | Description |
|---|---|---|
ok | true | Always true on success. |
configPath | string | Absolute path to the config file that was written (0600). |
Errors
| Code | Exit | Notes |
|---|---|---|
tty_required | 2 | Ran without --stdin in a non-interactive environment. Pipe the key on stdin instead. |
validation_error | 2 | Input was empty after trimming. |
auth_invalid | 3 | Clay rejected the key during the pre-write probe. Nothing was written. |
aborted | 1 | Interactive prompt was cancelled (Ctrl-C, Esc). |

