-
Notifications
You must be signed in to change notification settings - Fork 7
fix(#298): add README to bundled notion-cli plugin #376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,104 @@ | ||
| # Notion CLI Plugin Harness | ||
|
|
||
| This plugin integrates [4ier/notion-cli](https://github.com/4ier/notion-cli) into dcli. It wraps the most agent-friendly Notion commands and provides a full namespace passthrough for the upstream CLI. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| A Notion integration token is required. Create one at https://www.notion.so/profile/integrations and authenticate: | ||
|
|
||
| ```bash | ||
| echo "ntn_xxxxx" | notion auth login --with-token | ||
| # or | ||
| export NOTION_TOKEN=ntn_xxxxx | ||
| ``` | ||
|
|
||
| Verify the binary is available: | ||
|
|
||
| ```bash | ||
| notion --version | ||
| ``` | ||
|
|
||
| ## Installation | ||
|
|
||
| `go install` builds a binary named `notion-cli`. Symlink or rename it to `notion`: | ||
|
|
||
| ```bash | ||
| go install github.com/4ier/notion-cli@latest | ||
| GOBIN=$(go env GOBIN); GOPATH=$(go env GOPATH); ln -sf "${GOBIN:-$GOPATH/bin}/notion-cli" "${GOBIN:-$GOPATH/bin}/notion" | ||
| ``` | ||
|
|
||
| Other install methods include Homebrew (`brew install 4ier/tap/notion-cli`), npm (`npm install -g @4ier/notion-cli`), GitHub Releases, or Scoop on Windows. | ||
|
|
||
| ## Available Commands | ||
|
|
||
| ### Version | ||
|
|
||
| ```bash | ||
| dcli notion self version --json | ||
| ``` | ||
|
|
||
| ### Auth | ||
|
|
||
| ```bash | ||
| dcli notion auth status --json | ||
| ``` | ||
|
|
||
| ### Search | ||
|
|
||
| ```bash | ||
| dcli notion search run "meeting notes" --json | ||
| ``` | ||
|
|
||
| ### Pages | ||
|
|
||
| ```bash | ||
| dcli notion page list --json | ||
| dcli notion page view <pageId> --json | ||
| dcli notion page create <dbId> --db "Name=Task" --db "Status=Todo" --json | ||
| ``` | ||
|
|
||
| ### Databases | ||
|
|
||
| ```bash | ||
| dcli notion db list --json | ||
| dcli notion db query <dbId> --filter "Status=Done" --sort "Date:desc" --json | ||
| ``` | ||
|
|
||
| ### Blocks | ||
|
|
||
| ```bash | ||
| dcli notion block list <pageId> --md --depth 3 --json | ||
| dcli notion block append <pageId> --file document.md --json | ||
| ``` | ||
|
|
||
| ### Users | ||
|
|
||
| ```bash | ||
| dcli notion user list --json | ||
| ``` | ||
|
|
||
| ### Raw API Requests | ||
|
|
||
| ```bash | ||
| dcli notion api request GET /v1/users/me --json | ||
| ``` | ||
|
|
||
| ### Full Passthrough | ||
|
|
||
| Run any upstream notion command through the `notion` namespace: | ||
|
|
||
| ```bash | ||
| dcli notion _ _ -- --help | ||
| ``` | ||
|
|
||
| ## Output | ||
|
|
||
| Wrapped commands return a dcli JSON envelope when `--json` is used. The upstream CLI auto-detects JSON output when piped. | ||
|
|
||
| ## Key Features | ||
|
|
||
| - Full Notion API coverage in a single binary | ||
| - JSON output when piped, colored tables in terminal | ||
| - Schema-aware database queries with human-friendly filters | ||
| - Markdown I/O for reading and writing page content | ||
| - URL or ID support for pages and databases | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: javimosch/supercli
Length of output: 317
🏁 Script executed:
Repository: javimosch/supercli
Length of output: 992
🏁 Script executed:
Repository: javimosch/supercli
Length of output: 317
🌐 Web query:
github 4ier notion-cli README page create --db properties syntax💡 Result:
For the notion-cli developed by 4ier (available at github.com/4ier/notion-cli), page creation in a database involves two primary methods for handling properties: the standard Notion API JSON format and a simplified key-value syntax [1][2][3]. Standard API Syntax To create a page with full control over the Notion API structure, you pass a JSON object to the --properties flag [4]. This requires following the official Notion API schema, where each property is explicitly defined by its type [4]: notion page create --properties '{"Name": {"title": [{"text": {"content": "New Page"}}]}, "Status": {"select": {"name": "Done"}}}' Simplified Property Syntax The tool supports a simplified property mode using the -S or --simple-properties flag [5][6]. This mode allows you to pass a flat JSON object, which the CLI maps to the database schema automatically, significantly reducing the complexity of the command [5][6]. Usage with simple properties: notion page create -S --properties '{"Name": "Task Title", "Status": "Done", "Priority": 5}' [2][6] Key advantages of simple properties: - Flat Structure: Uses straightforward key-value pairs (e.g., string, number, boolean) instead of nested API objects [5][6]. - Type Detection: The CLI fetches the database schema to automatically validate and map property types [3][5]. - AI-Friendly: This format is designed for programmatic access and AI agents, minimizing errors associated with the verbose standard API structure [5][6]. For additional context, you can use the notion db schema command to inspect the available property names and types in your target database before creating pages [5][4].
Citations:
🏁 Script executed:
Repository: javimosch/supercli
Length of output: 50376
🏁 Script executed:
Repository: javimosch/supercli
Length of output: 50376
🌐 Web query:
github.com/4ier/notion-cli page create --db command💡 Result:
In the 4ier/notion-cli package, the command to create a page within a database is executed using the notion page create command followed by the database ID and the --db flag [1][2]. The syntax is: notion page create --db "PropertyName=Value" "PropertyName2=Value2" For example, to create a row in a database with specific property values: notion page create --db "Name=Sprint Review" "Date=2026-03-01" "Points=8" "Done=true" Key details: - The is the unique identifier of the target database [1][3]. - The --db flag is used specifically for database page creation, allowing you to define property values in a key=value format [1][4]. - This CLI tool automatically handles schema awareness, detecting property types based on the target database schema [5]. Be sure to distinguish this tool from others with similar names (e.g., notion-cli by henryreith or FroeMic), as their command syntax differs [6][7][8]. The 4ier/notion-cli documentation consistently specifies the command structure above [1][2][9].
Citations:
Use one
--dboption for multiple properties.Line 57 repeats
--db, but thenotion page createsyntax accepts one--dbfollowed by additionalName=Valuevalues.Proposed correction
📝 Committable suggestion
🤖 Prompt for AI Agents