v6.1.0 - OAuth Authentication
What's New
OAuth Authentication — Log in to Notion from the CLI without managing API tokens manually.
notion-cli auth login— Opens your browser, you authorize, and the token is saved automaticallynotion-cli auth logout— Clears stored OAuth tokensnotion-cli auth status— Shows current auth method and workspace info
Token Precedence
NOTION_TOKENenv var (CI/automation)- OAuth token from config (interactive login)
- Manual token from config file (fallback)
Other Improvements
doctorcommand now shows authentication method (oauth/env/token/none) with workspace name- Updated error messages to suggest
auth loginas the primary setup path - 6 new OAuth-specific error codes with actionable suggestions
- Build-time OAuth credential injection via Makefile ldflags
Technical Details
- New
internal/oauthpackage (stdlib only —net/http,crypto/rand) - CSRF protection via cryptographic state parameter
- Config file permissions remain 0600
- 14 new tests, 196 total passing
See CHANGELOG.md for full details.