After cli-agent, prompt the user to connect a messaging app. For now only Telegram is offered; "skip" falls through to the existing CLI flow. setup/add-telegram.sh runs the scriptable half of /add-telegram: fetch the channels branch, copy the adapter + pair-telegram files, append the self-registration import, install @chat-adapter/telegram@4.26.0 (pinned to match the skill), rebuild, collect TELEGRAM_BOT_TOKEN via silent paste, write .env + data/env/env, and kick the service so the new adapter is live. Idempotent throughout. setup:auto then runs the existing `pair-telegram` step with --intent main. The step emits the 4-digit code in its status stream, which is already forwarded to stdout by runStep. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
47 lines
1.8 KiB
Bash
Executable File
47 lines
1.8 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
#
|
|
# NanoClaw — scripted end-to-end install.
|
|
#
|
|
# Runs `bash setup.sh` (bootstrap: Node check, pnpm install, native module
|
|
# verify), then `pnpm run setup:auto` (environment → container → onecli →
|
|
# auth → mounts → service → cli-agent → channel → verify).
|
|
#
|
|
# Everything that can be scripted runs unattended; the one interactive pause
|
|
# is the auth step (browser sign-in or paste token/API key).
|
|
#
|
|
# Config via env — passed through unchanged:
|
|
# NANOCLAW_SKIP comma-separated setup:auto step names to skip
|
|
# SECRET_NAME OneCLI secret name (default: Anthropic)
|
|
# HOST_PATTERN OneCLI host pattern (default: api.anthropic.com)
|
|
|
|
set -euo pipefail
|
|
|
|
PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
cd "$PROJECT_ROOT"
|
|
|
|
cat <<'EOF'
|
|
═══════════════════════════════════════════════════════════════
|
|
NanoClaw scripted setup
|
|
═══════════════════════════════════════════════════════════════
|
|
|
|
Phase 1: bootstrap (Node + pnpm + native modules)
|
|
|
|
EOF
|
|
|
|
if ! bash setup.sh; then
|
|
echo
|
|
echo "[nanoclaw.sh] Bootstrap failed. Inspect logs/setup.log and retry." >&2
|
|
exit 1
|
|
fi
|
|
|
|
cat <<'EOF'
|
|
|
|
═══════════════════════════════════════════════════════════════
|
|
Phase 2: setup:auto
|
|
═══════════════════════════════════════════════════════════════
|
|
|
|
EOF
|
|
|
|
# exec so signals (Ctrl-C) propagate directly to the child.
|
|
exec pnpm run setup:auto
|