Skip to content

fix(#298): expand bundled notion-cli command coverage - #378

Open
javimosch wants to merge 1 commit into
masterfrom
am/am-f17c27-dkm2q5alhgw6-a56a1e03
Open

fix(#298): expand bundled notion-cli command coverage#378
javimosch wants to merge 1 commit into
masterfrom
am/am-f17c27-dkm2q5alhgw6-a56a1e03

Conversation

@javimosch

@javimosch javimosch commented Aug 11, 2026

Copy link
Copy Markdown
Owner

Automated maintenance run by automaintainer.

Focus: == ASSIGNED OBJECTIVE ==
Fix GitHub issue #298 ONLY: Add 4ier/notion-cli as a bundled plugin in SuperCLI. PR title MUST reference #298.


OPEN PR AWARENESS (secondary — do not replace the ASSIGNED OBJECTIVE):
These open pull requests are already open and awaiting review. Do NOT start UNRELATED work on the files they touch. If your ASSIGNED OBJECTIVE requires editing one of those files, complete the objective anyway. Never abandon the objective to pick a different GitHub issue just to avoid overlap.

Branch: am/am-f17c27-dkm2q5alhgw6-a56a1e03

Diff:

plugins/notion-cli/plugin.json | 247 +++++------------------------------------
 1 file changed, 28 insertions(+), 219 deletions(-)

Summary by CodeRabbit

  • New Features

    • Expanded the Notion CLI command catalog with authentication, page, database, block, user, comment, file, raw API, and passthrough commands.
    • Added support for page archival and restoration, database creation, block management, current-user lookup, comments, and file operations.
    • Added expanded pagination and output options.
  • Improvements

    • Standardized command arguments, optional parameters, passthrough behavior, and timeout handling.
    • Improved command guidance and dependency information.

The bundled notion-cli plugin only exposed a handful of commands. Fill
out the manifest with the auth, page, db, block, user, comment, file
and api commands from 4ier/notion-cli so agents can route to the full
Notion CLI surface.

Closes #298

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The Notion CLI plugin now uses a compact executable check and an expanded command catalog. Commands define explicit arguments, optional values, timeouts, dependency guidance, and operations across Notion resources.

Changes

Notion CLI catalog

Layer / File(s) Summary
Executable check
plugins/notion-cli/plugin.json
The plugin check now uses a compact binary check for the notion executable.
Command catalog and argument schemas
plugins/notion-cli/plugin.json
The catalog adds authentication, page, database, block, user, comment, file, raw API, and passthrough commands. Existing commands now use more specific positional and optional arguments, explicit timeouts, and dependency guidance.

Estimated code review effort: 3 (Moderate) | ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: expanding bundled notion-cli command coverage.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch am/am-f17c27-dkm2q5alhgw6-a56a1e03

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (2)
plugins/notion-cli/plugin.json (2)

46-46: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Add timeout_ms to the passthrough command.

Every other command sets adapterConfig.timeout_ms. The passthrough entry omits it. If the adapter has no default timeout, a passthrough invocation can block the caller indefinitely.

⏱️ Proposed fix
-"adapterConfig":{"command":"notion","passthrough":true,"missingDependencyHelp":"Install notion-cli: go install github.com/4ier/notion-cli@latest (the binary will be named notion-cli; symlink or rename it to notion) or brew install 4ier/tap/notion-cli. Authenticate: echo 'ntn_xxxx' | notion auth login --with-token"}
+"adapterConfig":{"command":"notion","passthrough":true,"missingDependencyHelp":"Install notion-cli: go install github.com/4ier/notion-cli@latest (the binary will be named notion-cli; symlink or rename it to notion) or brew install 4ier/tap/notion-cli. Authenticate: echo 'ntn_xxxx' | notion auth login --with-token","timeout_ms":60000}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@plugins/notion-cli/plugin.json` at line 46, Update the notion passthrough
command’s adapterConfig to include the standard timeout_ms value used by the
other commands, ensuring invocations cannot block indefinitely while preserving
its existing process and passthrough settings.

45-45: 🔒 Security & Privacy | 🔵 Trivial | 💤 Low value

Restrict the method argument to the documented HTTP verbs.

api request forwards method and path to the notion binary without constraint. The description lists GET, POST, PATCH, and DELETE. Add an enum or a validation pattern for method if the manifest schema supports it. This blocks unintended verbs before the request reaches the Notion API.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@plugins/notion-cli/plugin.json` at line 45, Restrict the request method
argument in the notion api request definition to GET, POST, PATCH, and DELETE
using the manifest’s supported enum or validation-pattern field. Update the args
entry for method while preserving its required string type and the existing api
request behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@plugins/notion-cli/plugin.json`:
- Line 20: Regenerate the plugin catalog checksums after modifying
plugins/notion-cli/plugin.json, ensuring the stored checksum derived from that
plugin’s plugin.json and meta.json is updated to match the new manifest. Locate
and run the repository’s established catalog regeneration step rather than
editing the checksum manually.
- Around line 34-35: Update the notion db command schemas: add a documented
property input to db add for trailing KEY=VALUE arguments, mark db create’s
title argument as required, and regenerate the notion-cli entry in
plugins/catalog.json so its checksum matches the updated plugin schema.

---

Nitpick comments:
In `@plugins/notion-cli/plugin.json`:
- Line 46: Update the notion passthrough command’s adapterConfig to include the
standard timeout_ms value used by the other commands, ensuring invocations
cannot block indefinitely while preserving its existing process and passthrough
settings.
- Line 45: Restrict the request method argument in the notion api request
definition to GET, POST, PATCH, and DELETE using the manifest’s supported enum
or validation-pattern field. Update the args entry for method while preserving
its required string type and the existing api request behavior.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 60f1fe85-e2bf-40af-9fc5-b166c135f631

📥 Commits

Reviewing files that changed from the base of the PR and between 981d694 and 7bec71b.

📒 Files selected for processing (1)
  • plugins/notion-cli/plugin.json

"file": "skills/quickstart/SKILL.md"
},
"learn": {"file":"skills/quickstart/SKILL.md"},
"commands": [

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Regenerate the plugin catalog checksums.

This PR changes plugins/notion-cli/plugin.json. Catalog checksums derive from each plugin's plugin.json and meta.json. Run the catalog regeneration step so the stored checksum matches the new manifest.

As per coding guidelines: "Plugin catalog checksums are derived from each plugin's plugin.json and meta.json contents; changes to those manifests require catalog regeneration."

#!/bin/bash
# Description: Find the catalog file and the stored checksum for notion-cli.
set -euo pipefail
fd -t f 'catalog' | head -50
rg -n --glob '!**/node_modules/**' -C3 'notion-cli' -g '*catalog*'
rg -n --glob '!**/node_modules/**' 'checksum|sha256' -g '*.json' -g '!plugins/**' | head -50
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@plugins/notion-cli/plugin.json` at line 20, Regenerate the plugin catalog
checksums after modifying plugins/notion-cli/plugin.json, ensuring the stored
checksum derived from that plugin’s plugin.json and meta.json is updated to
match the new manifest. Locate and run the repository’s established catalog
regeneration step rather than editing the checksum manually.

Source: Coding guidelines

Comment on lines +34 to +35
{"namespace":"notion","resource":"db","action":"add","description":"Add a new row (page) to a database","adapter":"process","adapterConfig":{"command":"notion","baseArgs":["db","add"],"missingDependencyHelp":"Install notion-cli and authenticate: echo 'ntn_xxxx' | notion auth login --with-token","timeout_ms":15000,"positionalArgs":["dbId"]},"args":[{"name":"dbId","type":"string","required":true,"description":"Database ID or URL"}]},
{"namespace":"notion","resource":"db","action":"create","description":"Create a new database under a parent page","adapter":"process","adapterConfig":{"command":"notion","baseArgs":["db","create"],"missingDependencyHelp":"Install notion-cli and authenticate: echo 'ntn_xxxx' | notion auth login --with-token","timeout_ms":15000,"positionalArgs":["parentId"]},"args":[{"name":"parentId","type":"string","required":true,"description":"Parent page ID or URL"},{"name":"title","type":"string","required":false,"description":"Database title (required)"},{"name":"props","type":"string","required":false,"description":"Additional properties as name:type,... (e.g. Status:select,Date:date)"}]},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Inspect upstream notion-cli flags for `db add` and `db create`.
set -euo pipefail
curl -sL https://raw.githubusercontent.com/4ier/notion-cli/main/README.md | rg -n -C5 'db (add|create)'

Repository: javimosch/supercli

Length of output: 156


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- available guideline tools ---'
command -v sc-zig || true
command -v yek || true

printf '%s\n' '--- SuperCLI inspect schema ---'
if command -v sc-zig >/dev/null 2>&1; then
  sc-zig --json inspect 2>&1 | head -c 12000
  printf '\n'
fi

printf '%s\n' '--- manifest serialization ---'
if command -v yek >/dev/null 2>&1; then
  yek plugins/notion-cli/plugin.json --max-tokens 12000 2>&1
else
  cat -n plugins/notion-cli/plugin.json
fi

printf '%s\n' '--- related catalog/checksum references ---'
rg -n -C 3 'checksum|catalog|plugin\.json|meta\.json|positionalArgs|timeout_ms|passthrough' \
  --glob '*.js' --glob '*.ts' --glob '*.json' --glob '*.md' . | head -c 30000 || true

printf '%s\n' '--- tracked files in plugin directory ---'
git ls-files plugins/notion-cli

printf '%s\n' '--- upstream repository metadata ---'
curl -fsSL 'https://api.github.com/repos/4ier/notion-cli' |
  jq '{full_name,default_branch,html_url}' || true

printf '%s\n' '--- upstream repository tree ---'
curl -fsSL 'https://api.github.com/repos/4ier/notion-cli/git/trees/HEAD?recursive=1' |
  jq -r '.tree[]?.path' | rg -i 'readme|db|database|command|src|package' | head -n 200 || true

Repository: javimosch/supercli

Length of output: 45263


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- catalog files and notion entry ---'
git ls-files '*catalog*' '*registry*' | head -n 100
rg -n -C 5 'notion-cli' plugins/catalog.json plugins 2>/dev/null | head -n 120 || true

printf '%s\n' '--- catalog generator ---'
if [ -f scripts/generate-catalog.js ]; then
  wc -l scripts/generate-catalog.js
  sed -n '1,260p' scripts/generate-catalog.js
fi

printf '%s\n' '--- plugin registry checksum logic ---'
sed -n '1,180p' cli/plugins-registry.js
printf '%s\n' '--- manifest/install handling ---'
sed -n '1,230p' cli/plugins-manifest.js

printf '%s\n' '--- process adapter and positional argument mapping ---'
rg -n -C 6 'positionalArgs|passthrough|baseArgs|timeout_ms|spawn' \
  cli server lib src supercli-zig-cli 2>/dev/null | head -n 300

printf '%s\n' '--- upstream raw README with user agent ---'
curl -fsSL -A 'Mozilla/5.0' \
  'https://raw.githubusercontent.com/4ier/notion-cli/main/README.md' |
  rg -n -i -C 8 'database|db[[:space:]]+(add|create)|properties|props' | head -n 240 || true

printf '%s\n' '--- upstream refs ---'
git ls-remote --heads --tags https://github.com/4ier/notion-cli.git 2>&1 |
  head -n 80 || true

Repository: javimosch/supercli

Length of output: 44335


🌐 Web query:

4ier notion-cli "db add" "db create" flags

💡 Result:

For the 4ier/notion-cli, the command structure for interacting with databases is as follows: notion db add [KEY=VALUE]... [FLAGS] The available flags for notion db add are: --data JSON|@file|-: Provide property values as a JSON string, a path to a JSON file (prefixed with @), or from standard input [1][2]. --add-options: Automatically create missing options for select or multi-select properties [1][2]. --output json|id: Set the output format to JSON or just the resulting row ID [1][2]. --no-cache: Bypass the local schema cache to fetch the latest database schema [3]. For creating a database, the command is: notion db create <title> [FLAGS] The primary flag for notion db create is: --data JSON|@file: Provide the database schema definition as a JSON object or file [2]. Note that for adding rows, property values can also be passed as positional arguments in KEY=VALUE format (e.g., Name="My Item") [1][4]. The tool is designed to work well with scripts and AI agents, and most commands output JSON to stdout by default [2][5].

Citations:


🏁 Script executed:

#!/bin/bash
set -u

printf '%s\n' '--- current catalog checksum calculation ---'
python3 - <<'PY'
from pathlib import Path
import hashlib, json
plugin = Path("plugins/notion-cli/plugin.json").read_text()
meta = Path("plugins/notion-cli/meta.json").read_text()
actual = hashlib.sha256((plugin + "\n" + meta).encode()).hexdigest()[:16]
catalog = json.loads(Path("plugins/catalog.json").read_text())
entry = next((x for x in catalog["plugins"] if x.get("name") == "notion-cli"), None)
print(json.dumps({"actual": actual, "catalog": entry}, indent=2))
PY

printf '%s\n' '--- likely command execution files ---'
git ls-files '*.js' '*.ts' '*.zig' | rg '(^|/)(run|execute|executor|command|plugin).*\.(js|ts|zig)$' | head -n 120
printf '%s\n' '--- argument mapper symbols ---'
rg -n -C 8 'positionalArgs|passthrough|baseArgs|command\.args|args\.push|adapterConfig' \
  cli server supercli-zig-cli/src 2>/dev/null | head -n 360 || true

printf '%s\n' '--- local notion README database section ---'
rg -n -i -C 12 'db add|db create|KEY=VALUE|--data|--add-options|--output|--no-cache' \
  plugins/notion-cli/README.md plugins/notion-cli/skills/quickstart/SKILL.md || true

printf '%s\n' '--- direct upstream files ---'
for path in \
  README.md \
  docs/commands.md \
  docs/agent-patterns.md \
  skills/notion-cli/SKILL.md \
  cmd/notion/main.go \
  main.go
do
  url="https://raw.githubusercontent.com/4ier/notion-cli/main/$path"
  printf '\nURL %s\n' "$url"
  curl -sS -L -A 'Mozilla/5.0' --max-time 15 -w '\nHTTP %{http_code}\n' "$url" \
    | rg -n -i -C 8 'db add|db create|KEY=VALUE|--data|--add-options|--output|--no-cache|notion db' \
    | head -n 100 || true
done

printf '%s\n' '--- upstream refs ---'
git ls-remote --heads --tags https://github.com/4ier/notion-cli.git 2>&1 | head -n 80 || true

Repository: javimosch/supercli

Length of output: 34323


🌐 Web query:

site:github.com/4ier/notion-cli "notion db add" OR "notion db create"

💡 Result:

To add items to or create databases in Notion, you can use the official Notion API or community-maintained command-line interface (CLI) tools like notion-cli. Using the Notion API: 1. To create a new database, send a POST request to the /v1/databases endpoint [1][2]. Note that following the 2025-09-03 API update, many database operations have transitioned to using /v1/data_sources endpoints [2]. 2. To add a new item (a page) to an existing database, send a POST request to the /v1/pages endpoint, specifying the database_id (or data_source_id) in the parent object [1][2]. Using the notion-cli tool: If you are using the popular 4ier/notion-cli, the following commands are available: - Create a new database: notion db create --title "Title" --props "PropName:type,..." [3][1] - Add an item to a database: notion db add "PropertyName=Value"... [3][1] Alternatively, you can create a page within a database context: notion page create --db "Name=My Item" "Status=Todo" [4][5] Recent updates to the Notion API as of September 2025 introduced the concept of data sources, where databases may have multiple views or variants. While many tools provide auto-resolution to maintain backward compatibility, you may need to target data_source_ids directly for complex setups [2]. Always refer to the specific documentation of the tool or API version you are using for the most accurate parameter syntax [2].

Citations:


🏁 Script executed:

#!/bin/bash
set -u

printf '%s\n' '--- Node process adapter files ---'
git ls-files cli | rg -i 'adapter|executor|run|execute|command' | head -n 120
printf '%s\n' '--- process adapter implementation ---'
for f in cli/adapters/process.js cli/executor.js cli/run.js cli/execute-handler.js cli/commands-handler.js; do
  if [ -f "$f" ]; then
    printf '\nFILE %s\n' "$f"
    wc -l "$f"
    rg -n -C 12 'positionalArgs|baseArgs|passthrough|unknown|required|--' "$f" | head -n 260
  fi
done

printf '%s\n' '--- manifests using positionalArgs and property-like arguments ---'
rg -l '"positionalArgs"' plugins --glob 'plugin.json' |
  head -n 120 |
  while IFS= read -r f; do
    rg -n -C 2 'positionalArgs|properties|props|data|values|items' "$f" | head -n 30
  done

printf '%s\n' '--- exact upstream skill excerpt ---'
curl -fsSL -A 'Mozilla/5.0' \
  'https://raw.githubusercontent.com/4ier/notion-cli/main/skills/notion-cli/SKILL.md' |
  sed -n '90,112p;232,242p'

printf '%s\n' '--- upstream source tree through HTML ---'
curl -fsSL -A 'Mozilla/5.0' \
  'https://github.com/4ier/notion-cli/tree/main' |
  rg -o 'href="[^"]+"' |
  sed 's/^href="//;s/"$//' |
  rg '/4ier/notion-cli/(tree|blob)/main/' |
  head -n 160 || true

Repository: javimosch/supercli

Length of output: 50374


🏁 Script executed:

#!/bin/bash
set -u

printf '%s\n' '--- execution and validation paths ---'
for f in cli/execute-handler.js cli/executor.js cli/index.js cli/main.js; do
  if [ -f "$f" ]; then
    printf '\nFILE %s\n' "$f"
    cat -n "$f" | sed -n '1,260p'
  fi
done

printf '%s\n' '--- required-argument enforcement references ---'
rg -n -C 8 'required|input_schema|validate.*arg|missing.*arg|cmd\.args|execute\(cmd' \
  cli __tests__ | head -n 320 || true

printf '%s\n' '--- positional mapping model for this manifest ---'
python3 - <<'PY'
def map_run(positional_args, declared_names):
    flags = {}
    idx = 0
    for name in declared_names:
        if idx >= len(positional_args):
            break
        if name in flags:
            continue
        flags[name] = positional_args[idx]
        idx += 1
    rest = positional_args[idx:]
    if rest:
        flags["__positionalArgs"] = rest
    return flags

def process_args(flags, positional_names, base_args):
    values = []
    remaining = dict(flags)
    for name in positional_names:
        if name in remaining:
            values.append(str(remaining.pop(name)))
    if isinstance(flags.get("__positionalArgs"), list):
        values.extend(flags["__positionalArgs"])
    return base_args + values

flags = map_run(["db-id", "Name=Task", "Status=Todo"], ["dbId"])
argv = process_args(flags, ["dbId"], ["db", "add"])
print({"flags": flags, "argv": argv})
PY

Repository: javimosch/supercli

Length of output: 30368


Align the database command schemas with the upstream CLI.

db add forwards trailing KEY=VALUE arguments at runtime, but its schema does not expose them to schema-driven callers. Add a documented property input.

Set db create.title to "required": true. Regenerate plugins/catalog.json; its notion-cli checksum is stale.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@plugins/notion-cli/plugin.json` around lines 34 - 35, Update the notion db
command schemas: add a documented property input to db add for trailing
KEY=VALUE arguments, mark db create’s title argument as required, and regenerate
the notion-cli entry in plugins/catalog.json so its checksum matches the updated
plugin schema.

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