Authentication
Authentication
outline-cli supports three authentication methods. Choose based on your use case.
API Token (Recommended for CI/CD)
The simplest method. Get a token from Settings → API in Outline.
export OUTLINE_API_TOKEN=sk-your-token
export OUTLINE_SERVER_URL=https://outline.example.com
outline push --path ./docs/ --collection-id "Engineering"OIDC Browser Login (Recommended for developers)
Interactive browser login using OAuth2 with PKCE. No token management needed — the CLI handles everything.
outline config set server_url https://outline.example.com
outline auth oidc-loginThis will:
- Discover your Outline instance’s OAuth2 configuration
- Register a public OAuth2 client (Dynamic Client Registration)
- Open your browser for authentication
- Store the access token in your OS keyring
After login, all commands work without additional flags.
Basic Auth
export OUTLINE_USERNAME=user@example.com
export OUTLINE_PASSWORD=secret
export OUTLINE_SERVER_URL=https://outline.example.com
outline push --path ./docs/ --collection-id "Docs"Credential Resolution Order
When multiple credentials are available, this priority applies (highest wins):
- CLI flags (
--api-token,--username/--password,--oidc-access-token) - Environment variables (
OUTLINE_API_TOKEN,OUTLINE_SERVER_URL) - OS keyring (set via
config setorauth oidc-login) - Config file (
~/.outline-cli/config.yaml)
Auto-Reauthentication
If your token expires during a push, the CLI automatically re-authenticates using your configured method:
outline config set auth_method oidc # default — triggers browser login
outline config set auth_method api-token # requires valid token in env/keyringVerify Credentials
outline auth checkOutput:
✓ Authenticated as jane@example.com (Engineering team)Security
- All persisted credentials are stored in the OS keyring (libsecret on Linux, Keychain on macOS, Credential Manager on Windows)
- Config file is written with
0600permissions - If keyring is unavailable (headless/container), falls back to config file with a warning
- Secrets are never logged;
config listmasks them as***