Expand description
Glass — lightweight local browser control for Chrome and Chromium.
Drives Chrome or Chromium directly through the Chrome DevTools Protocol (CDP), without Playwright, WebDriver, or an embedded browser runtime.
§Quick start
Build a session with SessionOptions, start Chrome, navigate, and close
the session when the work is complete:
use glass::{BrowserSession, SessionOptions};
let options = SessionOptions::builder().build()?;
let session = BrowserSession::start(&options).await?;
let page = session.navigate("https://example.com").await?;
println!("{}", page.url);
session.close().await?;The browser module contains the reusable Rust API. The cli module
backs the glass binary, mcp exposes the MCP stdio server, and tui
provides the terminal interface. User-facing guides are available in the
repository’s docs.
§Cargo features
visual-compareenables PNG comparison helpers for screenshot checks.fuzzingenables test-oriented fuzzing hooks and is not needed by normal applications.
§Modules
browser— Chrome lifecycle, CDP client, DOM/accessibility parsing, mouse movement, security policy, profiles, and the centralBrowserSession.cli— Clap argument definitions and command dispatch.mcp— JSON-RPC/MCP stdio server for MCP-compatible clients.tui— Ratatui terminal interface.
Re-exports§
pub use browser::AccessibilityDiffSummary;pub use browser::ActionContractError;pub use browser::ActionFailureKind;pub use browser::ActionKind;pub use browser::ActionOutcome;pub use browser::ActionStatus;pub use browser::ActionVerificationEvidence;pub use browser::BrowserResult;pub use browser::BrowserSession;pub use browser::KnowledgeAssessment;pub use browser::KnowledgeAssessmentSignal;pub use browser::KnowledgeAssessmentStatus;pub use browser::KnowledgeConfidence;pub use browser::KnowledgeInvalidation;pub use browser::KnowledgeLifecycleEvent;pub use browser::KnowledgeLookupContext;pub use browser::KnowledgeLookupOptions;pub use browser::KnowledgeObservationMode;pub use browser::KnowledgeObservationReport;pub use browser::KnowledgeProfileScope;pub use browser::KnowledgePurgeResult;pub use browser::KnowledgeRecord;pub use browser::KnowledgeRecordBuildOptions;pub use browser::KnowledgeRecordKind;pub use browser::KnowledgeScope;pub use browser::KnowledgeSignalKind;pub use browser::KnowledgeSource;pub use browser::KnowledgeStore;pub use browser::KnowledgeStoreChange;pub use browser::KnowledgeStoreError;pub use browser::KnowledgeStoreLimits;pub use browser::KnowledgeStoreSnapshot;pub use browser::KnowledgeStoreStats;pub use browser::KnowledgeValidationError;pub use browser::PageInfo;pub use browser::SessionOptions;pub use browser::SessionOptionsBuilder;pub use browser::WORKFLOW_SCHEMA_VERSION;pub use browser::WorkflowBudgets;pub use browser::WorkflowCheckpoint;pub use browser::WorkflowCheckpointPage;pub use browser::WorkflowCheckpointStep;pub use browser::WorkflowDefinition;pub use browser::WorkflowInput;pub use browser::WorkflowOutput;pub use browser::WorkflowOutputDeclaration;pub use browser::WorkflowOutputSource;pub use browser::WorkflowResumeError;pub use browser::WorkflowResumePlan;pub use browser::WorkflowRunResult;pub use browser::WorkflowRunStatus;pub use browser::WorkflowStep;pub use browser::WorkflowStepRecord;pub use browser::WorkflowStepState;pub use browser::WorkflowTerminalProof;pub use browser::WorkflowTrace;pub use browser::WorkflowTraceEvent;pub use browser::WorkflowTransactionClass;pub use browser::WorkflowValidationError;pub use browser::WorkflowValueType;
Modules§
- browser
- Browser control modules and the reusable
browser::BrowserSessionAPI. - capabilities
- Versioned Glass protocol and capability negotiation. Versioned Glass protocol and capability negotiation.
- cli
- Command-line argument definitions and dispatch helpers. CLI argument parsing and command dispatch.
- daemon
- Local Unix-socket daemon lifecycle and MCP bridge. Local Unix-socket daemon lifecycle and client bridge.
- extensions
- Validated extension metadata and permission boundaries. Validated extension metadata and least-privilege permissions.
- mcp
- MCP stdio server, prompts, resources, and tool dispatch. Model Context Protocol (MCP) server.
- protocol
- Transport-neutral versioned request and response envelopes. Transport-neutral Glass request and response envelopes.
- reliability
- Versioned browser-free reliability scenario contracts. Browser-free reliability scenario contracts.
- reliability_
runner - Bounded browser execution for reliability scenarios and replay evidence. Bounded browser execution for versioned reliability scenarios.
- tui
- Ratatui terminal interface. Terminal user interface (Ratatui).