Skip to content
Figranium logo

CLI Tool & Standalone Scripts

figranium can be run entirely from the command line, either interactively or for automated scripting.

Global Installation#

npm install -g figranium

Commands#

Start Server#

Run the standard figranium server (API + UI).

figranium
# or
npx figranium

Modes#

Scraper Mode (--scrape)

Runs a high-performance scraping task without the full agent logic. Ideal for simple data extraction.

figranium --scrape --url "https://example.com" --selector ".content"
  • --url: Target URL.
  • --selector: CSS selector to extract text from.
  • --output: (Optional) File to save the result.

Headful Execution (--headful)

Launches a visible browser session for debugging.

figranium --headful --url "https://example.com"

Agent Mode (--agent)

Executes a saved task by ID or a JSON definition file.

figranium --agent --task "task_id_or_file.json"

Environment Variables#

CLI commands respect the same environment variables as the server:

  • PORT: Server port.
  • SESSION_SECRET: Session encryption key.
  • HEADLESS: Set to false to see the browser window (if running locally without Docker).

Scripting#

You can pipe JSON into figranium for complex workflows:

echo '{"url": "https://example.com", "actions": [{"type": "screenshot"}]}' | doppelganger --agent