pinsay-cli 0.6.6 → 0.6.8
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.
- package/README.md +14 -14
- package/dist/cli.js +19 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -11,30 +11,30 @@ npx pinsay-cli init
|
|
|
11
11
|
`init` walks you through everything: server, project, AI tool, and the widget/script snippet to paste into your app. It takes about a minute.
|
|
12
12
|
|
|
13
13
|
- `npx pinsay-cli <command>` runs it without installing — but you type the full name every time.
|
|
14
|
-
- `npm i -g pinsay-cli` installs a real `pinsay` command on your PATH
|
|
14
|
+
- `npm i -g pinsay-cli` installs a real `pinsay` command on your PATH — then plain `pinsay <command>` works everywhere the docs say `npx pinsay-cli <command>`.
|
|
15
15
|
|
|
16
16
|
## Commands
|
|
17
17
|
|
|
18
18
|
| Command | What it does |
|
|
19
19
|
|---|---|
|
|
20
|
-
| `pinsay init` | Configure a repo (server, project, widget snippet, skills) |
|
|
21
|
-
| `pinsay login` / `whoami` / `logout` | Sign in once per machine; check / clear credentials |
|
|
22
|
-
| `pinsay list` / `get <id>` | List pending feedback; inspect one comment |
|
|
23
|
-
| `pinsay apply` | Generate the fix-it prompt for your AI tool, then record what changed |
|
|
24
|
-
| `pinsay apply --plan` | Preview proposed edits without touching code |
|
|
25
|
-
| `pinsay apply --mark <id> --reply "..."` | Mark comment(s) applied, with the commit URL |
|
|
26
|
-
| `pinsay status <id> <status>` / `reply <id> "<text>"` | Change a comment's status / reply |
|
|
27
|
-
| `pinsay doctor` | Verify config, credentials, server and widget health |
|
|
28
|
-
| `pinsay update` | Refresh the installed skills to the server's version |
|
|
29
|
-
| `pinsay map --from-source` | Rebuild the component-source manifest (Vite plugin users) |
|
|
30
|
-
| `pinsay mcp` | Run the MCP server for Claude Code / Cursor |
|
|
20
|
+
| `npx pinsay-cli init` | Configure a repo (server, project, widget snippet, skills) |
|
|
21
|
+
| `npx pinsay-cli login` / `whoami` / `logout` | Sign in once per machine; check / clear credentials |
|
|
22
|
+
| `npx pinsay-cli list` / `get <id>` | List pending feedback; inspect one comment |
|
|
23
|
+
| `npx pinsay-cli apply` | Generate the fix-it prompt for your AI tool, then record what changed |
|
|
24
|
+
| `npx pinsay-cli apply --plan` | Preview proposed edits without touching code |
|
|
25
|
+
| `npx pinsay-cli apply --mark <id> --reply "..."` | Mark comment(s) applied, with the commit URL |
|
|
26
|
+
| `npx pinsay-cli status <id> <status>` / `reply <id> "<text>"` | Change a comment's status / reply |
|
|
27
|
+
| `npx pinsay-cli doctor` | Verify config, credentials, server and widget health |
|
|
28
|
+
| `npx pinsay-cli update` | Refresh the installed skills to the server's version |
|
|
29
|
+
| `npx pinsay-cli map --from-source` | Rebuild the component-source manifest (Vite plugin users) |
|
|
30
|
+
| `npx pinsay-cli mcp` | Run the MCP server for Claude Code / Cursor |
|
|
31
31
|
|
|
32
32
|
## How you use it day to day
|
|
33
33
|
|
|
34
34
|
1. A reviewer pins an element in your app and leaves a comment.
|
|
35
|
-
2. Run `pinsay apply` — it prints a self-contained prompt.
|
|
35
|
+
2. Run `npx pinsay-cli apply` — it prints a self-contained prompt.
|
|
36
36
|
3. Paste it into your AI tool; it edits the code and commits.
|
|
37
|
-
4. Run `pinsay apply --mark <id> --reply "<what changed>"` to close the loop.
|
|
37
|
+
4. Run `npx pinsay-cli apply --mark <id> --reply "<what changed>"` to close the loop.
|
|
38
38
|
|
|
39
39
|
## API keys
|
|
40
40
|
|
package/dist/cli.js
CHANGED
|
@@ -14,8 +14,8 @@ var BUILD_DEFAULT_SERVER, BUILD_CLI_VERSION;
|
|
|
14
14
|
var init_build_constants = __esm({
|
|
15
15
|
"src/build-constants.ts"() {
|
|
16
16
|
"use strict";
|
|
17
|
-
BUILD_DEFAULT_SERVER = true ? "https://
|
|
18
|
-
BUILD_CLI_VERSION = true ? "0.6.
|
|
17
|
+
BUILD_DEFAULT_SERVER = true ? "https://app.pinsay.dev" : "https://app.pinsay.dev";
|
|
18
|
+
BUILD_CLI_VERSION = true ? "0.6.8" : "0.0.0-dev";
|
|
19
19
|
}
|
|
20
20
|
});
|
|
21
21
|
|
|
@@ -89,10 +89,18 @@ async function findRepoRoot(cwd2) {
|
|
|
89
89
|
dir = parent;
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
|
+
function canonicalServer(server) {
|
|
93
|
+
if (!server)
|
|
94
|
+
return server;
|
|
95
|
+
return server.replace(/\/+$/, "") === LEGACY_SERVER ? CANONICAL_SERVER : server;
|
|
96
|
+
}
|
|
92
97
|
async function readConfig(cwd2) {
|
|
93
98
|
try {
|
|
94
99
|
const content = await fs.readFile(join(cwd2, CONFIG_FILE), "utf8");
|
|
95
|
-
|
|
100
|
+
const config = JSON.parse(content);
|
|
101
|
+
if (config.server)
|
|
102
|
+
config.server = canonicalServer(config.server);
|
|
103
|
+
return config;
|
|
96
104
|
} catch (err) {
|
|
97
105
|
if (err.code !== "ENOENT")
|
|
98
106
|
throw err;
|
|
@@ -180,12 +188,14 @@ async function upsertGitignore(cwd2, productName = "Feedback tool", skillsDir) {
|
|
|
180
188
|
await fs.writeFile(file, content, "utf8");
|
|
181
189
|
}
|
|
182
190
|
}
|
|
183
|
-
var CONFIG_FILE, CREDENTIALS_FILE, IGNORED_SKILL_DIRS, LEGACY_REPO_FILES;
|
|
191
|
+
var CONFIG_FILE, CREDENTIALS_FILE, LEGACY_SERVER, CANONICAL_SERVER, IGNORED_SKILL_DIRS, LEGACY_REPO_FILES;
|
|
184
192
|
var init_config = __esm({
|
|
185
193
|
"src/config.ts"() {
|
|
186
194
|
"use strict";
|
|
187
195
|
CONFIG_FILE = ".pinsay/config.json";
|
|
188
196
|
CREDENTIALS_FILE = ".pinsay/credentials.env";
|
|
197
|
+
LEGACY_SERVER = "https://api.pinsay.dev";
|
|
198
|
+
CANONICAL_SERVER = "https://app.pinsay.dev";
|
|
189
199
|
IGNORED_SKILL_DIRS = [
|
|
190
200
|
".claude/skills/pinsay-init/",
|
|
191
201
|
".claude/skills/pinsay-feedback/",
|
|
@@ -3356,7 +3366,7 @@ async function initCommand(cwd2, options = {}) {
|
|
|
3356
3366
|
const configIsMulti = isMultiProject(config);
|
|
3357
3367
|
const isJoin = !isAddProject && Boolean(config.server) && (Boolean(config.project) || configIsMulti);
|
|
3358
3368
|
const mode = isJoin ? "join" : "install";
|
|
3359
|
-
let server = options["server"] || config.server || process.env.PINSAY_SERVER || BUILD_DEFAULT_SERVER;
|
|
3369
|
+
let server = options["server"] || config.server || canonicalServer(process.env.PINSAY_SERVER) || BUILD_DEFAULT_SERVER;
|
|
3360
3370
|
if (!isYes && !options["server"] && !config.server) {
|
|
3361
3371
|
server = await ask("Server URL", { default: server });
|
|
3362
3372
|
}
|
|
@@ -12198,7 +12208,7 @@ async function runMcpServer(ctx, logFile) {
|
|
|
12198
12208
|
async function mcpCommand(cwd2, parsed = {}) {
|
|
12199
12209
|
const root = await findRepoRoot(cwd2);
|
|
12200
12210
|
const config = await readConfig(root).catch(() => ({}));
|
|
12201
|
-
const server = ((typeof parsed["server"] === "string" ? parsed["server"] : config.server) || process.env.PINSAY_SERVER || BUILD_DEFAULT_SERVER).replace(/\/$/, "");
|
|
12211
|
+
const server = ((typeof parsed["server"] === "string" ? parsed["server"] : config.server) || canonicalServer(process.env.PINSAY_SERVER) || BUILD_DEFAULT_SERVER).replace(/\/$/, "");
|
|
12202
12212
|
const projectFlag = typeof parsed["project"] === "string" ? parsed["project"] : void 0;
|
|
12203
12213
|
const project = projectFlag || config.project || process.env.PINSAY_PROJECT || "";
|
|
12204
12214
|
const explicitKey = typeof parsed["key"] === "string" ? parsed["key"] : void 0;
|
|
@@ -12239,7 +12249,7 @@ init_build_constants();
|
|
|
12239
12249
|
async function loginCommand(cwd2, options = {}) {
|
|
12240
12250
|
const root = await findRepoRoot(cwd2);
|
|
12241
12251
|
const config = await readConfig(root).catch(() => ({}));
|
|
12242
|
-
const server = ((typeof options["server"] === "string" ? options["server"] : void 0) || config.server || process.env.PINSAY_SERVER || BUILD_DEFAULT_SERVER).replace(/\/$/, "");
|
|
12252
|
+
const server = ((typeof options["server"] === "string" ? options["server"] : void 0) || config.server || canonicalServer(process.env.PINSAY_SERVER) || BUILD_DEFAULT_SERVER).replace(/\/$/, "");
|
|
12243
12253
|
const branding = await getBranding(server);
|
|
12244
12254
|
const product = branding.productName;
|
|
12245
12255
|
const flagKey = typeof options["key"] === "string" ? options["key"] : void 0;
|
|
@@ -12297,7 +12307,7 @@ init_build_constants();
|
|
|
12297
12307
|
async function logoutCommand(cwd2, options = {}) {
|
|
12298
12308
|
const root = await findRepoRoot(cwd2);
|
|
12299
12309
|
const config = await readConfig(root).catch(() => ({}));
|
|
12300
|
-
const server = ((typeof options["server"] === "string" ? options["server"] : void 0) || config.server || process.env.PINSAY_SERVER || BUILD_DEFAULT_SERVER).replace(/\/$/, "");
|
|
12310
|
+
const server = ((typeof options["server"] === "string" ? options["server"] : void 0) || config.server || canonicalServer(process.env.PINSAY_SERVER) || BUILD_DEFAULT_SERVER).replace(/\/$/, "");
|
|
12301
12311
|
const origin = normalizeServerOrigin(server);
|
|
12302
12312
|
const removed = await removeGlobalCredential(server);
|
|
12303
12313
|
if (options["json"] === true) {
|
|
@@ -12318,7 +12328,7 @@ init_build_constants();
|
|
|
12318
12328
|
async function whoamiCommand(cwd2, options = {}) {
|
|
12319
12329
|
const root = await findRepoRoot(cwd2);
|
|
12320
12330
|
const config = await readConfig(root).catch(() => ({}));
|
|
12321
|
-
const server = ((typeof options["server"] === "string" ? options["server"] : void 0) || config.server || process.env.PINSAY_SERVER || BUILD_DEFAULT_SERVER).replace(/\/$/, "");
|
|
12331
|
+
const server = ((typeof options["server"] === "string" ? options["server"] : void 0) || config.server || canonicalServer(process.env.PINSAY_SERVER) || BUILD_DEFAULT_SERVER).replace(/\/$/, "");
|
|
12322
12332
|
const isJson = options["json"] === true;
|
|
12323
12333
|
const { key, source } = await resolveApiKey(root, server);
|
|
12324
12334
|
if (!key) {
|
package/package.json
CHANGED