mirror of
https://github.com/qwibitai/nanoclaw.git
synced 2026-06-04 10:14:47 +08:00
0855369b79
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>
28 lines
840 B
Bash
Executable File
28 lines
840 B
Bash
Executable File
#!/usr/bin/env bash
|
|
#
|
|
# ncl — NanoClaw CLI launcher.
|
|
#
|
|
# Resolves the project root from this script's location, cd's there so the
|
|
# host-resolved DATA_DIR matches the running host, and execs the TS entry
|
|
# via tsx. Symlink this file into a directory on your PATH (or alias `ncl`
|
|
# to its full path) to invoke from anywhere:
|
|
#
|
|
# ln -s "$(pwd)/bin/ncl" /usr/local/bin/ncl
|
|
# # or
|
|
# alias ncl="$(pwd)/bin/ncl"
|
|
|
|
set -euo pipefail
|
|
|
|
SCRIPT="${BASH_SOURCE[0]}"
|
|
# Resolve symlinks so PROJECT_ROOT points at the real checkout.
|
|
while [ -h "$SCRIPT" ]; do
|
|
DIR="$(cd -P "$(dirname "$SCRIPT")" && pwd)"
|
|
SCRIPT="$(readlink "$SCRIPT")"
|
|
[[ "$SCRIPT" != /* ]] && SCRIPT="$DIR/$SCRIPT"
|
|
done
|
|
SCRIPT_DIR="$(cd -P "$(dirname "$SCRIPT")" && pwd)"
|
|
PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
|
|
|
|
cd "$PROJECT_ROOT"
|
|
exec pnpm exec tsx src/cli/client.ts "$@"
|