Skip to content

v6.1.0 - OAuth Authentication

Choose a tag to compare

@jakeschepis jakeschepis released this 02 Mar 08:18
· 52 commits to main since this release

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 automatically
  • notion-cli auth logout — Clears stored OAuth tokens
  • notion-cli auth status — Shows current auth method and workspace info

Token Precedence

  1. NOTION_TOKEN env var (CI/automation)
  2. OAuth token from config (interactive login)
  3. Manual token from config file (fallback)

Other Improvements

  • doctor command now shows authentication method (oauth/env/token/none) with workspace name
  • Updated error messages to suggest auth login as 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/oauth package (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.