Global Installation
npx:
Usage
Modes
Start Web Dashboard (Default)
Runningfigranium with no arguments starts the full web dashboard at http://localhost:11345.
Scraper Mode (--scrape)
Runs a fast, one-off page scrape without full agent logic. Ideal for simple text extraction tasks.
--scrape:
| Flag | Description |
|---|---|
--url <url> | Required. Target URL to scrape. |
--selector <css> | CSS selector to extract text from. |
--output <file> | Optional file path to write the JSON result. |
--wait <seconds> | Seconds to wait after page load before extracting. |
--task <id> | Load a saved scrape task by ID (merged with other flags). |
Agent Mode (--agent)
Executes the full block-based automation engine for a saved task.
--agent:
| Flag | Description |
|---|---|
--task <id> | Required. Run a saved task by its ID. |
--url <url> | Override the task’s starting URL. |
- All step-by-step execution logs
- Final data output as formatted JSON
Headful Mode (--headful)
Launches a visible Chromium browser for manual inspection and debugging.
All Flags Reference
| Flag | Default | Description |
|---|---|---|
--scrape | — | Run in scrape mode |
--agent | — | Run in agent mode |
--headful | — | Open a visible browser |
--url <url> | — | Target URL |
--task <id> | — | Load a saved task by ID |
--selector <css> | — | CSS selector (scrape mode) |
--wait <seconds> | — | Seconds to wait after load |
--port <number> | 11345 | Web server port |
--help, -h | — | Show help message |
Environment Variables
All CLI modes respect the same environment variables as the server. Set them in your shell or a.env file:
| Variable | Description | Default |
|---|---|---|
PORT | Web dashboard port | 11345 |
SESSION_SECRET | Session cookie signing key | Auto-generated |
ALLOWED_IPS | Comma-separated IP allowlist | Open |
ALLOW_PRIVATE_NETWORKS | Allow scraping private IPs | true |
TRUST_PROXY | Honor X-Forwarded-* headers | false |
SESSION_COOKIE_SECURE | HTTPS-only session cookies | false |
HEADLESS | Set to false to see the browser (non-Docker) | true |
LOG_LEVEL | Logging verbosity | — |
DB_TYPE | Set to postgres for PostgreSQL storage | — |
Scripting and Automation
Combine CLI modes with shell scripts for automated pipelines:Exit Codes
| Code | Meaning |
|---|---|
0 | Success |
1 | Error (task not found, scrape/agent failed) |
Troubleshooting
Task not found:data/tasks.json. Retrieve the correct ID from the web dashboard URL or the REST API (GET /api/tasks).
Playwright browsers not installed:
npx playwright install chromium to download the required browser binaries.