Notion API validation requires table_row blocks inside table.children
(not at block top-level). Fixes 'table.children should be defined' error.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
After profile-based login, cfg.Token is empty because MigrateToProfiles
clears it. doctor was only checking the legacy top-level token field,
causing it to always report 'no token found' even after a successful login.
Fixes#5
- Add profiles support to config structure
- Add auth switch command for interactive/direct profile switching
- Update auth login to support --profile flag
- Update auth status to show current profile
- Update getToken() to use profile system
- Backward compatible: auto-migrates legacy single-token config
- Add comprehensive tests for profile functionality
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- GET parent comment to find discussion_id
- POST new comment with discussion_id to same thread
- Shows discussion ID in output for reference
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Query all rows with pagination support
- Support --format csv (default), json, md
- Support --output to write to file (default: stdout)
- CSV: headers from property names, rows from property values
- JSON: array of objects with property values
- MD: markdown table format
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Supports --after to position after a specific block
- Supports --before to position before a specific block
- Supports --parent to move to a different parent block/page
- Uses PATCH /v1/blocks/{id} with parent and after fields
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Downloads page blocks as Markdown
- Opens in $EDITOR (or $VISUAL, fallback to vi)
- Parses edited Markdown back to Notion blocks
- Updates page by deleting old blocks and appending new ones
- Supports --editor flag to override default editor
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- config_test: use t.Setenv for reliable env isolation on CI
- config_test: skip permission test on Windows
- test.yml: align Go matrix with go.mod (1.24)
- goreleaser: fix deprecated formats/homebrew_casks fields
- block: improve --format md rendering with proper indentation
- block: add more markdown parse test cases
- page: minor improvements
- Add --filter-json for raw Notion API filter JSON (OR/nested queries)
- Add --all pagination to db query (all list commands now support --all/--cursor)
- Add semantic error hints with actionable suggestions for 10 API error codes
- Add page create --db for database parent (schema-aware property detection)
- Add block list --depth N for recursive nested block fetching
- Add block list --md for Markdown output rendering
- Add Markdown-to-blocks parser for --file (h1-h3/bullet/numbered/todo/quote/code/divider)
- Add comment get command
- Move todo parsing before bullet to prevent --[ ] matching as bullet
- Add 24 new tests (block markdown parsing + error hints)
Total: 4,310 lines Go, 1,056 lines tests, 124 test cases, 9.6MB binary
New commands:
- block insert: positional insertion with --after <block-id>
- block append --file: read content from markdown files
- block delete: now supports multiple IDs in one call
- page restore: unarchive pages (reverse of delete)
- page link/unlink: manage relation properties between pages
- db add-bulk: bulk create rows from JSON file with progress
- auth doctor: health check (config, token, workspace, API)
All following our design: human-friendly syntax, dual output,
schema-aware operations. No raw JSON required from users.
3,878 lines of Go. 38 subcommands. Single binary.