### Install and Start Mini-Claw Service with systemd Source: https://github.com/htlin222/mini-claw/blob/main/README.md Use these commands to install the Mini-Claw systemd service, start it, and ensure it runs on boot. ```bash make install-service systemctl --user start mini-claw systemctl --user enable mini-claw ``` -------------------------------- ### Mini-Claw Quick Start Commands Source: https://github.com/htlin222/mini-claw/blob/main/CLAUDE.md Provides essential commands to install dependencies, log in to the AI provider, configure the bot, and start the Mini-Claw service. ```bash # 1. Install dependencies make install # 2. Login to AI provider (Claude/ChatGPT) make login # 3. Configure Telegram bot token cp .env.example .env # Edit .env with your TELEGRAM_BOT_TOKEN # 4. Start the bot make start ``` -------------------------------- ### Install and Configure Mini-Claw Bot Source: https://github.com/htlin222/mini-claw/blob/main/README.md Clone the repository, install dependencies, log in to your AI provider, configure the Telegram bot token, and start the bot. ```bash git clone https://github.com/htlin222/mini-claw cd mini-claw pnpm install pi /login cp .env.example .env # Edit .env with your TELEGRAM_BOT_TOKEN pnpm start ``` -------------------------------- ### Build and Run Mini-Claw with Make Source: https://github.com/htlin222/mini-claw/blob/main/README.md Utilize make commands for common development tasks such as installation, authentication, development mode, production start, and testing. ```bash make install # Install dependencies make login # Authenticate with AI provider make dev # Development mode (watch) make start # Production mode make test # Run tests ``` -------------------------------- ### Quick Start: Fetch and Screenshot Source: https://github.com/htlin222/mini-claw/blob/main/skills/playwright/README.md Fetch page content and save a screenshot to a file. ```bash # Fetch and take screenshot pw fetch example.com -o /tmp/screenshot.png ``` -------------------------------- ### Example: Get Page Content Source: https://github.com/htlin222/mini-claw/blob/main/skills/playwright/README.md Fetch the content of a website and display the JSON output. ```bash pw fetch news.ycombinator.com # Returns: {"success": true, "content": "...", ...} ``` -------------------------------- ### Quick Start: Full Page Screenshot Source: https://github.com/htlin222/mini-claw/blob/main/skills/playwright/README.md Fetch page content and save a full-page screenshot. ```bash # Full page screenshot pw fetch example.com -o /tmp/full.png --full-page ``` -------------------------------- ### Example: Fill and Submit Form Source: https://github.com/htlin222/mini-claw/blob/main/skills/playwright/README.md Demonstrates navigating to a login page, filling in credentials, and submitting the form. ```bash pw navigate example.com/login pw fill "input[name=email]" "user@example.com" pw fill "input[name=password]" "secret123" pw click "button[type=submit]" ``` -------------------------------- ### Quick Start: Fetch Page Content Source: https://github.com/htlin222/mini-claw/blob/main/skills/playwright/README.md Fetch the text content of a webpage. ```bash # Fetch page content pw fetch example.com ``` -------------------------------- ### Example: Screenshot Website Source: https://github.com/htlin222/mini-claw/blob/main/skills/playwright/README.md Fetch a website and save a screenshot to a specified file path, showing the JSON output. ```bash pw fetch github.com -o /tmp/github.png # Returns: {"success": true, "screenshot": "/tmp/github.png", ...} ``` -------------------------------- ### Deployment with systemd Source: https://github.com/htlin222/mini-claw/blob/main/CLAUDE.md Instructions for installing and managing the Mini-Claw bot as a systemd user service on Linux. ```bash make install-service # Creates systemd user service systemctl --user start mini-claw systemctl --user enable mini-claw ``` -------------------------------- ### Selectors: CSS Source: https://github.com/htlin222/mini-claw/blob/main/skills/playwright/README.md Examples of using standard CSS selectors to target elements. ```bash # CSS selectors pw click "button.submit" pw click "#login-form input[type=email]" ``` -------------------------------- ### Start Mini-Claw within a tmux session Source: https://github.com/htlin222/mini-claw/blob/main/README.md Create a new tmux session named 'mini-claw', start the application, and detach from the session. ```bash tmux new -s mini-claw pnpm start # Ctrl+B, D to detach ``` -------------------------------- ### Fetch Command: Get Page Text Source: https://github.com/htlin222/mini-claw/blob/main/skills/playwright/README.md Use the fetch command to get the text content of a specified URL. ```bash # Get page text content pw fetch ``` -------------------------------- ### Fetch Command: Get Page HTML Source: https://github.com/htlin222/mini-claw/blob/main/skills/playwright/README.md Use the fetch command with the --format html option to retrieve the full HTML of a page. ```bash # Get page HTML pw fetch --format html ``` -------------------------------- ### Makefile Commands for Mini-Claw Source: https://github.com/htlin222/mini-claw/blob/main/CLAUDE.md These commands are used to manage the Mini-Claw project, including installation, authentication, development, production deployment, status checks, and cleanup. ```bash make install ``` ```bash make login ``` ```bash make dev ``` ```bash make start ``` ```bash make status ``` ```bash make clean ``` -------------------------------- ### Output Format: Success Response Source: https://github.com/htlin222/mini-claw/blob/main/skills/playwright/README.md Example of a successful JSON response from a Playwright CLI command. ```json { "success": true, "url": "https://example.com", "title": "Example Domain", "content": "...", "timestamp": "2024-01-15T10:30:00.000Z" } ``` -------------------------------- ### Example: Extract Specific Element Text Source: https://github.com/htlin222/mini-claw/blob/main/skills/playwright/README.md Navigate to a page and extract the text content of a specific element, showing the JSON result. ```bash pw navigate example.com pw text "h1" # {"success": true, "text": "Example Domain", ...} ``` -------------------------------- ### Output Format: Error Response Source: https://github.com/htlin222/mini-claw/blob/main/skills/playwright/README.md Example of an error JSON response from a Playwright CLI command. ```json { "success": false, "error": "Element not found", "timestamp": "2024-01-15T10:30:00.000Z" } ``` -------------------------------- ### Deployment with tmux Source: https://github.com/htlin222/mini-claw/blob/main/CLAUDE.md Manual deployment instructions using tmux to run the Mini-Claw bot in a new session. ```bash tmux new -s mini-claw make start # Ctrl+B, D to detach ``` -------------------------------- ### Deployment with pm2 Source: https://github.com/htlin222/mini-claw/blob/main/CLAUDE.md Steps to build and deploy the Mini-Claw bot using pm2 process manager. ```bash pnpm build pm2 start dist/index.js --name mini-claw pm2 save ``` -------------------------------- ### Login to Pi Source: https://github.com/htlin222/mini-claw/blob/main/CLAUDE.md Use this command to authenticate with Pi. Ensure Pi is set up before attempting to log in. ```bash make login # or pi /login ``` -------------------------------- ### Navigation: Go to URL Source: https://github.com/htlin222/mini-claw/blob/main/skills/playwright/README.md Navigate to a specified URL. The command automatically prepends 'https://' if not present. ```bash pw navigate # Go to URL (auto-adds https://) ``` -------------------------------- ### Authentication Flow Steps Source: https://github.com/htlin222/mini-claw/blob/main/CLAUDE.md Steps to authenticate with the bot, involving selecting a provider and completing OAuth. Credentials are saved to ~/.pi/agent/auth.json. ```text 1. Run `make login` (or `pi /login`) 2. Select provider: Anthropic (Claude) or OpenAI (ChatGPT) 3. Complete OAuth in browser 4. Credentials saved to ~/.pi/agent/auth.json 5. Bot uses same credentials automatically ``` -------------------------------- ### Navigation: Go Forward Source: https://github.com/htlin222/mini-claw/blob/main/skills/playwright/README.md Navigate to the next page in the browser history. ```bash pw forward # Go forward ``` -------------------------------- ### Development Commands for Mini-Claw Source: https://github.com/htlin222/mini-claw/blob/main/README.md Run these commands for development tasks. Use 'pnpm dev' for continuous development with watch mode, 'pnpm typecheck' for static analysis, and 'pnpm test' for running unit tests. ```bash # Run in watch mode pnpm dev # Type checking pnpm typecheck # Run tests pnpm test # Run tests with coverage pnpm test:coverage ``` -------------------------------- ### Mini-Claw Directory Structure Source: https://github.com/htlin222/mini-claw/blob/main/CLAUDE.md Shows the organization of files and directories within the Mini-Claw project. ```text mini-claw/ ├── CLAUDE.md # This file ├── Makefile # Quick commands ├── package.json ├── tsconfig.json ├── .env.example # Environment template ├── src/ │ ├── index.ts # Entry point │ ├── bot.ts # Telegram bot setup │ ├── pi-runner.ts # Pi agent wrapper │ └── config.ts # Configuration └── scripts/ └── setup-pi.sh # Pi login helper ``` -------------------------------- ### Navigation: Go Back Source: https://github.com/htlin222/mini-claw/blob/main/skills/playwright/README.md Navigate to the previous page in the browser history. ```bash pw back # Go back ``` -------------------------------- ### Development Commands Source: https://github.com/htlin222/mini-claw/blob/main/CLAUDE.md Commands for development, including watch mode, type checking, and linting. ```bash # Watch mode make dev ``` ```bash # Type check pnpm typecheck ``` ```bash # Lint pnpm lint ``` -------------------------------- ### Fetch Command: Take Screenshot Source: https://github.com/htlin222/mini-claw/blob/main/skills/playwright/README.md Use the fetch command with the -o option to take a screenshot and save it to a specified path. ```bash # Take screenshot pw fetch -o /path/to/screenshot.png ``` -------------------------------- ### Fetch Command: Full Page Screenshot Source: https://github.com/htlin222/mini-claw/blob/main/skills/playwright/README.md Use the fetch command with --full-page to capture the entire scrollable page. ```bash # Full page screenshot pw fetch -o /path/to/screenshot.png --full-page ``` -------------------------------- ### Configure Environment Variables for Mini-Claw Source: https://github.com/htlin222/mini-claw/blob/main/README.md Set these environment variables to configure your Mini-Claw instance. The TELEGRAM_BOT_TOKEN is mandatory. Optional variables control workspace, session directories, AI interaction levels, allowed users, and various timeouts. ```bash # Required TELEGRAM_BOT_TOKEN=your_bot_token # Optional MINI_CLAW_WORKSPACE=/path/to/workspace # Default: ~/mini-claw-workspace MINI_CLAW_SESSION_DIR=~/.mini-claw/sessions PI_THINKING_LEVEL=low # low | medium | high ALLOWED_USERS=123456,789012 # Comma-separated user IDs # Rate limiting & timeouts (milliseconds) RATE_LIMIT_COOLDOWN_MS=5000 # Default: 5 seconds PI_TIMEOUT_MS=300000 # Default: 5 minutes SHELL_TIMEOUT_MS=60000 # Default: 60 seconds # Web search (optional) BRAVE_API_KEY=your_brave_api_key # For Pi web search skill ``` -------------------------------- ### Screenshot: Full Page Source: https://github.com/htlin222/mini-claw/blob/main/skills/playwright/README.md Capture the entire scrollable page as a screenshot. ```bash pw screenshot --full-page # Capture entire page ``` -------------------------------- ### Screenshot: Default Location Source: https://github.com/htlin222/mini-claw/blob/main/skills/playwright/README.md Take a screenshot and save it to the default configured location. ```bash pw screenshot # Save to default location ``` -------------------------------- ### Mini-Claw Architecture Diagram Source: https://github.com/htlin222/mini-claw/blob/main/CLAUDE.md Illustrates the interaction flow between Telegram, the Mini-Claw bot, and the Pi Agent, including session storage. ```text ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │ Telegram │────►│ Mini-Claw │────►│ Pi Agent │ │ (User) │◄────│ (Bot) │◄────│ (Session) │ └─────────────┘ └─────────────┘ └─────────────┘ │ ▼ ~/.mini-claw/ └── sessions/ └── telegram-.jsonl ``` -------------------------------- ### Navigation: Reload Page Source: https://github.com/htlin222/mini-claw/blob/main/skills/playwright/README.md Reload the current page. ```bash pw reload # Reload page ``` -------------------------------- ### Screenshot: Specific Path Source: https://github.com/htlin222/mini-claw/blob/main/skills/playwright/README.md Take a screenshot and save it to a user-specified file path. ```bash pw screenshot -o /path/to/file.png # Save to specific path ``` -------------------------------- ### Environment Variables for Mini-Claw Configuration Source: https://github.com/htlin222/mini-claw/blob/main/CLAUDE.md These environment variables configure the Mini-Claw bot's behavior, including Telegram integration, workspace paths, AI interaction levels, allowed users, and various rate limits and timeouts. ```bash # Required TELEGRAM_BOT_TOKEN=your_telegram_bot_token # Optional MINI_CLAW_WORKSPACE=/path/to/workspace # Default: ~/mini-claw-workspace MINI_CLAW_SESSION_DIR=~/.mini-claw/sessions PI_THINKING_LEVEL=low # low | medium | high ALLOWED_USERS=123,456 # Comma-separated user IDs (empty = allow all) # Rate Limiting & Timeouts (all in milliseconds) RATE_LIMIT_COOLDOWN_MS=5000 # Default: 5 seconds between messages PI_TIMEOUT_MS=300000 # Default: 5 minutes SHELL_TIMEOUT_MS=60000 # Default: 60 seconds SESSION_TITLE_TIMEOUT_MS=10000 # Default: 10 seconds ``` -------------------------------- ### Interaction: Press Key Source: https://github.com/htlin222/mini-claw/blob/main/skills/playwright/README.md Simulate pressing a keyboard key, such as Enter, Tab, or Escape. ```bash pw press # Press key (Enter, Tab, Escape, etc.) ``` -------------------------------- ### Interaction: Focus Element Source: https://github.com/htlin222/mini-claw/blob/main/skills/playwright/README.md Set the keyboard focus to a specified element. ```bash pw focus # Focus element ``` -------------------------------- ### Selectors: Role Source: https://github.com/htlin222/mini-claw/blob/main/skills/playwright/README.md Use role selectors to target elements based on their accessibility role and name. ```bash # Role selectors pw click "role=button[name='Submit']" ``` -------------------------------- ### Wait: Navigation Source: https://github.com/htlin222/mini-claw/blob/main/skills/playwright/README.md Pause execution until a page navigation event completes. ```bash pw wait-navigation # Wait for navigation ``` -------------------------------- ### Wait: Text Source: https://github.com/htlin222/mini-claw/blob/main/skills/playwright/README.md Pause execution until specific text is found on the page. ```bash pw wait-text # Wait for text on page ``` -------------------------------- ### Selectors: Text Source: https://github.com/htlin222/mini-claw/blob/main/skills/playwright/README.md Use the 'text=' prefix to select elements based on their visible text content. ```bash # Text selectors pw click "text=Submit" ``` -------------------------------- ### Wait: Selector Source: https://github.com/htlin222/mini-claw/blob/main/skills/playwright/README.md Pause execution until an element matching the selector appears on the page. ```bash pw wait-selector # Wait for element ``` -------------------------------- ### Session: Close Source: https://github.com/htlin222/mini-claw/blob/main/skills/playwright/README.md Terminate the current browser session. ```bash pw close # Close browser ``` -------------------------------- ### Session: Status Source: https://github.com/htlin222/mini-claw/blob/main/skills/playwright/README.md Check the current status of the browser session. ```bash pw status # Check browser status ``` -------------------------------- ### Interaction: Type Text Source: https://github.com/htlin222/mini-claw/blob/main/skills/playwright/README.md Type text into an input field. This action appends text if the field is not empty. ```bash pw type # Type text (appends) ``` -------------------------------- ### Fetch Command: Explicit Screenshot Flag Source: https://github.com/htlin222/mini-claw/blob/main/skills/playwright/README.md The --screenshot flag is an alternative to the -o option for taking screenshots. ```bash # Explicit screenshot flag (same as -o) pw fetch --screenshot ``` -------------------------------- ### Interaction: Select Dropdown Option Source: https://github.com/htlin222/mini-claw/blob/main/skills/playwright/README.md Select a specific option within a dropdown element. ```bash pw select # Select dropdown option ``` -------------------------------- ### Content Extraction: Page HTML Source: https://github.com/htlin222/mini-claw/blob/main/skills/playwright/README.md Extract the full HTML source of the current page. ```bash pw content --format html # Get page HTML ``` -------------------------------- ### Interaction: Hover Element Source: https://github.com/htlin222/mini-claw/blob/main/skills/playwright/README.md Move the mouse cursor over a specified element. ```bash pw hover # Hover over element ``` -------------------------------- ### Content Extraction: Accessibility Tree Source: https://github.com/htlin222/mini-claw/blob/main/skills/playwright/README.md Retrieve the accessibility tree of the current page. ```bash pw snapshot # Get accessibility tree ``` -------------------------------- ### Interaction: Fill Input Source: https://github.com/htlin222/mini-claw/blob/main/skills/playwright/README.md Fill an input field with a specified value, replacing any existing content. ```bash pw fill # Fill input (replaces) ``` -------------------------------- ### Interaction: Click Element Source: https://github.com/htlin222/mini-claw/blob/main/skills/playwright/README.md Perform a click action on a specified element identified by a selector. ```bash pw click # Click element ``` -------------------------------- ### Check for Running Pi Processes Source: https://github.com/htlin222/mini-claw/blob/main/CLAUDE.md Use this command to identify if another Pi process is currently running and potentially locking the session file. This helps in diagnosing 'Session file locked' errors. ```bash ps aux | grep pi ``` -------------------------------- ### Content Extraction: Page Text Source: https://github.com/htlin222/mini-claw/blob/main/skills/playwright/README.md Extract all visible text content from the current page. ```bash pw content # Get page text ``` -------------------------------- ### Force Context Compaction in Telegram Source: https://github.com/htlin222/mini-claw/blob/main/CLAUDE.md If experiencing 'Context overflow' errors, this command can be used within Telegram to manually trigger context compaction for the Pi session. ```bash # In Telegram /compact ``` -------------------------------- ### Wait: Milliseconds Source: https://github.com/htlin222/mini-claw/blob/main/skills/playwright/README.md Pause execution for a specified number of milliseconds. ```bash pw wait # Wait milliseconds ``` -------------------------------- ### Content Extraction: Element Text Source: https://github.com/htlin222/mini-claw/blob/main/skills/playwright/README.md Extract the visible text content of a specific element identified by a selector. ```bash pw text # Get element text ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.