CLI
Auth
Sign in to the LearnOS CLI with browser OAuth or a personal access token.
The CLI authenticates as you so every command runs under the same row-level security as the web app.
Recommended: learnos login
pnpm learnos -- login
# or, once published: learnos loginThis opens a browser, runs OAuth 2.1 + PKCE against Supabase Auth, and stores
access + refresh tokens in ~/.config/learnos/credentials.json (mode 0600).
learnos whoami
learnos logoutOne-time project setup
- In the Supabase dashboard: Authentication → OAuth Server — enable OAuth
2.1, set Authorization Path to
/oauth/consent, and allow dynamic client registration for MCP clients. - Register the public CLI client (needs
SUPABASE_SECRET_KEY):
pnpm learnos -- oauth register-cli- Put the printed
client_idin.env.local:
LEARNOS_OAUTH_CLIENT_ID=<client_id>The CLI callback listens on http://127.0.0.1:19876/callback.
Fallback: personal access token
export LEARNOS_TOKEN=los_...Issue a token from Settings → Personal access tokens. Useful for CI.
Resolution order
LEARNOS_TOKENenvironment variable- Stored OAuth credentials from
learnos login - Bootstrap user (local-dev only; refuse with
LEARNOS_REQUIRE_TOKEN=1)