Skip to content

feat(page): add page archive command#31

Open
0xble wants to merge 1 commit intolox:mainfrom
0xble:feat/page-archive-command
Open

feat(page): add page archive command#31
0xble wants to merge 1 commit intolox:mainfrom
0xble:feat/page-archive-command

Conversation

@0xble
Copy link
Copy Markdown
Collaborator

@0xble 0xble commented Apr 7, 2026

Summary

  • add page archive using the official API fallback path
  • accept page URLs and page IDs for archive targets
  • fail fast with the existing setup guidance when no official API token is configured
  • document the new command and auth requirement in the README and bundled skill
  • add focused tests for archive success, URL/ID input handling, invalid target input, and missing token behavior

Usage examples

notion-cli page archive https://www.notion.so/workspace/My-Page-12345678abcdef1234567890abcdef12  # archive by URL
notion-cli page archive 12345678-abcd-ef12-3456-7890abcdef12                                      # archive by page ID

$ notion-cli page archive https://www.notion.so/workspace/My-Page-12345678abcdef1234567890abcdef12  # no API key configured
✗ create official API client: official API token is required (run 'notion-cli auth api setup' or set NOTION_API_TOKEN)

Partial follow-up for #17.

Validation

  • go build ./...
  • go test ./...
  • golangci-lint run
  • local CLI QA against a mock official API:
    • archive by URL returns ✓ Page archived
    • archive by ID returns ✓ Page archived
    • requests hit PATCH /v1/pages/<id> with {"in_trash":true}

@0xble
Copy link
Copy Markdown
Collaborator Author

0xble commented Apr 7, 2026

Maybe worth adding unarchive / restore as follow-up, but I scoped this one to archive only

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant