Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions plugins/notion-cli/install-guidance.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
"binary": "notion",
"check": "which notion",
"install_steps": [
"brew install 4ier/tap/notion-cli",
"go install github.com/4ier/notion-cli@latest",
"Link the binary: GOBIN=$(go env GOBIN); GOPATH=$(go env GOPATH); ln -sf \"${GOBIN:-$GOPATH/bin}/notion-cli\" \"${GOBIN:-$GOPATH/bin}/notion\"",
"Verify: notion --version",
Comment on lines +7 to 8

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 | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf 'Repo files matching notion-cli:\n'
git ls-files | rg '(^|/)notion-cli/|notion-cli' || true

printf '\nInspect notion-cli plugin files:\n'
for f in plugins/notion-cli/install-guidance.json plugins/notion-cli/plugin.json plugins/notion-cli/skills/quickstart/SKILL.md; do
  if [ -f "$f" ]; then
    echo "--- $f ($(wc -l < "$f") lines) ---"
    sed -n '1,260p' "$f" | nl -ba
  fi
done

printf '\nSearch for mention of `notion` and go install in repository:\n'
rg -n '"notion"|notion-cli|go install|PATH|PATH' plugins/notion-cli README.md 2>/dev/null || true

Repository: javimosch/supercli

Length of output: 506


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf 'notion-cli plugin files:\n'
git ls-files plugins/notion-cli | sort

for f in plugins/notion-cli/install-guidance.json plugins/notion-cli/meta.json plugins/notion-cli/plugin.json plugins/notion-cli/skills/quickstart/SKILL.md; do
  if [ -f "$f" ]; then
    echo "--- $f ---"
    sed -n '1,280p' "$f" | awk '{print NR": "$0}'
  else
    echo "missing $f"
  fi
done

printf '\nRelevant notion references in repository docs/files:\n'
rg -n '"notion"|notion-cli|go install|PATH' . --glob '!node_modules/**' --glob '!dist/**' --glob '!build/**' 2>/dev/null || true

Repository: javimosch/supercli

Length of output: 50377


🌐 Web query:

Go environment variables GOPATH default $HOME/go pkg/bin path installation document

💡 Result:

The GOPATH environment variable defines the location of your Go workspace. If it is not explicitly set, Go defaults it to $HOME/go on Unix systems and %USERPROFILE%\go on Windows [1][2][3]. The GOPATH directory structure is primarily used for the following purposes: 1. bin directory: This directory contains compiled binary executables [4][5][6]. When you run go install, the resulting binary is placed here by default, unless the GOBIN environment variable is set (in which case GOBIN takes precedence) [3][7]. 2. pkg directory: This directory holds cached data and dependencies. Specifically: - Module cache: When using Go modules, downloaded dependencies are stored in $GOPATH/pkg/mod [1][3][5]. - Build cache: Historically, compiled package objects were stored in subdirectories of pkg/ (e.g., pkg/GOOS_GOARCH/), though modern Go module-aware builds handle caching differently [4][5][7]. - Sum database: Go stores checksum database state in $GOPATH/pkg/sumdb [1]. You can view your current Go environment settings, including the effective GOPATH, by running the command: go env If you wish to change the default GOPATH location, you can set it permanently using: go env -w GOPATH=/your/custom/path Note that GOPATH should not be set to the same directory as your Go installation (GOROOT) [2][8]. Although modern Go development primarily relies on Go modules rather than the traditional GOPATH workspace mode for resolving source imports, the GOPATH variable remains essential for determining these default binary and cache installation paths [1][5][6].

Citations:


🌐 Web query:

Go language specification command search PATH no GOPATH/bin unless GOBIN set

💡 Result:

The Go command does not search the PATH to determine where to install binaries; rather, it uses a specific directory priority to determine the installation location [1][2]. When you run 'go install', the destination directory for the resulting executable is determined by the following precedence rules [2][3]: 1. GOBIN: If the GOBIN environment variable is set, the 'go' command installs executables to that directory [1][2]. 2. GOPATH: If GOBIN is not set and GOPATH is set, the command installs executables to the 'bin' subdirectory of the first entry in the GOPATH list [2][4]. 3. Default: If neither GOBIN nor GOPATH is set, the command defaults to the 'bin' subdirectory of the default GOPATH, which is '$HOME/go/bin' (or '%USERPROFILE%\go\bin' on Windows) [1][2]. Note that these rules apply to the installation of binaries by the 'go' command, not to the system's PATH search mechanism for locating executable commands to run [2][5]. After installing a binary, it is standard practice to add the installation directory (e.g., '$GOPATH/bin') to your system PATH so that the installed tools can be executed easily [2][6].

Citations:


🌐 Web query:

node.js child_process exec PATH inherited environment process.env.PATH

💡 Result:

In Node.js, the child_process.exec function uses the environment variables specified in the options.env object to execute the command [1][2]. By default, the environment is inherited from the parent process (process.env) [1][3]. If you provide an options.env object, it replaces the entire environment for the child process [1][2]. This means that if you define a custom env object but do not include the original PATH variable, the child process will not have access to the parent's PATH [1][2]. Key behaviors regarding PATH and environment inheritance include: 1. Inheritance: If no env option is provided, the child process automatically inherits the complete process.env from the parent [1][3]. 2. Overriding: If you pass an env object, you must explicitly include all environment variables you wish to preserve, including PATH [4]. A common practice is to spread the existing environment: { env: {...process.env, MY_VAR: 'value' } } [4]. 3. PATH Lookup: The command lookup for the child process uses the PATH variable present in the provided options.env object [1][2]. If options.env is provided but does not contain PATH, the system defaults to a limited search path (/usr/bin:/bin on Unix) or the current process's environment PATH (on Windows) [1][2]. 4. Windows Caveat: On Windows, environment variables are case-insensitive. Node.js sorts keys lexicographically and uses the first match, which can cause issues if your env object contains both PATH and Path [5][3]. For complex environments, it is recommended to explicitly construct the environment object rather than relying on implicit inheritance when modifying specific variables [4].

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf 'notion-cli files with line numbers:\n'
for f in plugins/notion-cli/install-guidance.json plugins/notion-cli/meta.json plugins/notion-cli/plugin.json plugins/notion-cli/skills/quickstart/SKILL.md; do
  if [ -f "$f" ]; then
    wc -l "$f"
    sed -n '1,280p' "$f"
  fi
done

printf '\nTests for notion-cli:\n'
sed -n '1,260p' __tests__/notion-cli-plugin.test.js

printf '\nSearch adapter command and check binary usage:\n'
rg -n '"check".*"notion"|"command".*"notion"|which notion' plugins/notion-cli plugin tests __tests__ --glob '!node_modules/**' || true

Repository: javimosch/supercli

Length of output: 18075


Make the Go-installed notion binary discoverable.

Go installs notion-cli to ${GOBIN:-$GOPATH/bin}, and the OS only finds it when that directory is in PATH. The symlink is placed in the same target directory, so add the appropriate Go binary directory to PATH and persist it before the notion --version check/helps.

Update these locations:

  • plugins/notion-cli/install-guidance.json
  • plugins/notion-cli/plugin.json
  • plugins/notion-cli/skills/quickstart/SKILL.md
📍 Affects 3 files
  • plugins/notion-cli/install-guidance.json#L7-L8 (this comment)
  • plugins/notion-cli/plugin.json#L14-L16
  • plugins/notion-cli/plugin.json#L34-L34
  • plugins/notion-cli/plugin.json#L234-L234
  • plugins/notion-cli/skills/quickstart/SKILL.md#L61-L66
🤖 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/install-guidance.json` around lines 7 - 8, Make the Go
binary directory discoverable by adding `${GOBIN:-$GOPATH/bin}` to PATH and
persisting that change before any notion commands run. Update the install
guidance and every affected setup, verification, and quickstart instruction in
plugins/notion-cli/install-guidance.json (lines 7-8),
plugins/notion-cli/plugin.json (lines 14-16, 34, and 234), and
plugins/notion-cli/skills/quickstart/SKILL.md (lines 61-66); preserve the
existing symlink and notion --version/help steps.

"Authenticate: echo 'ntn_xxxxx' | notion auth login --with-token",
"Alternative auth: export NOTION_TOKEN=ntn_xxxxx",
"supercli plugins install ./plugins/notion-cli --on-conflict replace --json"
],
"note": "Also available as Go binary from GitHub Releases: https://github.com/4ier/notion-cli/releases. npm: npm install -g @4ier/notion-cli. Token stored in ~/.config/notion-cli/config.json (mode 0600). Auto-detects JSON output when piped to another command."
"note": "Primary install is go install; the resulting binary is named `notion-cli`, so link or rename it as `notion` to use this plugin. Also available via Homebrew (brew install 4ier/tap/notion-cli), as a Go binary from GitHub Releases (https://github.com/4ier/notion-cli/releases), or via npm (npm install -g @4ier/notion-cli). Token stored in ~/.config/notion-cli/config.json (mode 0600). Auto-detects JSON output when piped to another command."
}
7 changes: 4 additions & 3 deletions plugins/notion-cli/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"binary": "notion",
"check": "which notion",
"install_steps": [
"brew install 4ier/tap/notion-cli",
"go install github.com/4ier/notion-cli@latest",
"Link the binary: GOBIN=$(go env GOBIN); GOPATH=$(go env GOPATH); ln -sf \"${GOBIN:-$GOPATH/bin}/notion-cli\" \"${GOBIN:-$GOPATH/bin}/notion\"",
"Verify: notion --version",
"Authenticate: echo 'ntn_xxxxx' | notion auth login --with-token",
"supercli plugins install ./plugins/notion-cli --on-conflict replace --json"
Expand All @@ -30,7 +31,7 @@
"adapterConfig": {
"command": "notion",
"baseArgs": ["--version"],
"missingDependencyHelp": "Install notion-cli: brew install 4ier/tap/notion-cli"
"missingDependencyHelp": "Install notion-cli: go install github.com/4ier/notion-cli@latest (binary will be notion-cli; link/rename it to notion) or brew install 4ier/tap/notion-cli"
},
"args": []
},
Expand Down Expand Up @@ -230,7 +231,7 @@
"adapterConfig": {
"command": "notion",
"passthrough": true,
"missingDependencyHelp": "Install notion-cli: brew install 4ier/tap/notion-cli. Authenticate: echo 'ntn_xxxx' | notion auth login --with-token"
"missingDependencyHelp": "Install notion-cli: go install github.com/4ier/notion-cli@latest (binary will be notion-cli; link/rename it to notion) or brew install 4ier/tap/notion-cli. Authenticate: echo 'ntn_xxxx' | notion auth login --with-token"
},
"args": []
}
Expand Down
17 changes: 16 additions & 1 deletion plugins/notion-cli/skills/quickstart/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,26 @@ export NOTION_TOKEN=ntn_xxxxx

## Installation

`go install` builds a binary named `notion-cli`; link it as `notion` so the plugin commands work:

```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"
```

Or install with Homebrew:

```bash
brew install 4ier/tap/notion-cli
```

Or download binary from [GitHub Releases](https://github.com/4ier/notion-cli/releases).
Or install with npm:

```bash
npm install -g @4ier/notion-cli
```

Or download a binary from [GitHub Releases](https://github.com/4ier/notion-cli/releases).

## Key Features
- **Agent-friendly**: JSON output auto-detected when piped, schema-aware, URL or ID support
Expand Down
Loading