Skip to content
Closed
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
4 changes: 2 additions & 2 deletions plugins/notion-cli/install-guidance.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"binary": "notion",
"check": "which notion",
"install_steps": [
"brew install 4ier/tap/notion-cli",
"go install github.com/4ier/notion-cli@latest",
"Verify: notion --version",
Comment on lines +6 to 7

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:

#!/usr/bin/env sh
set -eu

gobin="$(go env GOBIN)"
if [ -z "$gobin" ]; then
  gobin="$(go env GOPATH)/bin"
fi

test -x "$gobin/notion"
case ":${PATH:-}:" in
  *":$gobin:"*) ;;
  *) echo "$gobin is not in PATH" >&2; exit 1 ;;
esac

command -v notion >/dev/null

Repository: javimosch/supercli

Length of output: 156


🏁 Script executed:

#!/usr/bin/env sh
set -eu

echo "Go environment:"
gop="$(go env GOPATH)"
gob=$(go env GOBIN)
if [ -z "$gob" ]; then
  gob="$gop/bin"
fi
printf "GOPATH=%s\nGOBIN=%s\nDEFAULT_BIN=%s\nPATH=%s\n" "$gop" "$(go env GOBIN)" "$gob" "$PATH"
printf "default binary exists executable? "
[ -x "$gob/notion" ] && echo yes || echo no
printf "default binary in PATH? "
case ":${PATH:-}:" in
  *":$gob:") echo yes ;;
  *) echo no ;;
esac
printf "notion available? "
command -v notion >/dev/null && echo yes || echo no

echo
echo "Relevant files:"
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 ---"
    sed -n '1,90p' "$f"
  fi
done

Repository: javimosch/supercli

Length of output: 6974


🌐 Web query:

go install executable GOPATH/bin GOBIN PATH official documentation

💡 Result:

When you run the go install command, the Go toolchain compiles and installs executables based on the following precedence for the installation directory [1][2][3]: 1. GOBIN Environment Variable: If the GOBIN environment variable is set, Go installs executables directly into this directory [1][2][4]. 2. Default Location: If GOBIN is not set, Go installs executables into the bin subdirectory of the GOPATH [1][2][4]. If GOPATH is not set, it defaults to $HOME/go/bin (on Unix) or %USERPROFILE%\go\bin (on Windows) [1][2][4]. Note that executables in the Go installation root (GOROOT) are installed into $GOROOT/bin or the GOTOOLDIR, rather than the GOBIN path [1][5]. To discover exactly where your Go binaries are currently being installed, you can use the following command [6]: go list -f '{{.Target}}' If you wish to change this location, you can set the GOBIN variable using the go env command [6][2]: go env -w GOBIN=/path/to/your/bin To run these installed executables without providing a full path, the directory containing them must be included in your system's PATH environment variable [6][2]. You can verify the current bin directory location by running go env GOBIN or by checking your GOPATH configuration [2][4][7].

Citations:


Document the Go binary PATH requirement.

go install puts executables in GOBIN or GOPATH/bin; notion --version and the plugin check require the installed binary to be in PATH. Add a PATH setup step or explicit install-location guidance before the verification/auth commands.

Applies to plugins/notion-cli/install-guidance.json, plugins/notion-cli/plugin.json, and plugins/notion-cli/skills/quickstart/SKILL.md.

📍 Affects 3 files
  • plugins/notion-cli/install-guidance.json#L6-L7 (this comment)
  • plugins/notion-cli/skills/quickstart/SKILL.md#L61-L63
  • plugins/notion-cli/plugin.json#L14-L14
🤖 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 6 - 7, Document the Go
binary PATH requirement before verification or authentication: in
plugins/notion-cli/install-guidance.json lines 6-7,
plugins/notion-cli/skills/quickstart/SKILL.md lines 61-63, and
plugins/notion-cli/plugin.json line 14, add a PATH setup step or explicit
GOBIN/GOPATH/bin install-location guidance so the installed notion binary is
discoverable by notion --version and plugin checks.

"Authenticate: echo 'ntn_xxxxx' | notion auth login --with-token",
"Alternative auth: export NOTION_TOKEN=ntn_xxxxx",
Comment on lines 8 to 9

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Do not place the real token in shell history.

When users replace ntn_xxxxx, both commands can record the token in shell history. Use a hidden prompt or an external secret source, then pipe the value to notion auth login --with-token.

🤖 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 8 - 9, Update the
authentication guidance strings to avoid embedding the token directly in command
text or shell history: use a hidden prompt or external secret source and pipe
its value into `notion auth login --with-token`. Revise or remove the
`NOTION_TOKEN` alternative so it likewise does not expose the real token in
shell history.

"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": "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."

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== file =="
cat -n plugins/notion-cli/install-guidance.json

echo
echo "== notion-cli plugin files =="
git ls-files plugins/notion-cli | sort

echo
echo "== related os.Chmod usages in notion-cli =="
rg -n "0600|os\\.Chmod|config\\.json|notion-cli/config" plugins/notion-cli -S || true

Repository: javimosch/supercli

Length of output: 1567


🌐 Web query:

Go os.Chmod Windows Unix mode bits ignore permissions official documentation

💡 Result:

In Go, the os.Chmod and (*File).Chmod functions behave differently on Windows compared to Unix-based systems because Windows does not support standard Unix-style permission bits [1][2]. Official documentation specifies that on Windows, os.Chmod only utilizes the 0o200 bit (the owner writable bit) of the provided mode [1][3]. This specific bit controls whether the file's read-only attribute is set or cleared [1][2]. All other permission bits (such as group or world permissions, or special bits like setuid/setgid) are ignored [1][2]. When using os.Chmod on Windows: - Setting the 0o200 bit (e.g., in 0o600) clears the read-only attribute, making the file writable [1][2]. - Omitting the 0o200 bit (e.g., in 0o400) sets the read-only attribute [1][2]. Important implementation notes: - The behavior is limited to files; Windows does not respect the read-only file attribute on directories in the same way [4][5]. - For backward compatibility with Go 1.12 and earlier, it is recommended to provide a non-zero mode [1][2]. - Historically, (*File).Chmod was not fully supported on Windows, leading to errors in older versions of Go [6][7], but it has since been implemented to align with the behavior of os.Chmod [6]. Always refer to the current documentation for your specific Go version, as subtle differences or error handling may have evolved [3][7].

Citations:


Limit the 0600 protection note to Unix-like systems.

The mode 0600 guarantee does not carry across to Windows in the same way; on Windows, Unix-style chmod bits are handled by the read-only file attribute, not owner-only ACLs. State that 0600 applies on Unix-like systems and document the Windows-only protection separately.

🤖 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` at line 12, Update the note string
in install-guidance.json to scope the mode 0600 file-permission guarantee
explicitly to Unix-like systems, and add separate wording describing the Windows
read-only file-attribute protection. Keep the existing installation sources and
token path unchanged.

}
6 changes: 3 additions & 3 deletions plugins/notion-cli/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"binary": "notion",
"check": "which notion",
"install_steps": [
"brew install 4ier/tap/notion-cli",
"go install github.com/4ier/notion-cli@latest",
"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 +30,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 (or brew install 4ier/tap/notion-cli)"
},
"args": []
},
Expand Down Expand Up @@ -230,7 +230,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 (or brew install 4ier/tap/notion-cli). Authenticate: echo 'ntn_xxxx' | notion auth login --with-token"
},
"args": []
}
Expand Down
8 changes: 7 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,17 @@ export NOTION_TOKEN=ntn_xxxxx

## Installation

```bash
go install github.com/4ier/notion-cli@latest
```

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