mirror of
https://github.com/actionbook/actionbook.git
synced 2026-09-19 03:28:06 +08:00
a35ba49827
- P2-1: `app attach [port]` → `app attach <target>` (required argument) - P2-2: `--port` → `--cdp` (correct global flag for CDP port) - P2-3: Remove invalid custom-path launch fallback; show manual start + attach workflow instead Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
252 lines
4.4 KiB
Plaintext
252 lines
4.4 KiB
Plaintext
---
|
|
title: "CLI Reference"
|
|
description: "Detailed reference for Actionbook CLI commands"
|
|
---
|
|
|
|
# CLI Reference
|
|
|
|
The Actionbook CLI (`actionbook`) is the primary interface for interacting with Actionbook.
|
|
|
|
## `actionbook search`
|
|
|
|
Search for available action manuals.
|
|
|
|
**Usage:**
|
|
|
|
```bash
|
|
actionbook search [query]
|
|
```
|
|
|
|
**Arguments:**
|
|
|
|
- `query`: The search keyword (e.g., "airbnb", "google login").
|
|
|
|
**Example:**
|
|
|
|
```bash
|
|
actionbook search "airbnb search"
|
|
```
|
|
|
|
## `actionbook get`
|
|
|
|
Retrieve a specific action manual by its ID.
|
|
|
|
**Usage:**
|
|
|
|
```bash
|
|
actionbook get [actionId]
|
|
```
|
|
|
|
**Arguments:**
|
|
|
|
- `actionId`: The unique identifier of the action.
|
|
|
|
**Example:**
|
|
|
|
```bash
|
|
actionbook get "site/airbnb.com/page/home/element/search-button"
|
|
```
|
|
|
|
## `actionbook setup`
|
|
|
|
Initial setup wizard for API key, browser preferences, health checks, and optional skills install.
|
|
|
|
Run this once, then use the same `actionbook browser ...` commands regardless of mode.
|
|
|
|
**Usage:**
|
|
|
|
```bash
|
|
actionbook setup
|
|
```
|
|
|
|
---
|
|
|
|
## `actionbook browser`
|
|
|
|
Browser automation commands.
|
|
|
|
<Note>
|
|
After `actionbook setup`, browser command syntax is identical across modes.
|
|
</Note>
|
|
|
|
### `actionbook browser open`
|
|
|
|
Open a URL in the browser.
|
|
|
|
**Usage:**
|
|
|
|
```bash
|
|
actionbook browser open [url]
|
|
```
|
|
|
|
### `actionbook browser click`
|
|
|
|
Click an element on the current page.
|
|
|
|
**Usage:**
|
|
|
|
```bash
|
|
actionbook browser click [selector]
|
|
```
|
|
|
|
**Arguments:**
|
|
|
|
- `selector`: The CSS selector, XPath, or other supported selector string.
|
|
|
|
### `actionbook browser fill`
|
|
|
|
Fill an input field with text.
|
|
|
|
**Usage:**
|
|
|
|
```bash
|
|
actionbook browser fill [selector] [value]
|
|
```
|
|
|
|
**Arguments:**
|
|
|
|
- `selector`: The target input element selector.
|
|
- `value`: The text value to input.
|
|
|
|
### Global Flags
|
|
|
|
These flags apply to all `actionbook browser` subcommands:
|
|
|
|
- `--json` — Output results in JSON format.
|
|
|
|
---
|
|
|
|
## `actionbook app`
|
|
|
|
Automate desktop applications built with Electron (VS Code, Slack, Discord, Figma, Notion, Spotify, etc.) using Chrome DevTools Protocol.
|
|
|
|
<Note>
|
|
All `browser` commands work with `app` prefix. Full feature parity with 35+ automation commands.
|
|
</Note>
|
|
|
|
### App-Specific Commands
|
|
|
|
#### `actionbook app launch`
|
|
|
|
Auto-discover and launch an Electron application.
|
|
|
|
**Usage:**
|
|
|
|
```bash
|
|
actionbook app launch [name]
|
|
```
|
|
|
|
**Arguments:**
|
|
|
|
- `name`: The application name (e.g., "Visual Studio Code", "Slack", "Discord").
|
|
|
|
**Example:**
|
|
|
|
```bash
|
|
actionbook app launch "Visual Studio Code"
|
|
actionbook app launch Slack
|
|
```
|
|
|
|
#### `actionbook app attach`
|
|
|
|
Attach to a running Electron app by name, port, or WebSocket URL.
|
|
|
|
**Usage:**
|
|
|
|
```bash
|
|
actionbook app attach <target>
|
|
```
|
|
|
|
**Arguments:**
|
|
|
|
- `target` (required): Application name, bundle ID, CDP port, or WebSocket URL.
|
|
|
|
**Example:**
|
|
|
|
```bash
|
|
actionbook app attach 9222
|
|
```
|
|
|
|
#### `actionbook app list`
|
|
|
|
List all discoverable Electron applications on the system.
|
|
|
|
**Usage:**
|
|
|
|
```bash
|
|
actionbook app list
|
|
```
|
|
|
|
#### `actionbook app status`
|
|
|
|
Show current app connection status.
|
|
|
|
**Usage:**
|
|
|
|
```bash
|
|
actionbook app status
|
|
```
|
|
|
|
#### `actionbook app close`
|
|
|
|
Close the connected application.
|
|
|
|
**Usage:**
|
|
|
|
```bash
|
|
actionbook app close
|
|
```
|
|
|
|
#### `actionbook app restart`
|
|
|
|
Restart the application (preserves session).
|
|
|
|
**Usage:**
|
|
|
|
```bash
|
|
actionbook app restart
|
|
```
|
|
|
|
### All Browser Commands Available
|
|
|
|
Every `browser` command works with the `app` prefix. This includes:
|
|
|
|
**Navigation:**
|
|
- `actionbook app goto <URL>`
|
|
|
|
**Interaction:**
|
|
- `actionbook app click <SELECTOR>`
|
|
- `actionbook app type <TEXT> [SELECTOR]`
|
|
- `actionbook app fill <TEXT> [SELECTOR]`
|
|
- `actionbook app hotkey "Control+C"`
|
|
|
|
**Analysis:**
|
|
- `actionbook app snapshot [--format compact]`
|
|
- `actionbook app screenshot output.png`
|
|
- `actionbook app eval "document.title"`
|
|
|
|
**Tab Management:**
|
|
- `actionbook app tab list`
|
|
- `actionbook app tab new`
|
|
- `actionbook app tab switch <PAGE_ID>`
|
|
|
|
**Advanced Features:**
|
|
- Shadow DOM support (`:shadow-root` selector)
|
|
- IFrame context switching
|
|
- Keyboard hotkeys (single and multi-modifier)
|
|
- Scroll with wait for lazy-loaded content
|
|
|
|
See the [App Automation Guide](/guides/app-use) for detailed examples and workflows.
|
|
|
|
### Supported Applications
|
|
|
|
| Application | macOS | Linux | Windows |
|
|
|-------------|-------|-------|---------|
|
|
| Visual Studio Code | ✅ | ✅ | ✅ |
|
|
| Slack | ✅ | ✅ | ✅ |
|
|
| Discord | ✅ | ✅ | ✅ |
|
|
| Figma | ✅ | ✅ | ✅ |
|
|
| Notion | ✅ | ✅ | ✅ |
|
|
| Spotify | ✅ | ✅ | ✅ |
|
|
| Any Electron App | ✅ | ✅ | ✅ |
|