CLI Usage
Thebrowsernode-cli
command-line interface provides multiple modes of operation for browser automation.
Installation
Get started with browsernode-cli immediately usingnpx
:
Modes of Operation
1. Interactive TUI Mode (Default)
Launch an interactive terminal UI where you can chat with the browser automation agent:- Type natural language commands to control the browser
- See real-time feedback from the agent
- View browser state and actions being performed
2. One-Shot Mode
Execute a single task without entering interactive mode:-p, --prompt
: The task to execute--headless
: Run browser in headless mode--model
: Specify LLM model (default: gpt-4o)
Configuration
Browsernode can be configured through environment variables and a configuration file.Configuration File Location
The default configuration file is located at:~/.config/browsernode/config.json
BROWSERNODE_CONFIG_PATH
environment variableBROWSERNODE_CONFIG_DIR
environment variable (directory containing config.json)
Configuration File Format
The configuration uses a database-style format with UUID entries:default: true
.
Environment Variables
Environment variables always override config.json values:General Settings
BROWSERNODE_LOGGING_LEVEL
: Logging level (debug, info, warning, error)BROWSERNODE_CONFIG_PATH
: Full path to config.json fileBROWSERNODE_CONFIG_DIR
: Directory containing config.json
Browser Profile Settings
BROWSERNODE_HEADLESS
: Run browser in headless mode (true/false)BROWSERNODE_ALLOWED_DOMAINS
: Comma-separated list of allowed domainsBROWSERNODE_USER_DATA_DIR
: Chrome user data directory path
LLM Settings
OPENAI_API_KEY
: OpenAI API keyANTHROPIC_API_KEY
: Anthropic API keyBROWSERNODE_LLM_MODEL
: LLM model to use (e.g., gpt-4o, claude-3-opus)
MCP-Specific Settings
When running in MCP mode, these environment variables are particularly useful:BROWSERNODE_HEADLESS
: Control browser visibilityOPENAI_API_KEY
: Required for agent-based tools
Browser Profiles Directory
Browser profiles are stored in:- Maintain separate browser sessions
- Keep cookies and local storage isolated
- Use different extensions per profile
Examples
Basic Usage
With Configuration
Troubleshooting
Common Issues
- Browser not launching: Ensure Chrome/Chromium is installed
- API key errors: Set appropriate API key environment variables
- Permission errors: Check file permissions in
~/.config/browsernode/