@maintainer-pro/ai-cli 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +61 -0
  2. package/package.json +13 -2
package/README.md ADDED
@@ -0,0 +1,61 @@
1
+ # @maintainer-pro/ai-cli
2
+
3
+ Server SDK for Maintainer Pro. It talks to coding agents — Cursor (`agent`), Claude (`claude`), or Antigravity (`agy`) — and exposes chat HTTP handlers for your Node app.
4
+
5
+ Use this package when you already have a server (Next, Express, Fastify). To get a port with no custom `server.mjs`, use [`@maintainer-pro/ai-server`](https://www.npmjs.com/package/@maintainer-pro/ai-server).
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install @maintainer-pro/ai-cli
11
+ ```
12
+
13
+ Requires **Node.js 22+** and one authenticated coding-agent CLI on the machine that runs chat.
14
+
15
+ ## Quick start
16
+
17
+ ```ts
18
+ import {
19
+ createChatHandler,
20
+ createDefaultSystemPrompt,
21
+ createMaintainerProStoreFromEnv,
22
+ } from "@maintainer-pro/ai-cli";
23
+
24
+ const db = createMaintainerProStoreFromEnv();
25
+ if (!db) {
26
+ throw new Error("Set MAINTAINER_PRO_URL and MAINTAINER_PRO_API_KEY");
27
+ }
28
+
29
+ export const handlers = createChatHandler({
30
+ systemPrompt: createDefaultSystemPrompt({
31
+ productDescription: "Edit source files in the workspace when the user asks.",
32
+ }),
33
+ workspaceDir: process.env.AI_CLI_WORKSPACE ?? process.cwd(),
34
+ db,
35
+ });
36
+
37
+ export const GET = handlers.GET;
38
+ export const POST = handlers.POST;
39
+ ```
40
+
41
+ Chat history is stored in Maintainer Pro admin. Do not put API keys in the browser bundle — serve the client key from `/embed-config.js` (or Next `/api/embed-config`).
42
+
43
+ ## Environment
44
+
45
+ | Variable | Purpose |
46
+ |----------|---------|
47
+ | `AI_CLI_PROVIDER` | `auto` \| `claude` \| `cursor` \| `antigravity` |
48
+ | `AI_CLI_COMMAND` | Optional binary name or absolute path |
49
+ | `AI_CLI_WORKSPACE` | Folder the agent may edit |
50
+ | `MAINTAINER_PRO_URL` | Admin base URL |
51
+ | `MAINTAINER_PRO_API_KEY` | Server API key from admin |
52
+
53
+ ## Related packages
54
+
55
+ | Package | Role |
56
+ |---------|------|
57
+ | [`@maintainer-pro/ai-server`](https://www.npmjs.com/package/@maintainer-pro/ai-server) | `npx` Node server that uses this SDK |
58
+ | [`@maintainer-pro/ai-ui`](https://www.npmjs.com/package/@maintainer-pro/ai-ui) | React chat UI and embed script |
59
+ | [`@maintainer-pro/setup`](https://www.npmjs.com/package/@maintainer-pro/setup) | Download the sandbox setup guide |
60
+
61
+ Optional SQL persistence lives on `@maintainer-pro/ai-cli/db` (install `better-sqlite3`, `postgres`, or `mysql2`).
package/package.json CHANGED
@@ -1,7 +1,17 @@
1
1
  {
2
2
  "name": "@maintainer-pro/ai-cli",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Maintainer Pro server SDK: Claude/Cursor CLI, chat HTTP handlers, and optional SQL persistence",
5
+ "keywords": [
6
+ "maintainer-pro",
7
+ "ai",
8
+ "chat",
9
+ "cursor",
10
+ "claude",
11
+ "antigravity",
12
+ "agent",
13
+ "sdk"
14
+ ],
5
15
  "license": "MIT",
6
16
  "type": "module",
7
17
  "main": "./dist/index.cjs",
@@ -21,7 +31,8 @@
21
31
  },
22
32
  "files": [
23
33
  "dist",
24
- "drizzle"
34
+ "drizzle",
35
+ "README.md"
25
36
  ],
26
37
  "publishConfig": {
27
38
  "access": "public"