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:
Mikkel Georgsen 2026-03-30 23:50:37 +02:00
parent 0b7c62b419
commit 276f99da85
2 changed files with 13 additions and 11 deletions

View file

@ -1,4 +1,5 @@
import { URL } from "node:url"; import { URL } from "node:url";
import { VOCAB } from "@paperclipai/branding"; // [nexus]
export class ApiRequestError extends Error { export class ApiRequestError extends Error {
status: number; status: number;
@ -205,7 +206,7 @@ function buildConnectionErrorMessage(input: {
}): string { }): string {
const healthUrl = buildHealthCheckUrl(input.url); const healthUrl = buildHealthCheckUrl(input.url);
const lines = [ const lines = [
"Could not reach the Paperclip API.", `Could not reach the ${VOCAB.appName} API.`, // [nexus]
"", "",
`Request: ${input.method} ${input.url}`, `Request: ${input.method} ${input.url}`,
]; ];
@ -214,12 +215,12 @@ function buildConnectionErrorMessage(input: {
} }
lines.push( 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:", "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}\`.`, `- 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"); return lines.join("\n");
} }

View file

@ -20,14 +20,15 @@ import { loadPaperclipEnvFile } from "./config/env.js";
import { registerWorktreeCommands } from "./commands/worktree.js"; import { registerWorktreeCommands } from "./commands/worktree.js";
import { registerPluginCommands } from "./commands/client/plugin.js"; import { registerPluginCommands } from "./commands/client/plugin.js";
import { registerClientAuthCommands } from "./commands/client/auth.js"; import { registerClientAuthCommands } from "./commands/client/auth.js";
import { VOCAB } from "@paperclipai/branding"; // [nexus]
const program = new Command(); const program = new Command();
const DATA_DIR_OPTION_HELP = const DATA_DIR_OPTION_HELP =
"Paperclip data directory root (isolates state from ~/.paperclip)"; `${VOCAB.appName} data directory root (isolates state from ~/.nexus)`; // [nexus]
program program
.name("paperclipai") .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"); .version("0.2.7");
program.hook("preAction", (_thisCommand, actionCommand) => { program.hook("preAction", (_thisCommand, actionCommand) => {
@ -46,12 +47,12 @@ program
.option("-c, --config <path>", "Path to config file") .option("-c, --config <path>", "Path to config file")
.option("-d, --data-dir <path>", DATA_DIR_OPTION_HELP) .option("-d, --data-dir <path>", DATA_DIR_OPTION_HELP)
.option("-y, --yes", "Accept defaults (quickstart + start immediately)", false) .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); .action(onboard);
program program
.command("doctor") .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("-c, --config <path>", "Path to config file")
.option("-d, --data-dir <path>", DATA_DIR_OPTION_HELP) .option("-d, --data-dir <path>", DATA_DIR_OPTION_HELP)
.option("--repair", "Attempt to repair issues automatically") .option("--repair", "Attempt to repair issues automatically")
@ -83,7 +84,7 @@ program
.option("-d, --data-dir <path>", DATA_DIR_OPTION_HELP) .option("-d, --data-dir <path>", DATA_DIR_OPTION_HELP)
.option("--dir <path>", "Backup output directory (overrides config)") .option("--dir <path>", "Backup output directory (overrides config)")
.option("--retention-days <days>", "Retention window used for pruning", (value) => Number(value)) .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") .option("--json", "Print backup metadata as JSON")
.action(async (opts) => { .action(async (opts) => {
await dbBackupCommand(opts); await dbBackupCommand(opts);
@ -99,7 +100,7 @@ program
program program
.command("run") .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("-c, --config <path>", "Path to config file")
.option("-d, --data-dir <path>", DATA_DIR_OPTION_HELP) .option("-d, --data-dir <path>", DATA_DIR_OPTION_HELP)
.option("-i, --instance <id>", "Local instance id (default: default)") .option("-i, --instance <id>", "Local instance id (default: default)")
@ -117,7 +118,7 @@ heartbeat
.option("-d, --data-dir <path>", DATA_DIR_OPTION_HELP) .option("-d, --data-dir <path>", DATA_DIR_OPTION_HELP)
.option("--context <path>", "Path to CLI context file") .option("--context <path>", "Path to CLI context file")
.option("--profile <name>", "CLI context profile name") .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("--api-key <token>", "Bearer token for agent-authenticated calls")
.option( .option(
"--source <source>", "--source <source>",