Run initial NanoClaw setup. Use when user wants to install dependencies, authenticate WhatsApp, register their main channel, or start the background services. Triggers on "setup", "install", "configure nanoclaw", or first-time setup requests.
name setup description Run initial NanoClaw setup. Use when user wants to install dependencies, authenticate WhatsApp, register their main channel, or start the background services. Triggers on "setup", "install", "configure nanoclaw", or first-time setup requests. NanoClaw Setup Run all commands automatically. Only pause when user action is required (WhatsApp authentication, configuration choices). UX Note: When asking the user questions, prefer using the AskUserQuestion tool instead of just outputting text. This integrates with Claude's built-in question/answer system for a better experience.
. env Option 2: API Key Ask if they have an existing key to copy or need to create one. Copy existing: grep "^ANTHROPIC_API_KEY=" /path/to/source/.env > . env Create new: echo 'ANTHROPIC_API_KEY=' . env Tell the user to add their key from https://console.anthropic.com/ Verify: KEY=$(grep "^ANTHROPIC_API_KEY=" . env | cut -d= -f2) [ -n " $KEY " ] && echo "API key configured: ${KEY:0:7} ..." || echo "Missing"
~/.config/nanoclaw/mount-allowlist.json << 'EOF' { "allowedRoots" : [], "blockedPatterns" : [], "nonMainReadOnly" : true } EOF echo "Mount allowlist created - no external directories allowed" Skip to the next step. If yes , ask follow-up questions: 7a. Collect Directory Paths Ask the user: Which directories do you want to allow access to? You can specify: A parent folder like ~/projects (allows access to anything inside) Specific paths like ~/repos/my-app List them one per line, or give me a comma-separated list. For each directory they provide, ask: Should [directory] be read-write (agents can modify files) or read-only ? Read-write is needed for: code changes, creating files, git commits Read-only is safer for: reference docs, config examples, templates 7b. Configure Non-Main Group Access Ask the user: Should non-main groups (other WhatsApp chats you add later) be restricted to read-only access even if read-write is allowed for the directory? Recommended: Yes
/.config/nanoclaw/mount-allowlist.json << 'EOF' { "allowedRoots" : [ { "path" : "/projects" , "allowReadWrite" : true , "description" : "Development projects" }, { "path" : "~/docs" , "allowReadWrite" : false , "description" : "Reference documents" } ], "blockedPatterns" : [], "nonMainReadOnly" : true } EOF Verify the file: cat ~/.config/nanoclaw/mount-allowlist.json Tell the user: Mount allowlist configured. The following directories are now accessible: ~/projects (read-write)/docs (read-only) Security notes: Sensitive paths ( .ssh , .gnupg , .aws , credentials) are always blocked This config file is stored outside the project, so agents cannot modify it Changes require restarting the NanoClaw service To grant a group access to a directory, add it to their config in data/registered_groups.json : "containerConfig" : { "additionalMounts" : [ { "hostPath" : "/projects/my-app" } ] } The folder appears inside the container at /workspace/extra/<folder-name> (derived from the last segment of the path). Add "readonly": false for write access, or "containerPath": "custom-name" to override the default name.
~/Library/LaunchAgents/com.nanoclaw.plist << EOF