Browser-approval login#
stly auth login- stly opens
https://app.structly.io/cli-loginin your browser and shows a one-time code in the terminal. - Log in to the Web UI in the browser and check that the code on the CLI 로그인 승인 (Approve CLI login) screen matches the code in the terminal.
- Select CLI 로그인 승인. The terminal finishes logging in and prints the result as JSON.
The code expires after 10 minutes. Approve only codes from a stly auth login you ran yourself, and select 거부 (Deny) for codes someone else sent you.
| Option | Use |
|---|---|
--no-browser | Shows only the URL and code without opening a browser. Use it to approve from a browser on another device. |
--force | Requests a new approval even if the saved login is still valid. |
If you already have a valid login, stly auth login reuses it without asking for approval.
Select an Organization#
If you have only one verified Organization, it is selected automatically when you log in. The next_steps in the result show the current Organization.
If you have several, select one yourself.
stly org list
stly org select 7f9X9MPpr5HIf you run a Catalog command without selecting one, the hints in the HTTP 409 ORGANIZATION_REQUIRED error show the commands to run.
Check authentication status#
stly auth status{"status":200,"etag":null,"location":null,"data":{"auth_mode":"user","authenticated":true,"credential_present":true,"credential_source":"global_session","origin":"https://api.structly.io"}}authenticated is true when the server has confirmed your login, and false when there is no login.
When an Agent token is used, stly does not check with the server, so it is null. credential_source (environment or env_file) shows where the token was read from.
Where logins are stored#
Logins are stored per server address in a user-wide store, so you do not need to log in again when you change directories.
| OS | Location |
|---|---|
| macOS | ~/Library/Application Support/stly/sessions/ |
| Linux | $XDG_CONFIG_HOME/stly/sessions/ or ~/.config/stly/sessions/ |
The file stores your login in plain text and is created with owner-only permissions (0600).
Your login remains valid for 30 days after the last authenticated command that contacts the server.
Each authenticated command, including auth status, extends the expiry by another 30 days. After you
log out or the server revokes the session, run stly auth login to sign in again.
stly auth logoutServer address#
The default server is https://api.structly.io. To use another server, set it with the --server option or the STRUCTLY_API_URL environment variable.
You can also put STRUCTLY_API_URL=… in .env.local in the directory where you run stly.
Agent tokens#
If the STRUCTLY_AGENT_TOKEN environment variable is set, stly uses the Agent token before your saved User login.
An Agent token is fixed to one Organization, so when a token is set, requests go to that Organization regardless of stly org select.
| Option | Behavior |
|---|---|
| Not specified | Uses the token if present, otherwise your User login |
--auth-mode user | Uses your User login even if a token is set |
--auth-mode agent | Uses only the token. Ends with an error if there is no token |
User-only commands such as stly org list, stly org select, and stly user get fail when a token is set.
Unset the token or add --auth-mode user.
In CI, pass the token as a secret environment variable and specify --auth-mode agent so that no User login is used.