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
5 changes: 5 additions & 0 deletions .changeset/ship-plugin-installer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"grok-bot-cli": patch
---

Ship the `grok-bot` agent plugin inside the npm package: `npm install --global grok-bot-cli` now also provides `gbot-install install|uninstall cursor|claude|codex` and `gbot-install doctor` (Node 22.19+), which install the bundled `gbot_send` / `gbot_thread` MCP server and `talk-to-grok-bot` Skill from `plugin/dist` without cloning the repository. `npm run build:plugin` (run automatically by `npm pack` / `npm publish`) produces that directory with `agent-bundle prepack`.
9 changes: 9 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ jobs:
- name: Test
run: npm test

- name: Build the plugin distribution (gbot-install bin + host projections)
run: npm run build:plugin

- name: Lint the package
run: npx --yes publint@0.3.24

Expand All @@ -38,6 +41,12 @@ jobs:
install_root=$(mktemp -d)
npm install --global --prefix "$install_root" "./$package_file"
"$install_root/bin/gbot" --help
"$install_root/bin/gbot-install" --help
fake_home=$(mktemp -d)
mkdir -p "$fake_home/.cursor"
HOME="$fake_home" "$install_root/bin/gbot-install" install cursor --json
test -f "$fake_home/.cursor/plugins/local/grok-bot/.agent-bundle-install.json"
test -f "$fake_home/.cursor/plugins/local/grok-bot/plugin.json"

plugin:
runs-on: ubuntu-latest
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ jobs:
- name: Test
run: npm test

- name: Build the plugin distribution (gbot-install bin + host projections)
run: npm run build:plugin

- name: Lint the package
run: npx --yes publint@0.3.24

Expand All @@ -53,6 +56,11 @@ jobs:
test "${#package_files[@]}" -eq 1
npm install --global --prefix "$install_root" "${package_files[0]}"
"$install_root/bin/gbot" --help
"$install_root/bin/gbot-install" --help
fake_home=$(mktemp -d)
mkdir -p "$fake_home/.cursor"
HOME="$fake_home" "$install_root/bin/gbot-install" install cursor --json
test -f "$fake_home/.cursor/plugins/local/grok-bot/.agent-bundle-install.json"

- name: Create release pull request or publish
id: changesets
Expand Down
27 changes: 24 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,25 @@ Manage [Grok Bot](https://cursor.com/help/grok-bot/plans) agents, groups, and me
npm install --global grok-bot-cli
```

The package ships two things: the `gbot` CLI and the `grok-bot` agent plugin (the `gbot_send` /
`gbot_thread` MCP server plus the `talk-to-grok-bot` Skill) as an [Agent Bundle](https://scriptedalchemy.github.io/agent-bundle/)
artifact under `plugin/dist`. Install the plugin into whichever hosts you use with the bundled installer:

```sh
gbot-install install cursor # ~/.cursor/plugins/local/grok-bot (reload Cursor afterwards)
gbot-install install claude # claude plugin marketplace add + install, scope user
gbot-install install codex # codex plugin marketplace add + plugin add
gbot-install doctor # what each host has, and whether it matches this package
gbot-install install cursor --replace # upgrade a copy installed from an older version
gbot-install uninstall cursor # removes only what the receipt says this package installed
```

`gbot-install` needs Node.js 22.19+ (the plugin runtime); `gbot` itself runs on Node.js 18+. The same
artifact is documented host by host in `plugin/dist/INSTALL.md` inside the installed package, and
developers with the `agent-bundle` CLI can run `agent-bundle install <host> --from plugin/dist`
instead. Building from a checkout: `npm run build:plugin` produces `plugin/dist` (it is also what
`npm pack` / `npm publish` run first).

Requires Node.js 18+ and the Grok Bot desktop app on macOS, Linux, or Windows. Open Grok Bot and sign in once; `gbot` automatically uses the app's encrypted session and routing credentials. No token copying is required. On Linux the app keeps its session under `~/.config/Grok Bot` (or `$XDG_CONFIG_HOME`); when it is stored in the system keyring, `gbot` reads the key with `secret-tool` (package `libsecret-tools`). On Windows the session lives under `%APPDATA%\\Grok Bot` and decrypts with the app's DPAPI-wrapped Safe Storage key.

## Use
Expand Down Expand Up @@ -87,8 +106,9 @@ that gives Codex, Claude Code, and Cursor two MCP tools on a `grok-bot` server,
when to ping a bot and how to word the message. The tools bundle this repository's
gateway client, so the installed plugin does not need `gbot` on `PATH`.

The plugin is not part of the npm package. From a clone of this repository, build
the artifact once, then install it into each host you use:
The built plugin ships inside the npm package; `gbot-install install <host>` (see
[Install](#install)) is the normal path. From a clone of this repository you can also build
and install the development artifact directly:

```sh
git clone https://github.com/ScriptedAlchemy/grok-bot-cli.git
Expand All @@ -103,7 +123,8 @@ npx agent-bundle doctor --from artifact

Add `--replace` to an install command to overwrite an earlier copy. `npm run check`
runs the plugin gates: source validation, build, artifact validation, typecheck, and
the route-unit tests, which drive both tools against a loopback fake gateway.
the route-unit tests, which drive both tools against a loopback fake gateway;
`npm run prepack` emits the npm-root form under `plugin/dist` that the package ships.

`gbot_thread` returns a small receipt by default: deterministic `summary`, opaque
`cursor`, `entryCount`, and `gapReset`.
Expand Down
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"type": "module",
"bin": {
"gbot": "src/cli.js",
"grok-bot": "src/cli.js"
"grok-bot": "src/cli.js",
"gbot-install": "plugin/dist/bin/gbot-install.js"
},
"engines": {
"node": ">=18"
Expand All @@ -14,7 +15,9 @@
"changeset": "changeset",
"gbot": "node src/cli.js",
"release": "changeset publish",
"test": "node scripts/run-unit-tests.mjs"
"test": "node scripts/run-unit-tests.mjs",
"build:plugin": "npm --prefix plugin ci --no-json --silent && npm --prefix plugin run --silent prepack",
"prepack": "npm run --silent build:plugin 1>&2"
},
"repository": {
"type": "git",
Expand All @@ -39,6 +42,7 @@
],
"files": [
"src",
"plugin/dist",
"README.md",
"LICENSE"
],
Expand Down
16 changes: 16 additions & 0 deletions plugin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# grok-bot plugin

The Agent Bundle plugin half of [`grok-bot-cli`](https://github.com/ScriptedAlchemy/grok-bot-cli): the
`grok-bot` MCP server (`gbot_send`, `gbot_thread`) and the `talk-to-grok-bot` Skill for Codex, Claude Code,
and Cursor.

It is not published on its own. `agent-bundle prepack` emits `dist/`, and the `grok-bot-cli` tarball ships
that directory together with the `gbot-install` bin:

```sh
npm install --global grok-bot-cli
gbot-install install cursor # or claude / codex; --replace upgrades an older copy
gbot-install doctor
```

Develop with `npm ci && npm run check` in this directory (Node 22.19+).
3 changes: 3 additions & 0 deletions plugin/agent-bundle.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { defineConfig } from 'agent-bundle/config';

export default defineConfig({
// Package-bound installer shipped inside the `grok-bot-cli` tarball as the
// `gbot-install` bin (`plugin/dist/bin/gbot-install.js`); see README "Install".
bin: { 'gbot-install': './src/gbot-install.ts' },
lib: false,
marketplace: true,
output: { distPath: 'artifact' },
Expand Down
Loading