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
5ccb721adc
commit
ee04c5d447
2 changed files with 11 additions and 10 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");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ import { cliVersion } from "./version.js";
|
|||
|
||||
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")
|
||||
|
|
@ -51,12 +51,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")
|
||||
|
|
@ -88,7 +88,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);
|
||||
|
|
@ -104,7 +104,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)")
|
||||
|
|
@ -122,7 +122,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