feat(03-04): replace Paperclip display strings in CLI entry point and HTTP client
- Add VOCAB import to cli/src/index.ts and cli/src/client/http.ts
- Replace all 'Paperclip' description/help strings with VOCAB.appName
- Update backup filename prefix default from 'paperclip' to 'nexus'
- Update data dir help text to reference ~/.nexus
- Keep .name('paperclipai') binary name unchanged (CODE-zone)
This commit is contained in:
parent
0b7c62b419
commit
276f99da85
2 changed files with 13 additions and 11 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import { URL } from "node:url";
|
||||
import { VOCAB } from "@paperclipai/branding"; // [nexus]
|
||||
|
||||
export class ApiRequestError extends Error {
|
||||
status: number;
|
||||
|
|
@ -205,7 +206,7 @@ function buildConnectionErrorMessage(input: {
|
|||
}): string {
|
||||
const healthUrl = buildHealthCheckUrl(input.url);
|
||||
const lines = [
|
||||
"Could not reach the Paperclip API.",
|
||||
`Could not reach the ${VOCAB.appName} API.`, // [nexus]
|
||||
"",
|
||||
`Request: ${input.method} ${input.url}`,
|
||||
];
|
||||
|
|
@ -214,12 +215,12 @@ function buildConnectionErrorMessage(input: {
|
|||
}
|
||||
lines.push(
|
||||
"",
|
||||
"This usually means the Paperclip server is not running, the configured URL is wrong, or the request is being blocked before it reaches Paperclip.",
|
||||
`This usually means the ${VOCAB.appName} server is not running, the configured URL is wrong, or the request is being blocked before it reaches ${VOCAB.appName}.`, // [nexus]
|
||||
"",
|
||||
"Try:",
|
||||
"- Start Paperclip with `pnpm dev` or `pnpm paperclipai run`.",
|
||||
`- Start ${VOCAB.appName} with \`pnpm dev\` or \`pnpm paperclipai run\`.`, // [nexus]
|
||||
`- Verify the server is reachable with \`curl ${healthUrl}\`.`,
|
||||
`- If Paperclip is running elsewhere, pass \`--api-base ${input.apiBase.replace(/\/+$/, "")}\` or set \`PAPERCLIP_API_URL\`.`,
|
||||
`- If ${VOCAB.appName} is running elsewhere, pass \`--api-base ${input.apiBase.replace(/\/+$/, "")}\` or set \`PAPERCLIP_API_URL\`.`, // [nexus]
|
||||
);
|
||||
return lines.join("\n");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,14 +20,15 @@ import { loadPaperclipEnvFile } from "./config/env.js";
|
|||
import { registerWorktreeCommands } from "./commands/worktree.js";
|
||||
import { registerPluginCommands } from "./commands/client/plugin.js";
|
||||
import { registerClientAuthCommands } from "./commands/client/auth.js";
|
||||
import { VOCAB } from "@paperclipai/branding"; // [nexus]
|
||||
|
||||
const program = new Command();
|
||||
const DATA_DIR_OPTION_HELP =
|
||||
"Paperclip data directory root (isolates state from ~/.paperclip)";
|
||||
`${VOCAB.appName} data directory root (isolates state from ~/.nexus)`; // [nexus]
|
||||
|
||||
program
|
||||
.name("paperclipai")
|
||||
.description("Paperclip CLI — setup, diagnose, and configure your instance")
|
||||
.description(`${VOCAB.appName} CLI — setup, diagnose, and configure your instance`) // [nexus]
|
||||
.version("0.2.7");
|
||||
|
||||
program.hook("preAction", (_thisCommand, actionCommand) => {
|
||||
|
|
@ -46,12 +47,12 @@ program
|
|||
.option("-c, --config <path>", "Path to config file")
|
||||
.option("-d, --data-dir <path>", DATA_DIR_OPTION_HELP)
|
||||
.option("-y, --yes", "Accept defaults (quickstart + start immediately)", false)
|
||||
.option("--run", "Start Paperclip immediately after saving config", false)
|
||||
.option("--run", `Start ${VOCAB.appName} immediately after saving config`, false) // [nexus]
|
||||
.action(onboard);
|
||||
|
||||
program
|
||||
.command("doctor")
|
||||
.description("Run diagnostic checks on your Paperclip setup")
|
||||
.description(`Run diagnostic checks on your ${VOCAB.appName} setup`) // [nexus]
|
||||
.option("-c, --config <path>", "Path to config file")
|
||||
.option("-d, --data-dir <path>", DATA_DIR_OPTION_HELP)
|
||||
.option("--repair", "Attempt to repair issues automatically")
|
||||
|
|
@ -83,7 +84,7 @@ program
|
|||
.option("-d, --data-dir <path>", DATA_DIR_OPTION_HELP)
|
||||
.option("--dir <path>", "Backup output directory (overrides config)")
|
||||
.option("--retention-days <days>", "Retention window used for pruning", (value) => Number(value))
|
||||
.option("--filename-prefix <prefix>", "Backup filename prefix", "paperclip")
|
||||
.option("--filename-prefix <prefix>", "Backup filename prefix", "nexus") // [nexus]
|
||||
.option("--json", "Print backup metadata as JSON")
|
||||
.action(async (opts) => {
|
||||
await dbBackupCommand(opts);
|
||||
|
|
@ -99,7 +100,7 @@ program
|
|||
|
||||
program
|
||||
.command("run")
|
||||
.description("Bootstrap local setup (onboard + doctor) and run Paperclip")
|
||||
.description(`Bootstrap local setup (onboard + doctor) and run ${VOCAB.appName}`) // [nexus]
|
||||
.option("-c, --config <path>", "Path to config file")
|
||||
.option("-d, --data-dir <path>", DATA_DIR_OPTION_HELP)
|
||||
.option("-i, --instance <id>", "Local instance id (default: default)")
|
||||
|
|
@ -117,7 +118,7 @@ heartbeat
|
|||
.option("-d, --data-dir <path>", DATA_DIR_OPTION_HELP)
|
||||
.option("--context <path>", "Path to CLI context file")
|
||||
.option("--profile <name>", "CLI context profile name")
|
||||
.option("--api-base <url>", "Base URL for the Paperclip server API")
|
||||
.option("--api-base <url>", `Base URL for the ${VOCAB.appName} server API`) // [nexus]
|
||||
.option("--api-key <token>", "Bearer token for agent-authenticated calls")
|
||||
.option(
|
||||
"--source <source>",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue