GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: handle SIGPIPE gracefully, update agent docs · allthingssecurity/clibrowser@cb16f48

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • AGENTS.md
  • CLAUDE.md
  • Cargo.lock
  • Cargo.toml
  • release
    • clibrowser-darwin-arm64
    • clibrowser-v0.1.0-darwin-arm64.tar.gz
  • src
    • main.rs
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎AGENTS.md‎

Copy file name to clipboardExpand all lines: AGENTS.md
+40-4Lines changed: 40 additions & 4 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,30 @@
1010
- Monitor RSS feeds
1111
- Crawl sites
1212

13+
### IMPORTANT: Do NOT pipe commands together
14+
15+
Commands are **sequential, not piped**. Each command reads from the session state (cached page), not stdin.
16+
17+
```bash
18+
# WRONG — do not pipe:
19+
clibrowser get "https://example.com" --json | clibrowser markdown
20+
21+
# CORRECT — run sequentially:
22+
clibrowser --stealth get "https://example.com"
23+
clibrowser markdown --max-length 3000
24+
```
25+
26+
The `get` command fetches the page and caches it in the session. Then `markdown`, `text`, `select`, `links`, `tables`, and other extraction commands read from that cache.
27+
1328
### Essential commands
1429

1530
| Task | Command |
1631
|------|---------|
1732
| Search | `clibrowser --stealth search "query" -n 5 --json` |
18-
| Fetch page | `clibrowser --stealth get "https://url" --json` |
33+
| Search & go to first result | `clibrowser --stealth search "query" --lucky` |
34+
| Fetch page | `clibrowser --stealth get "https://url"` |
1935
| Read as markdown | `clibrowser markdown --max-length 3000` |
20-
| Extract text | `clibrowser text --strip --json` |
36+
| Extract text | `clibrowser text --strip` |
2137
| Get links | `clibrowser links --absolute --json` |
2238
| Follow link | `clibrowser click "a.selector" --json` |
2339
| CSS query | `clibrowser select "h1, .class" --json` |
@@ -26,11 +42,31 @@
2642
| Submit form | `clibrowser submit --json` |
2743
| RSS feed | `clibrowser rss "https://feed" -n 10 --json` |
2844
| Crawl site | `clibrowser crawl "https://url" --depth 2 --max-pages 10 --json` |
45+
| Sitemap | `clibrowser sitemap "https://site.com" --filter "docs" --json` |
2946
| Batch URLs | `echo "url1\nurl2" \| clibrowser pipe --title --json` |
3047

48+
### Typical workflow
49+
50+
```bash
51+
# Step 1: Fetch the page
52+
clibrowser --stealth get "https://example.com/article"
53+
54+
# Step 2: Read it (pick ONE of these)
55+
clibrowser markdown --max-length 5000 # as markdown
56+
clibrowser text --strip --max-length 3000 # as plain text
57+
clibrowser select "h1, h2, h3" --json # headings only
58+
clibrowser links --absolute --json # all links
59+
clibrowser tables --json # all tables
60+
61+
# Step 3: Navigate deeper
62+
clibrowser click "a.next-page" # follow a link
63+
clibrowser markdown --max-length 5000 # read the new page
64+
```
65+
3166
### Tips
32-
- Always use `--json` for parseable output
33-
- Use `--stealth` for Cloudflare-protected sites
67+
- Always use `--json` when you need to parse the output programmatically
68+
- Use `--stealth` for sites with bot detection (Cloudflare, etc.)
3469
- Use `--session name` for parallel browsing sessions
3570
- Exit codes: 0=success, 1=app error, 2=HTTP error, 3=network error
3671
- Every JSON response has `"ok": true/false` at top level
72+
- `get` saves the page; `text`/`markdown`/`select`/`links`/`tables` read from it
Collapse file

‎CLAUDE.md‎

Copy file name to clipboardExpand all lines: CLAUDE.md
+15-2Lines changed: 15 additions & 2 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,25 @@
22

33
`clibrowser` is installed at `~/.local/bin/clibrowser`. It is a CLI browser for AI agents — use it to browse the web, search, extract content, and interact with forms entirely via bash commands.
44

5+
## IMPORTANT: Commands are sequential, NOT piped
6+
7+
`get` fetches and caches the page. Then `markdown`/`text`/`select`/`links`/`tables` read from the cache.
8+
9+
```bash
10+
# CORRECT:
11+
clibrowser --stealth get "https://example.com"
12+
clibrowser markdown --max-length 3000
13+
14+
# WRONG — do NOT pipe:
15+
clibrowser get "https://url" --json | clibrowser markdown
16+
```
17+
518
## Quick reference
619

720
```bash
821
clibrowser --stealth search "query" --json # web search
922
clibrowser --stealth search "query" --lucky # search & navigate to first result
10-
clibrowser --stealth get "https://url" --json # fetch a page
23+
clibrowser --stealth get "https://url" # fetch a page
1124
clibrowser text --strip # extract text
1225
clibrowser markdown --max-length 3000 # convert page to markdown
1326
clibrowser links --absolute --json # extract links
@@ -23,4 +36,4 @@ clibrowser crawl "https://url" --depth 2 --json # crawl link tree
2336
echo "url1\nurl2" | clibrowser pipe --title --json # batch process URLs
2437
```
2538
26-
Always use `--json` for structured output you can parse. Use `--stealth` for sites with bot detection.
39+
Use `--json` for structured output. Use `--stealth` for sites with bot detection.
Collapse file

‎Cargo.lock‎

Copy file name to clipboardExpand all lines: Cargo.lock
+1Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Collapse file

‎Cargo.toml‎

Copy file name to clipboardExpand all lines: Cargo.toml
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ thiserror = "2"
1717
dirs = "6"
1818
chrono = { version = "0.4", features = ["serde"] }
1919
rand = "0.8"
20+
libc = "0.2"
Collapse file

‎release/clibrowser-darwin-arm64‎

Copy file name to clipboard
6.28 MB
Binary file not shown.
Collapse file

‎release/clibrowser-v0.1.0-darwin-arm64.tar.gz‎

Copy file name to clipboard
2.66 MB
Binary file not shown.
Collapse file

‎src/main.rs‎

Copy file name to clipboardExpand all lines: src/main.rs
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ use crate::session::Session;
1616

1717
#[tokio::main(flavor = "current_thread")]
1818
async fn main() {
19+
// Handle SIGPIPE gracefully (exit silently instead of panicking)
20+
// This happens when output is piped to another command that closes early
21+
#[cfg(unix)]
22+
unsafe {
23+
libc::signal(libc::SIGPIPE, libc::SIG_DFL);
24+
}
1925
let mut cli = Cli::parse();
2026
let stealth = cli.stealth;
2127

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.