Skip to content

feat: accept URL, name, or ID for all page commands#7

Merged
lox merged 3 commits intomainfrom
consistent-page-refs
Feb 9, 2026
Merged

feat: accept URL, name, or ID for all page commands#7
lox merged 3 commits intomainfrom
consistent-page-refs

Conversation

@lox
Copy link
Copy Markdown
Owner

@lox lox commented Feb 9, 2026

All page commands now consistently accept any of:

  • Notion URL (https://notion.so/...)
  • Page ID (UUID with or without hyphens)
  • Page name (exact match, errors on ambiguity)

Changes

  • New internal/cli/resolve.go: ParsePageRef classifies input, ResolvePageID resolves to a page ID
  • Robust UUID extraction: accepts 32 hex digits (with/without hyphens, uppercase), normalises to canonical UUID format
  • Ambiguous name handling: exact match required; errors list matching candidates with URLs
  • page view / page edit: now accept names (URLs/IDs passed through to MCP server as before)
  • page create --parent: now accepts URL or name (previously ID-only)
  • page upload --parent: now accepts URL (previously name/ID only)
  • Help text: updated to say "Page URL, name, or ID" consistently
  • Skill: updated to document the unified reference format

Testing

go test ./internal/cli/...

Tests cover ParsePageRef, LooksLikeID, and extractNotionUUID with URLs, IDs, names, and edge cases.

lox added 2 commits February 10, 2026 09:40
All page commands now consistently accept any of:
- Notion URL (https://notion.so/...)
- Page ID (UUID with or without hyphens)
- Page name (exact match, errors on ambiguity)

Extracted page reference resolution into internal/cli/resolve.go with:
- ParsePageRef: classifies input as URL, ID, or name
- ResolvePageID: resolves any reference to a page ID
- Robust UUID extraction (32 hex digits, normalised to 8-4-4-4-12)
- Ambiguous name detection with candidate listing

Removed old looksLikeID and resolvePageByName from cmd/page.go.

Amp-Thread-ID: https://ampcode.com/threads/T-019c4484-b1d8-7284-b9e7-66f9b5939872
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6723392b9b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

- Check URL prefix before extracting UUID, so page names containing
  32-char hex substrings are not misclassified as IDs
- Apply De Morgan's law in isAllHex (staticcheck QF1001)
- Use tagged switch in page edit (staticcheck QF1003)

Amp-Thread-ID: https://ampcode.com/threads/T-019c4484-b1d8-7284-b9e7-66f9b5939872
@lox lox merged commit 3bd2467 into main Feb 9, 2026
1 check passed
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