CLI authentication

Sign in locally, supply a CI credential, and verify which identity a command will use.

The CLI uses the first available credential: the invocation's global --api-key, then LINGO_API_KEY, then the stored key or browser session in ~/.lingo/credentials.json. This matters when switching accounts: a new stored login cannot override a key already supplied by your shell.

Login #

sh
lingo login
lingo whoami

Login without a key opens browser OAuth and stores a session. The CLI refreshes sessions near expiry; log in again if refresh fails.

A successful login does not complete organization setup or satisfy every organization's SSO requirement. If linking directs you back to the web app, finish that organization's setup or SSO sign-in before retrying.

lingo login --api-key <value> validates and stores a key. In contrast, the global --api-key on another command applies only to that invocation. Both separated and --api-key=value forms are recognized. Prefer secret injection over command-line secrets, which can appear in shell history, process inspection, or diagnostics.

The CLI creates its credential directory with mode 0700 and its credentials file with mode 0600.

Whoami #

sh
lingo whoami --json

The result identifies the authentication type and available organization/localization engine context. Whoami verifies credentials online. On a connectivity failure it can return limited stored information; rejected authentication does not establish a valid identity.

Check this identity before linking a checkout. A saved resource ID selects what to use; it does not grant the credential permission to use it.

Logout #

sh
lingo logout

Logout removes persisted credentials. An environment key or invocation flag can still authenticate subsequent commands. Remove the shell override when you intend to stop using it. Logout does not revoke a key, delete resources, or unlink the project.

CI #

Supply LINGO_API_KEY through the runner's secret mechanism, and commit only non-secret project configuration. Run the CLI from the intended project root. Do not copy a developer's home session into CI.

Native GitHub integration has its own authority and run approval, separate from a self-managed CLI runner.