login / logout / whoami
Authenticate with Solwyn, clear stored credentials, and inspect the current identity
Solwyn authenticates one of two ways: a project API key for a single project, or an email/password login that stores a short-lived JWT for account-wide work. Keys and passwords are never accepted as command-line arguments or echoed — the CLI reads them only from a hidden prompt or from stdin, and stores them in your OS keychain.
For how credentials are resolved at call time — flag, environment, keychain, and which one wins — see Authentication.
login
Authenticate and store the credential. With no flag, login runs an interactive email/password exchange and stores the resulting JWT. With --with-key, it reads and stores a single project key.
solwyn login [--with-key]| Option | Type | Default | Purpose |
|---|---|---|---|
--with-key | boolean | false | Read and store a project API key from a hidden prompt or stdin instead of logging in with email and password. |
| Contract | |
|---|---|
| Auth | none |
| Exit codes | 0 success · 1 generic/API · 2 usage · 3 auth or credential storage |
| JSON schema | solwyn.login.v1 |
A project key is validated structurally — sk_proj_ followed by 64 hexadecimal characters — before it is stored. An invalid value never appears in an error message or a log.
Email/password login requires an interactive terminal; in a non-interactive shell, use a project key instead.
Never pass a key or password as an argument. solwyn login --with-key reads the key from a hidden prompt, or from stdin when input is piped — nothing lands in your shell history or the process table.
Examples
Interactive email/password login:
$ solwyn login
Email: alice@example.com
Password:
Authentication Status
jwt authenticatedStore a project key from a hidden prompt:
$ solwyn login --with-key
Project key:
Authentication Status
project_key authenticatedPipe a project key from a secret store, for CI:
$ solwyn login --with-key < project.key
Authentication Status
project_key authenticatedlogout
Clear every stored Solwyn credential — the project key and both JWT tokens — from the OS keychain. The SOLWYN_API_KEY environment variable is not touched; unset it separately if it is set.
$ solwyn logout
Credentials Status
all cleared| Contract | |
|---|---|
| Auth | local (none) |
| Exit codes | 0 success · 2 usage · 3 credential storage |
| JSON schema | solwyn.logout.v1 |
whoami
Show the active identity and project context. With a project key, whoami reports the credential source and configured project — never the key material. With a JWT, it fetches your account and lists the projects you can reach.
$ solwyn whoami
Field Value
Authentication project_key
Source environment
Configured project proj_abc12345With a JWT credential:
$ solwyn whoami
Field Value
Authentication jwt
Source keyring
User Alice Example
Email alice@example.com
Tier founder
Project proj_abc12345 (my-agent)
Project proj_def67890 (staging-bot)| Contract | |
|---|---|
| Auth | any |
| Exit codes | 0 success · 1 generic/API · 2 usage · 3 auth |
| JSON schema | solwyn.whoami.v1 |
Related
- Authentication — credential sources, storage, and resolution order
keys— rotate or revoke a leaked project keyprojects— create a project and capture its first key- SDK quickstart — use a project key from the Python SDK