Page Extraction CLI
maho page is the content-oriented side of the CLI. Where
maho tab manages browser state, maho page turns the rendered
page into data you can read, save, search, or pipe into another program.
The current page command family is:
maho page textmaho page markdownmaho page extract …maho headless <url>Use the live page commands when the page is already open in Maho. Use
headless when the URL itself is the input to your shell pipeline.
maho page text
Section titled “maho page text”Returns readable text from the rendered page rather than raw HTML.
maho page textmaho page text > article.txtThis is the lowest-noise format for ordinary Unix text tools:
maho page text | wc -wmaho page text | rg -n 'security|permission|credential'Use text when structure is not important and you primarily care about the words a user can read.
maho page markdown
Section titled “maho page markdown”Returns the rendered page as Markdown suitable for preserving headings, lists, links, and other document structure without carrying the full HTML DOM.
maho page markdownmaho page markdown > article.mdMarkdown is usually the best input for an LLM because it preserves useful semantic structure with substantially less markup noise than HTML:
maho page markdown \ | llm 'Summarize this page. Preserve the heading structure and cite section names.'A fact-extraction pipeline can stay equally small:
maho page markdown \ | llm 'Return only the product names, prices, and stated limitations as JSON.' \ | jq '.'llm in these examples is an external stdin-capable model CLI; it is not a
required Maho dependency. You can replace it with any local or cloud model tool
that reads stdin.
maho page extract
Section titled “maho page extract”extract is the structured extraction entry point for cases where full-page
text or Markdown is too broad.
maho page extract --helpPass the selector/extraction arguments shown by the installed build, then use
--json when the result will be processed programmatically:
maho --json page extract <extraction-arguments> | jq '.'This split is deliberate:
textis optimized for readable words.markdownpreserves document structure.extractis for targeted/structured page data.tab htmlis for the markup itself.
Headless rendering
Section titled “Headless rendering”maho headless <url>maho headless renders a URL through Maho without requiring you to prepare the
active GUI tab first, then writes the rendered page result to stdout.
maho headless https://example.comThis makes it a natural source command in pipelines:
maho headless https://example.com \ | llm 'Give me a one-paragraph summary and a list of outbound links mentioned in the content.'Or save the browser-rendered result before doing anything model-dependent:
maho headless https://example.com > rendered-page.txtllm 'Summarize the page and identify unsupported claims.' < rendered-page.txtThe second form is especially useful for debugging: you can inspect exactly what the browser produced before deciding whether a downstream model answer is wrong because of extraction or because of reasoning.
Headless vs curl
Section titled “Headless vs curl”curl downloads an HTTP response. maho headless goes through a browser
rendering path. That distinction matters for pages whose useful content appears
after client-side rendering or depends on browser/profile state.
Use curl when you want the wire response. Use maho headless when you want
browser-rendered page content.
Headless vs the active page
Section titled “Headless vs the active page”| Input | Command |
|---|---|
| The page already open in the browser | maho page text, markdown, or extract |
| A URL in a script | maho headless <url> |
| Raw DOM/markup from the current tab | maho tab html |
| Explicit trusted JavaScript against a tab | maho tab eval |
JSON pipelines
Section titled “JSON pipelines”Global --json is intended for structured CLI results. Put it at the Maho
boundary rather than trying to turn human-readable output back into JSON later:
maho --json page extract <extraction-arguments> \ | jq '.'For exploratory work, start with jq '.', inspect the actual result emitted by
your installed build, then narrow the query:
maho --json page extract <extraction-arguments> | jq '.'That avoids scripts depending on column spacing or a guessed wrapper object.
LLM pipeline recipes
Section titled “LLM pipeline recipes”Summarize the active article
Section titled “Summarize the active article”maho page markdown \ | llm 'Summarize in five bullets. Keep concrete dates, names, and numbers.'Extract claims that need verification
Section titled “Extract claims that need verification”maho page markdown \ | llm 'Return a JSON array of factual claims that should be independently verified.' \ | jq '.'Compare two URLs without copying pages by hand
Section titled “Compare two URLs without copying pages by hand”{ echo '# Source A' maho headless https://example.com/a echo '# Source B' maho headless https://example.com/b} | llm 'Compare these sources. List agreements, contradictions, and missing evidence.'Save before modeling
Section titled “Save before modeling”maho page markdown | tee /tmp/current-page.md \ | llm 'Produce a concise briefing from this page.'tee gives you an audit/debug copy of the exact extracted content that entered
the model pipeline.
Security boundary
Section titled “Security boundary”Page extraction can expose whatever the selected browser surface is allowed to read. Treat stdout as potentially sensitive data: shell history, redirected files, terminal scrollback, and downstream programs are all outside the page once content has been emitted.
MCP uses a stricter typed tool surface with browser-side redaction and approval
policies. In particular, the MCP server intentionally does not expose the CLI’s
generic JavaScript evaluation primitive. If an AI client should choose browser
actions dynamically, use maho mcp rather than wrapping
maho tab eval as an agent tool.
Related commands
Section titled “Related commands”- Browser Control CLI for tabs, history, and bookmarks.
- MCP Server for Claude Desktop, Cursor, and other MCP clients.