Sign in and profiles
Save a key once, keep one for each workspace, and switch between them.
Sign in
opensend login opens the dashboard in your browser. You choose the workspace and whether the command line may do everything or only send, then allow it. A key is made for it, named after this computer, and saved as the profile default. The key is on the API keys page like any other, and revoking it signs the command line out.
opensend loginopensend login --no-browseropensend login --with-token--no-browserprints the address instead of opening it. Open it in a browser on the same computer, because the answer comes back to it.--with-tokentakes a key you made yourself: it asks for it without showing it, or reads it from standard input.
In a script or a CI job, pipe the key in:
printf '%s' "$OPENSEND_API_KEY" | opensend login --with-tokenA server of your own
Give the address of its API with --api-url. The profile keeps it, so every command with that profile goes there.
opensend login --api-url https://mail.example.comProfiles
A profile is a key, the address of its API and the name of its workspace. --profile names the one login saves, and the one saved last is the one commands use.
opensend login --profile stagingopensend profile listopensend profile use defaultopensend domains list --profile stagingprofile listshows them all and marks the active one.profile usemakes another one active.--profileon any command uses that profile for that command only.
Which key a command uses
- The profile
--profilenames, when the command has it. OPENSEND_API_KEY, withOPENSEND_API_URLwhen it is set.- The active profile.
So a CI job sets the two variables and never depends on what a machine has saved.
Where it is kept
Profiles are saved in ~/.config/opensend/config.json, or under $XDG_CONFIG_HOME when that is set. The file is replaced whole on each change, and only you can read it.
Check it
opensend whoamiIt prints the profile, where the key came from, the address of the API and the workspace the key belongs to.
Sign out
opensend logoutopensend logout --profile stagingopensend logout --all