refactor(cli): rename nc to ncl

Rename the CLI binary, socket path, container wrapper, error prefixes,
and all references from `nc` to `ncl`. Add ~/.local/bin symlink during
setup and pnpm script alias.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
gavrielc
2026-05-08 15:56:09 +03:00
parent 33cbf59dd8
commit 0855369b79
15 changed files with 89 additions and 50 deletions
+4 -4
View File
@@ -110,10 +110,10 @@ RUN --mount=type=cache,target=/root/.cache/pnpm \
RUN --mount=type=cache,target=/root/.cache/pnpm \
pnpm install -g "@anthropic-ai/claude-code@${CLAUDE_CODE_VERSION}"
# ---- nc CLI wrapper ----------------------------------------------------------
# Actual script lives in the mounted source at /app/src/cli/nc.ts.
RUN printf '#!/bin/sh\nexec bun /app/src/cli/nc.ts "$@"\n' > /usr/local/bin/nc && \
chmod +x /usr/local/bin/nc
# ---- ncl CLI wrapper ----------------------------------------------------------
# Actual script lives in the mounted source at /app/src/cli/ncl.ts.
RUN printf '#!/bin/sh\nexec bun /app/src/cli/ncl.ts "$@"\n' > /usr/local/bin/ncl && \
chmod +x /usr/local/bin/ncl
# ---- Entrypoint --------------------------------------------------------------
COPY entrypoint.sh /app/entrypoint.sh
@@ -1,8 +1,8 @@
#!/usr/bin/env bun
/**
* nc NanoClaw CLI client (container edition).
* ncl NanoClaw CLI client (container edition).
*
* Same interface as the host-side `bin/nc`. Detects that it's inside a
* Same interface as the host-side `bin/ncl`. Detects that it's inside a
* container (the session DBs exist at /workspace/) and uses a DB transport
* instead of the Unix socket transport.
*
@@ -162,7 +162,7 @@ function parseArgv(argv: string[]): {
}
if (positional.length === 0) {
process.stderr.write('nc: missing command\n');
process.stderr.write('ncl: missing command\n');
printUsage();
process.exit(2);
}
@@ -179,7 +179,7 @@ function parseArgv(argv: string[]): {
function printUsage(): void {
process.stdout.write(
['Usage: nc <command> [--key value ...] [--json]', '', 'Run `nc help` to list available commands.', ''].join('\n'),
['Usage: ncl <command> [--key value ...] [--json]', '', 'Run `ncl help` to list available commands.', ''].join('\n'),
);
}
@@ -243,7 +243,7 @@ writeRequest(req);
const resp = pollResponse(requestId, 30_000);
if (!resp) {
process.stderr.write('nc: command timed out after 30s\n');
process.stderr.write('ncl: command timed out after 30s\n');
process.exit(2);
}