···11+---
22+description: Refactor code to be simpler while maintaining identical functionality
33+---
44+55+Refactor $ARGUMENTS to be simpler, clearer, and more maintainable without changing what it does.
66+77+## Objective
88+99+Simplify and clean the code. Implementation should be straightforward and pragmatic. The goal is to get the most minimal code possible.
1010+1111+## Principles
1212+1313+- Behavior parity. Keep interfaces and semantics identical. No new features. Preserve flags, return codes, and observable side effects.
1414+- KISS. Prefer boring, obvious solutions over cleverness. Fewer moving parts over fewer lines.
1515+- Small pieces. Favor small, composable functions. Design for easy deletion and iteration.
1616+- Prune aggressively. Remove dead code, unused vars, redundant branches, defensive over-engineering, and needless indirection.
1717+- Flatten flow. Simplify complex conditionals and deep nesting. Use clear guards and early returns.
1818+- Standard library first. Replace custom utilities with modern built-ins and framework primitives.
1919+- Fail early and often. Avoid blanket try/catch blocks. Skip unnecessary validations.
2020+- Communicate with types. Use types to express contracts and invariants. Avoid type acrobatics and generic abstractions.
2121+- Abstractions when earned. Introduce or keep abstractions only when they reduce duplication or isolate likely change.
2222+- Minimal deps. Do not add dependencies unless they materially simplify and are commonly available for the target runtime.
2323+- No micro-optimizations unless they remove complexity or are explicitly required.
2424+- Make rules explicit. Turn hidden assumptions into defaults, parameters, or assertions.
2525+- Naming for intent. Prefer clear, intention-revealing names. One responsibility per function or module.
···11---
22name: agent-browser
33description: Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction.
44+allowed-tools: Bash(npx agent-browser:*), Bash(agent-browser:*)
45---
5667# Browser Automation with agent-browser
···2627agent-browser snapshot -i # Check result
2728```
28293030+## Command Chaining
3131+3232+Commands can be chained with `&&` in a single shell invocation. The browser persists between commands via a background daemon, so chaining is safe and more efficient than separate calls.
3333+3434+```bash
3535+# Chain open + wait + snapshot in one call
3636+agent-browser open https://example.com && agent-browser wait --load networkidle && agent-browser snapshot -i
3737+3838+# Chain multiple interactions
3939+agent-browser fill @e1 "user@example.com" && agent-browser fill @e2 "password123" && agent-browser click @e3
4040+4141+# Navigate and capture
4242+agent-browser open https://example.com && agent-browser wait --load networkidle && agent-browser screenshot page.png
4343+```
4444+4545+**When to chain:** Use `&&` when you don't need to read the output of an intermediate command before proceeding (e.g., open + wait + screenshot). Run commands separately when you need to parse the output first (e.g., snapshot to discover refs, then interact using those refs).
4646+2947## Essential Commands
30483149```bash
···40584159# Interaction (use @refs from snapshot)
4260agent-browser click @e1 # Click element
6161+agent-browser click @e1 --new-tab # Click and open in new tab
4362agent-browser fill @e2 "text" # Clear and type text
4463agent-browser type @e2 "text" # Type without clearing
4564agent-browser select @e1 "option" # Select dropdown option
4665agent-browser check @e1 # Check checkbox
4766agent-browser press Enter # Press key
6767+agent-browser keyboard type "text" # Type at current focus (no selector)
6868+agent-browser keyboard inserttext "text" # Insert without key events
4869agent-browser scroll down 500 # Scroll page
7070+agent-browser scroll down 500 --selector "div.content" # Scroll within a specific container
49715072# Get information
5173agent-browser get text @e1 # Get element text
···5779agent-browser wait --load networkidle # Wait for network idle
5880agent-browser wait --url "**/page" # Wait for URL pattern
5981agent-browser wait 2000 # Wait milliseconds
8282+8383+# Downloads
8484+agent-browser download @e1 ./file.pdf # Click element to trigger download
8585+agent-browser wait --download ./output.zip # Wait for any download to complete
8686+agent-browser --download-path ./downloads open <url> # Set default download directory
60876188# Capture
6289agent-browser screenshot # Screenshot to temp dir
6390agent-browser screenshot --full # Full page screenshot
9191+agent-browser screenshot --annotate # Annotated screenshot with numbered element labels
6492agent-browser pdf output.pdf # Save as PDF
9393+9494+# Diff (compare page states)
9595+agent-browser diff snapshot # Compare current vs last snapshot
9696+agent-browser diff snapshot --baseline before.txt # Compare current vs saved file
9797+agent-browser diff screenshot --baseline before.png # Visual pixel diff
9898+agent-browser diff url <url1> <url2> # Compare two pages
9999+agent-browser diff url <url1> <url2> --wait-until networkidle # Custom wait strategy
100100+agent-browser diff url <url1> <url2> --selector "#main" # Scope to element
65101```
6610267103## Common Patterns
···79115agent-browser wait --load networkidle
80116```
81117118118+### Authentication with Auth Vault (Recommended)
119119+120120+```bash
121121+# Save credentials once (encrypted with AGENT_BROWSER_ENCRYPTION_KEY)
122122+# Recommended: pipe password via stdin to avoid shell history exposure
123123+echo "pass" | agent-browser auth save github --url https://github.com/login --username user --password-stdin
124124+125125+# Login using saved profile (LLM never sees password)
126126+agent-browser auth login github
127127+128128+# List/show/delete profiles
129129+agent-browser auth list
130130+agent-browser auth show github
131131+agent-browser auth delete github
132132+```
133133+82134### Authentication with State Persistence
8313584136```bash
···96148agent-browser open https://app.example.com/dashboard
97149```
981509999-### Reusing existing Brave auth/session
151151+### Session Persistence
100152101101-If the user asks to reuse existing browser auth (for example their current Brave session), first restart Brave with CDP enabled.
153153+```bash
154154+# Auto-save/restore cookies and localStorage across browser restarts
155155+agent-browser --session-name myapp open https://app.example.com/login
156156+# ... login flow ...
157157+agent-browser close # State auto-saved to ~/.agent-browser/sessions/
102158103103-1. Kill Brave completely.
104104-2. Start Brave with remote debugging:
159159+# Next time, state is auto-loaded
160160+agent-browser --session-name myapp open https://app.example.com/dashboard
105161106106-```bash
107107-/opt/brave-bin/brave --remote-debugging-port=9222 --remote-debugging-address=127.0.0.1
108108-```
109109-110110-Then connect agent-browser to that session:
162162+# Encrypt state at rest
163163+export AGENT_BROWSER_ENCRYPTION_KEY=$(openssl rand -hex 32)
164164+agent-browser --session-name secure open https://app.example.com
111165112112-```bash
113113-agent-browser connect 9222
166166+# Manage saved states
167167+agent-browser state list
168168+agent-browser state show myapp-default.json
169169+agent-browser state clear myapp
170170+agent-browser state clean --older-than 7
114171```
115172116173### Data Extraction
···138195agent-browser session list
139196```
140197198198+### Connect to Existing Chrome
199199+200200+```bash
201201+# Auto-discover running Chrome with remote debugging enabled
202202+agent-browser --auto-connect open https://example.com
203203+agent-browser --auto-connect snapshot
204204+205205+# Or with explicit CDP port
206206+agent-browser --cdp 9222 snapshot
207207+```
208208+209209+### Color Scheme (Dark Mode)
210210+211211+```bash
212212+# Persistent dark mode via flag (applies to all pages and new tabs)
213213+agent-browser --color-scheme dark open https://example.com
214214+215215+# Or via environment variable
216216+AGENT_BROWSER_COLOR_SCHEME=dark agent-browser open https://example.com
217217+218218+# Or set during session (persists for subsequent commands)
219219+agent-browser set media dark
220220+```
221221+141222### Visual Browser (Debugging)
142223143224```bash
144225agent-browser --headed open https://example.com
145226agent-browser highlight @e1 # Highlight element
146227agent-browser record start demo.webm # Record session
228228+agent-browser profiler start # Start Chrome DevTools profiling
229229+agent-browser profiler stop trace.json # Stop and save profile (path optional)
147230```
231231+232232+Use `AGENT_BROWSER_HEADED=1` to enable headed mode via environment variable. Browser extensions work in both headed and headless mode.
148233149234### Local Files (PDFs, HTML)
150235···181266182267**Real devices:** Works with physical iOS devices if pre-configured. Use `--device "<UDID>"` where UDID is from `xcrun xctrace list devices`.
183268269269+## Security
270270+271271+All security features are opt-in. By default, agent-browser imposes no restrictions on navigation, actions, or output.
272272+273273+### Content Boundaries (Recommended for AI Agents)
274274+275275+Enable `--content-boundaries` to wrap page-sourced output in markers that help LLMs distinguish tool output from untrusted page content:
276276+277277+```bash
278278+export AGENT_BROWSER_CONTENT_BOUNDARIES=1
279279+agent-browser snapshot
280280+# Output:
281281+# --- AGENT_BROWSER_PAGE_CONTENT nonce=<hex> origin=https://example.com ---
282282+# [accessibility tree]
283283+# --- END_AGENT_BROWSER_PAGE_CONTENT nonce=<hex> ---
284284+```
285285+286286+### Domain Allowlist
287287+288288+Restrict navigation to trusted domains. Wildcards like `*.example.com` also match the bare domain `example.com`. Sub-resource requests, WebSocket, and EventSource connections to non-allowed domains are also blocked. Include CDN domains your target pages depend on:
289289+290290+```bash
291291+export AGENT_BROWSER_ALLOWED_DOMAINS="example.com,*.example.com"
292292+agent-browser open https://example.com # OK
293293+agent-browser open https://malicious.com # Blocked
294294+```
295295+296296+### Action Policy
297297+298298+Use a policy file to gate destructive actions:
299299+300300+```bash
301301+export AGENT_BROWSER_ACTION_POLICY=./policy.json
302302+```
303303+304304+Example `policy.json`:
305305+```json
306306+{"default": "deny", "allow": ["navigate", "snapshot", "click", "scroll", "wait", "get"]}
307307+```
308308+309309+Auth vault operations (`auth login`, etc.) bypass action policy but domain allowlist still applies.
310310+311311+### Output Limits
312312+313313+Prevent context flooding from large pages:
314314+315315+```bash
316316+export AGENT_BROWSER_MAX_OUTPUT=50000
317317+```
318318+319319+## Diffing (Verifying Changes)
320320+321321+Use `diff snapshot` after performing an action to verify it had the intended effect. This compares the current accessibility tree against the last snapshot taken in the session.
322322+323323+```bash
324324+# Typical workflow: snapshot -> action -> diff
325325+agent-browser snapshot -i # Take baseline snapshot
326326+agent-browser click @e2 # Perform action
327327+agent-browser diff snapshot # See what changed (auto-compares to last snapshot)
328328+```
329329+330330+For visual regression testing or monitoring:
331331+332332+```bash
333333+# Save a baseline screenshot, then compare later
334334+agent-browser screenshot baseline.png
335335+# ... time passes or changes are made ...
336336+agent-browser diff screenshot --baseline baseline.png
337337+338338+# Compare staging vs production
339339+agent-browser diff url https://staging.example.com https://prod.example.com --screenshot
340340+```
341341+342342+`diff snapshot` output uses `+` for additions and `-` for removals, similar to git diff. `diff screenshot` produces a diff image with changed pixels highlighted in red, plus a mismatch percentage.
343343+344344+## Timeouts and Slow Pages
345345+346346+The default Playwright timeout is 25 seconds for local browsers. This can be overridden with the `AGENT_BROWSER_DEFAULT_TIMEOUT` environment variable (value in milliseconds). For slow websites or large pages, use explicit waits instead of relying on the default timeout:
347347+348348+```bash
349349+# Wait for network activity to settle (best for slow pages)
350350+agent-browser wait --load networkidle
351351+352352+# Wait for a specific element to appear
353353+agent-browser wait "#content"
354354+agent-browser wait @e1
355355+356356+# Wait for a specific URL pattern (useful after redirects)
357357+agent-browser wait --url "**/dashboard"
358358+359359+# Wait for a JavaScript condition
360360+agent-browser wait --fn "document.readyState === 'complete'"
361361+362362+# Wait a fixed duration (milliseconds) as a last resort
363363+agent-browser wait 5000
364364+```
365365+366366+When dealing with consistently slow websites, use `wait --load networkidle` after `open` to ensure the page is fully loaded before taking a snapshot. If a specific element is slow to render, wait for it directly with `wait <selector>` or `wait @ref`.
367367+368368+## Session Management and Cleanup
369369+370370+When running multiple agents or automations concurrently, always use named sessions to avoid conflicts:
371371+372372+```bash
373373+# Each agent gets its own isolated session
374374+agent-browser --session agent1 open site-a.com
375375+agent-browser --session agent2 open site-b.com
376376+377377+# Check active sessions
378378+agent-browser session list
379379+```
380380+381381+Always close your browser session when done to avoid leaked processes:
382382+383383+```bash
384384+agent-browser close # Close default session
385385+agent-browser --session agent1 close # Close specific session
386386+```
387387+388388+If a previous session was not closed properly, the daemon may still be running. Use `agent-browser close` to clean it up before starting new work.
389389+184390## Ref Lifecycle (Important)
185391186392Refs (`@e1`, `@e2`, etc.) are invalidated when the page changes. Always re-snapshot after:
···195401agent-browser click @e1 # Use new refs
196402```
197403404404+## Annotated Screenshots (Vision Mode)
405405+406406+Use `--annotate` to take a screenshot with numbered labels overlaid on interactive elements. Each label `[N]` maps to ref `@eN`. This also caches refs, so you can interact with elements immediately without a separate snapshot.
407407+408408+```bash
409409+agent-browser screenshot --annotate
410410+# Output includes the image path and a legend:
411411+# [1] @e1 button "Submit"
412412+# [2] @e2 link "Home"
413413+# [3] @e3 textbox "Email"
414414+agent-browser click @e2 # Click using ref from annotated screenshot
415415+```
416416+417417+Use annotated screenshots when:
418418+- The page has unlabeled icon buttons or visual-only elements
419419+- You need to verify visual layout or styling
420420+- Canvas or chart elements are present (invisible to text snapshots)
421421+- You need spatial reasoning about element positions
422422+198423## Semantic Locators (Alternative to Refs)
199424200425When refs are unavailable or unreliable, use semantic locators:
···206431agent-browser find placeholder "Search" type "query"
207432agent-browser find testid "submit-btn" click
208433```
434434+435435+## JavaScript Evaluation (eval)
436436+437437+Use `eval` to run JavaScript in the browser context. **Shell quoting can corrupt complex expressions** -- use `--stdin` or `-b` to avoid issues.
438438+439439+```bash
440440+# Simple expressions work with regular quoting
441441+agent-browser eval 'document.title'
442442+agent-browser eval 'document.querySelectorAll("img").length'
443443+444444+# Complex JS: use --stdin with heredoc (RECOMMENDED)
445445+agent-browser eval --stdin <<'EVALEOF'
446446+JSON.stringify(
447447+ Array.from(document.querySelectorAll("img"))
448448+ .filter(i => !i.alt)
449449+ .map(i => ({ src: i.src.split("/").pop(), width: i.width }))
450450+)
451451+EVALEOF
452452+453453+# Alternative: base64 encoding (avoids all shell escaping issues)
454454+agent-browser eval -b "$(echo -n 'Array.from(document.querySelectorAll("a")).map(a => a.href)' | base64)"
455455+```
456456+457457+**Why this matters:** When the shell processes your command, inner double quotes, `!` characters (history expansion), backticks, and `$()` can all corrupt the JavaScript before it reaches agent-browser. The `--stdin` and `-b` flags bypass shell interpretation entirely.
458458+459459+**Rules of thumb:**
460460+- Single-line, no nested quotes -> regular `eval 'expression'` with single quotes is fine
461461+- Nested quotes, arrow functions, template literals, or multiline -> use `eval --stdin <<'EVALEOF'`
462462+- Programmatic/generated scripts -> use `eval -b` with base64
463463+464464+## Configuration File
465465+466466+Create `agent-browser.json` in the project root for persistent settings:
467467+468468+```json
469469+{
470470+ "headed": true,
471471+ "proxy": "http://localhost:8080",
472472+ "profile": "./browser-data"
473473+}
474474+```
475475+476476+Priority (lowest to highest): `~/.agent-browser/config.json` < `./agent-browser.json` < env vars < CLI flags. Use `--config <path>` or `AGENT_BROWSER_CONFIG` env var for a custom config file (exits with error if missing/invalid). All CLI options map to camelCase keys (e.g., `--executable-path` -> `"executablePath"`). Boolean flags accept `true`/`false` values (e.g., `--headed false` overrides config). Extensions from user and project configs are merged, not replaced.
477477+478478+## Deep-Dive Documentation
479479+480480+| Reference | When to Use |
481481+|-----------|-------------|
482482+| [references/commands.md](references/commands.md) | Full command reference with all options |
483483+| [references/snapshot-refs.md](references/snapshot-refs.md) | Ref lifecycle, invalidation rules, troubleshooting |
484484+| [references/session-management.md](references/session-management.md) | Parallel sessions, state persistence, concurrent scraping |
485485+| [references/authentication.md](references/authentication.md) | Login flows, OAuth, 2FA handling, state reuse |
486486+| [references/video-recording.md](references/video-recording.md) | Recording workflows for debugging and documentation |
487487+| [references/profiling.md](references/profiling.md) | Chrome DevTools profiling for performance analysis |
488488+| [references/proxy-support.md](references/proxy-support.md) | Proxy configuration, geo-testing, rotating proxies |
489489+490490+## Experimental: Native Mode
491491+492492+agent-browser has an experimental native Rust daemon that communicates with Chrome directly via CDP, bypassing Node.js and Playwright entirely. It is opt-in and not recommended for production use yet.
493493+494494+```bash
495495+# Enable via flag
496496+agent-browser --native open example.com
497497+498498+# Enable via environment variable (avoids passing --native every time)
499499+export AGENT_BROWSER_NATIVE=1
500500+agent-browser open example.com
501501+```
502502+503503+The native daemon supports Chromium and Safari (via WebDriver). Firefox and WebKit are not yet supported. All core commands (navigate, snapshot, click, fill, screenshot, cookies, storage, tabs, eval, etc.) work identically in native mode. Use `agent-browser close` before switching between native and default mode within the same session.
504504+505505+## Ready-to-Use Templates
506506+507507+| Template | Description |
508508+|----------|-------------|
509509+| [templates/form-automation.sh](templates/form-automation.sh) | Form filling with validation |
510510+| [templates/authenticated-session.sh](templates/authenticated-session.sh) | Login once, reuse state |
511511+| [templates/capture-workflow.sh](templates/capture-workflow.sh) | Content extraction with screenshots |
512512+513513+```bash
514514+./templates/form-automation.sh https://example.com/form
515515+./templates/authenticated-session.sh https://app.example.com/login
516516+./templates/capture-workflow.sh https://example.com ./output
517517+```
···11+# Proxy Support
22+33+Proxy configuration for geo-testing, rate limiting avoidance, and corporate environments.
44+55+**Related**: [commands.md](commands.md) for global options, [SKILL.md](../SKILL.md) for quick start.
66+77+## Contents
88+99+- [Basic Proxy Configuration](#basic-proxy-configuration)
1010+- [Authenticated Proxy](#authenticated-proxy)
1111+- [SOCKS Proxy](#socks-proxy)
1212+- [Proxy Bypass](#proxy-bypass)
1313+- [Common Use Cases](#common-use-cases)
1414+- [Verifying Proxy Connection](#verifying-proxy-connection)
1515+- [Troubleshooting](#troubleshooting)
1616+- [Best Practices](#best-practices)
1717+1818+## Basic Proxy Configuration
1919+2020+Use the `--proxy` flag or set proxy via environment variable:
2121+2222+```bash
2323+# Via CLI flag
2424+agent-browser --proxy "http://proxy.example.com:8080" open https://example.com
2525+2626+# Via environment variable
2727+export HTTP_PROXY="http://proxy.example.com:8080"
2828+agent-browser open https://example.com
2929+3030+# HTTPS proxy
3131+export HTTPS_PROXY="https://proxy.example.com:8080"
3232+agent-browser open https://example.com
3333+3434+# Both
3535+export HTTP_PROXY="http://proxy.example.com:8080"
3636+export HTTPS_PROXY="http://proxy.example.com:8080"
3737+agent-browser open https://example.com
3838+```
3939+4040+## Authenticated Proxy
4141+4242+For proxies requiring authentication:
4343+4444+```bash
4545+# Include credentials in URL
4646+export HTTP_PROXY="http://username:password@proxy.example.com:8080"
4747+agent-browser open https://example.com
4848+```
4949+5050+## SOCKS Proxy
5151+5252+```bash
5353+# SOCKS5 proxy
5454+export ALL_PROXY="socks5://proxy.example.com:1080"
5555+agent-browser open https://example.com
5656+5757+# SOCKS5 with auth
5858+export ALL_PROXY="socks5://user:pass@proxy.example.com:1080"
5959+agent-browser open https://example.com
6060+```
6161+6262+## Proxy Bypass
6363+6464+Skip proxy for specific domains using `--proxy-bypass` or `NO_PROXY`:
6565+6666+```bash
6767+# Via CLI flag
6868+agent-browser --proxy "http://proxy.example.com:8080" --proxy-bypass "localhost,*.internal.com" open https://example.com
6969+7070+# Via environment variable
7171+export NO_PROXY="localhost,127.0.0.1,.internal.company.com"
7272+agent-browser open https://internal.company.com # Direct connection
7373+agent-browser open https://external.com # Via proxy
7474+```
7575+7676+## Common Use Cases
7777+7878+### Geo-Location Testing
7979+8080+```bash
8181+#!/bin/bash
8282+# Test site from different regions using geo-located proxies
8383+8484+PROXIES=(
8585+ "http://us-proxy.example.com:8080"
8686+ "http://eu-proxy.example.com:8080"
8787+ "http://asia-proxy.example.com:8080"
8888+)
8989+9090+for proxy in "${PROXIES[@]}"; do
9191+ export HTTP_PROXY="$proxy"
9292+ export HTTPS_PROXY="$proxy"
9393+9494+ region=$(echo "$proxy" | grep -oP '^\w+-\w+')
9595+ echo "Testing from: $region"
9696+9797+ agent-browser --session "$region" open https://example.com
9898+ agent-browser --session "$region" screenshot "./screenshots/$region.png"
9999+ agent-browser --session "$region" close
100100+done
101101+```
102102+103103+### Rotating Proxies for Scraping
104104+105105+```bash
106106+#!/bin/bash
107107+# Rotate through proxy list to avoid rate limiting
108108+109109+PROXY_LIST=(
110110+ "http://proxy1.example.com:8080"
111111+ "http://proxy2.example.com:8080"
112112+ "http://proxy3.example.com:8080"
113113+)
114114+115115+URLS=(
116116+ "https://site.com/page1"
117117+ "https://site.com/page2"
118118+ "https://site.com/page3"
119119+)
120120+121121+for i in "${!URLS[@]}"; do
122122+ proxy_index=$((i % ${#PROXY_LIST[@]}))
123123+ export HTTP_PROXY="${PROXY_LIST[$proxy_index]}"
124124+ export HTTPS_PROXY="${PROXY_LIST[$proxy_index]}"
125125+126126+ agent-browser open "${URLS[$i]}"
127127+ agent-browser get text body > "output-$i.txt"
128128+ agent-browser close
129129+130130+ sleep 1 # Polite delay
131131+done
132132+```
133133+134134+### Corporate Network Access
135135+136136+```bash
137137+#!/bin/bash
138138+# Access internal sites via corporate proxy
139139+140140+export HTTP_PROXY="http://corpproxy.company.com:8080"
141141+export HTTPS_PROXY="http://corpproxy.company.com:8080"
142142+export NO_PROXY="localhost,127.0.0.1,.company.com"
143143+144144+# External sites go through proxy
145145+agent-browser open https://external-vendor.com
146146+147147+# Internal sites bypass proxy
148148+agent-browser open https://intranet.company.com
149149+```
150150+151151+## Verifying Proxy Connection
152152+153153+```bash
154154+# Check your apparent IP
155155+agent-browser open https://httpbin.org/ip
156156+agent-browser get text body
157157+# Should show proxy's IP, not your real IP
158158+```
159159+160160+## Troubleshooting
161161+162162+### Proxy Connection Failed
163163+164164+```bash
165165+# Test proxy connectivity first
166166+curl -x http://proxy.example.com:8080 https://httpbin.org/ip
167167+168168+# Check if proxy requires auth
169169+export HTTP_PROXY="http://user:pass@proxy.example.com:8080"
170170+```
171171+172172+### SSL/TLS Errors Through Proxy
173173+174174+Some proxies perform SSL inspection. If you encounter certificate errors:
175175+176176+```bash
177177+# For testing only - not recommended for production
178178+agent-browser open https://example.com --ignore-https-errors
179179+```
180180+181181+### Slow Performance
182182+183183+```bash
184184+# Use proxy only when necessary
185185+export NO_PROXY="*.cdn.com,*.static.com" # Direct CDN access
186186+```
187187+188188+## Best Practices
189189+190190+1. **Use environment variables** - Don't hardcode proxy credentials
191191+2. **Set NO_PROXY appropriately** - Avoid routing local traffic through proxy
192192+3. **Test proxy before automation** - Verify connectivity with simple requests
193193+4. **Handle proxy failures gracefully** - Implement retry logic for unstable proxies
194194+5. **Rotate proxies for large scraping jobs** - Distribute load and avoid bans
···11+# Session Management
22+33+Multiple isolated browser sessions with state persistence and concurrent browsing.
44+55+**Related**: [authentication.md](authentication.md) for login patterns, [SKILL.md](../SKILL.md) for quick start.
66+77+## Contents
88+99+- [Named Sessions](#named-sessions)
1010+- [Session Isolation Properties](#session-isolation-properties)
1111+- [Session State Persistence](#session-state-persistence)
1212+- [Common Patterns](#common-patterns)
1313+- [Default Session](#default-session)
1414+- [Session Cleanup](#session-cleanup)
1515+- [Best Practices](#best-practices)
1616+1717+## Named Sessions
1818+1919+Use `--session` flag to isolate browser contexts:
2020+2121+```bash
2222+# Session 1: Authentication flow
2323+agent-browser --session auth open https://app.example.com/login
2424+2525+# Session 2: Public browsing (separate cookies, storage)
2626+agent-browser --session public open https://example.com
2727+2828+# Commands are isolated by session
2929+agent-browser --session auth fill @e1 "user@example.com"
3030+agent-browser --session public get text body
3131+```
3232+3333+## Session Isolation Properties
3434+3535+Each session has independent:
3636+- Cookies
3737+- LocalStorage / SessionStorage
3838+- IndexedDB
3939+- Cache
4040+- Browsing history
4141+- Open tabs
4242+4343+## Session State Persistence
4444+4545+### Save Session State
4646+4747+```bash
4848+# Save cookies, storage, and auth state
4949+agent-browser state save /path/to/auth-state.json
5050+```
5151+5252+### Load Session State
5353+5454+```bash
5555+# Restore saved state
5656+agent-browser state load /path/to/auth-state.json
5757+5858+# Continue with authenticated session
5959+agent-browser open https://app.example.com/dashboard
6060+```
6161+6262+### State File Contents
6363+6464+```json
6565+{
6666+ "cookies": [...],
6767+ "localStorage": {...},
6868+ "sessionStorage": {...},
6969+ "origins": [...]
7070+}
7171+```
7272+7373+## Common Patterns
7474+7575+### Authenticated Session Reuse
7676+7777+```bash
7878+#!/bin/bash
7979+# Save login state once, reuse many times
8080+8181+STATE_FILE="/tmp/auth-state.json"
8282+8383+# Check if we have saved state
8484+if [[ -f "$STATE_FILE" ]]; then
8585+ agent-browser state load "$STATE_FILE"
8686+ agent-browser open https://app.example.com/dashboard
8787+else
8888+ # Perform login
8989+ agent-browser open https://app.example.com/login
9090+ agent-browser snapshot -i
9191+ agent-browser fill @e1 "$USERNAME"
9292+ agent-browser fill @e2 "$PASSWORD"
9393+ agent-browser click @e3
9494+ agent-browser wait --load networkidle
9595+9696+ # Save for future use
9797+ agent-browser state save "$STATE_FILE"
9898+fi
9999+```
100100+101101+### Concurrent Scraping
102102+103103+```bash
104104+#!/bin/bash
105105+# Scrape multiple sites concurrently
106106+107107+# Start all sessions
108108+agent-browser --session site1 open https://site1.com &
109109+agent-browser --session site2 open https://site2.com &
110110+agent-browser --session site3 open https://site3.com &
111111+wait
112112+113113+# Extract from each
114114+agent-browser --session site1 get text body > site1.txt
115115+agent-browser --session site2 get text body > site2.txt
116116+agent-browser --session site3 get text body > site3.txt
117117+118118+# Cleanup
119119+agent-browser --session site1 close
120120+agent-browser --session site2 close
121121+agent-browser --session site3 close
122122+```
123123+124124+### A/B Testing Sessions
125125+126126+```bash
127127+# Test different user experiences
128128+agent-browser --session variant-a open "https://app.com?variant=a"
129129+agent-browser --session variant-b open "https://app.com?variant=b"
130130+131131+# Compare
132132+agent-browser --session variant-a screenshot /tmp/variant-a.png
133133+agent-browser --session variant-b screenshot /tmp/variant-b.png
134134+```
135135+136136+## Default Session
137137+138138+When `--session` is omitted, commands use the default session:
139139+140140+```bash
141141+# These use the same default session
142142+agent-browser open https://example.com
143143+agent-browser snapshot -i
144144+agent-browser close # Closes default session
145145+```
146146+147147+## Session Cleanup
148148+149149+```bash
150150+# Close specific session
151151+agent-browser --session auth close
152152+153153+# List active sessions
154154+agent-browser session list
155155+```
156156+157157+## Best Practices
158158+159159+### 1. Name Sessions Semantically
160160+161161+```bash
162162+# GOOD: Clear purpose
163163+agent-browser --session github-auth open https://github.com
164164+agent-browser --session docs-scrape open https://docs.example.com
165165+166166+# AVOID: Generic names
167167+agent-browser --session s1 open https://github.com
168168+```
169169+170170+### 2. Always Clean Up
171171+172172+```bash
173173+# Close sessions when done
174174+agent-browser --session auth close
175175+agent-browser --session scrape close
176176+```
177177+178178+### 3. Handle State Files Securely
179179+180180+```bash
181181+# Don't commit state files (contain auth tokens!)
182182+echo "*.auth-state.json" >> .gitignore
183183+184184+# Delete after use
185185+rm /tmp/auth-state.json
186186+```
187187+188188+### 4. Timeout Long Sessions
189189+190190+```bash
191191+# Set timeout for automated scripts
192192+timeout 60 agent-browser --session long-task get text body
193193+```
···11+# Video Recording
22+33+Capture browser automation as video for debugging, documentation, or verification.
44+55+**Related**: [commands.md](commands.md) for full command reference, [SKILL.md](../SKILL.md) for quick start.
66+77+## Contents
88+99+- [Basic Recording](#basic-recording)
1010+- [Recording Commands](#recording-commands)
1111+- [Use Cases](#use-cases)
1212+- [Best Practices](#best-practices)
1313+- [Output Format](#output-format)
1414+- [Limitations](#limitations)
1515+1616+## Basic Recording
1717+1818+```bash
1919+# Start recording
2020+agent-browser record start ./demo.webm
2121+2222+# Perform actions
2323+agent-browser open https://example.com
2424+agent-browser snapshot -i
2525+agent-browser click @e1
2626+agent-browser fill @e2 "test input"
2727+2828+# Stop and save
2929+agent-browser record stop
3030+```
3131+3232+## Recording Commands
3333+3434+```bash
3535+# Start recording to file
3636+agent-browser record start ./output.webm
3737+3838+# Stop current recording
3939+agent-browser record stop
4040+4141+# Restart with new file (stops current + starts new)
4242+agent-browser record restart ./take2.webm
4343+```
4444+4545+## Use Cases
4646+4747+### Debugging Failed Automation
4848+4949+```bash
5050+#!/bin/bash
5151+# Record automation for debugging
5252+5353+agent-browser record start ./debug-$(date +%Y%m%d-%H%M%S).webm
5454+5555+# Run your automation
5656+agent-browser open https://app.example.com
5757+agent-browser snapshot -i
5858+agent-browser click @e1 || {
5959+ echo "Click failed - check recording"
6060+ agent-browser record stop
6161+ exit 1
6262+}
6363+6464+agent-browser record stop
6565+```
6666+6767+### Documentation Generation
6868+6969+```bash
7070+#!/bin/bash
7171+# Record workflow for documentation
7272+7373+agent-browser record start ./docs/how-to-login.webm
7474+7575+agent-browser open https://app.example.com/login
7676+agent-browser wait 1000 # Pause for visibility
7777+7878+agent-browser snapshot -i
7979+agent-browser fill @e1 "demo@example.com"
8080+agent-browser wait 500
8181+8282+agent-browser fill @e2 "password"
8383+agent-browser wait 500
8484+8585+agent-browser click @e3
8686+agent-browser wait --load networkidle
8787+agent-browser wait 1000 # Show result
8888+8989+agent-browser record stop
9090+```
9191+9292+### CI/CD Test Evidence
9393+9494+```bash
9595+#!/bin/bash
9696+# Record E2E test runs for CI artifacts
9797+9898+TEST_NAME="${1:-e2e-test}"
9999+RECORDING_DIR="./test-recordings"
100100+mkdir -p "$RECORDING_DIR"
101101+102102+agent-browser record start "$RECORDING_DIR/$TEST_NAME-$(date +%s).webm"
103103+104104+# Run test
105105+if run_e2e_test; then
106106+ echo "Test passed"
107107+else
108108+ echo "Test failed - recording saved"
109109+fi
110110+111111+agent-browser record stop
112112+```
113113+114114+## Best Practices
115115+116116+### 1. Add Pauses for Clarity
117117+118118+```bash
119119+# Slow down for human viewing
120120+agent-browser click @e1
121121+agent-browser wait 500 # Let viewer see result
122122+```
123123+124124+### 2. Use Descriptive Filenames
125125+126126+```bash
127127+# Include context in filename
128128+agent-browser record start ./recordings/login-flow-2024-01-15.webm
129129+agent-browser record start ./recordings/checkout-test-run-42.webm
130130+```
131131+132132+### 3. Handle Recording in Error Cases
133133+134134+```bash
135135+#!/bin/bash
136136+set -e
137137+138138+cleanup() {
139139+ agent-browser record stop 2>/dev/null || true
140140+ agent-browser close 2>/dev/null || true
141141+}
142142+trap cleanup EXIT
143143+144144+agent-browser record start ./automation.webm
145145+# ... automation steps ...
146146+```
147147+148148+### 4. Combine with Screenshots
149149+150150+```bash
151151+# Record video AND capture key frames
152152+agent-browser record start ./flow.webm
153153+154154+agent-browser open https://example.com
155155+agent-browser screenshot ./screenshots/step1-homepage.png
156156+157157+agent-browser click @e1
158158+agent-browser screenshot ./screenshots/step2-after-click.png
159159+160160+agent-browser record stop
161161+```
162162+163163+## Output Format
164164+165165+- Default format: WebM (VP8/VP9 codec)
166166+- Compatible with all modern browsers and video players
167167+- Compressed but high quality
168168+169169+## Limitations
170170+171171+- Recording adds slight overhead to automation
172172+- Large recordings can consume significant disk space
173173+- Some headless environments may have codec limitations
···11+#!/bin/bash
22+# Template: Form Automation Workflow
33+# Purpose: Fill and submit web forms with validation
44+# Usage: ./form-automation.sh <form-url>
55+#
66+# This template demonstrates the snapshot-interact-verify pattern:
77+# 1. Navigate to form
88+# 2. Snapshot to get element refs
99+# 3. Fill fields using refs
1010+# 4. Submit and verify result
1111+#
1212+# Customize: Update the refs (@e1, @e2, etc.) based on your form's snapshot output
1313+1414+set -euo pipefail
1515+1616+FORM_URL="${1:?Usage: $0 <form-url>}"
1717+1818+echo "Form automation: $FORM_URL"
1919+2020+# Step 1: Navigate to form
2121+agent-browser open "$FORM_URL"
2222+agent-browser wait --load networkidle
2323+2424+# Step 2: Snapshot to discover form elements
2525+echo ""
2626+echo "Form structure:"
2727+agent-browser snapshot -i
2828+2929+# Step 3: Fill form fields (customize these refs based on snapshot output)
3030+#
3131+# Common field types:
3232+# agent-browser fill @e1 "John Doe" # Text input
3333+# agent-browser fill @e2 "user@example.com" # Email input
3434+# agent-browser fill @e3 "SecureP@ss123" # Password input
3535+# agent-browser select @e4 "Option Value" # Dropdown
3636+# agent-browser check @e5 # Checkbox
3737+# agent-browser click @e6 # Radio button
3838+# agent-browser fill @e7 "Multi-line text" # Textarea
3939+# agent-browser upload @e8 /path/to/file.pdf # File upload
4040+#
4141+# Uncomment and modify:
4242+# agent-browser fill @e1 "Test User"
4343+# agent-browser fill @e2 "test@example.com"
4444+# agent-browser click @e3 # Submit button
4545+4646+# Step 4: Wait for submission
4747+# agent-browser wait --load networkidle
4848+# agent-browser wait --url "**/success" # Or wait for redirect
4949+5050+# Step 5: Verify result
5151+echo ""
5252+echo "Result:"
5353+agent-browser get url
5454+agent-browser snapshot -i
5555+5656+# Optional: Capture evidence
5757+agent-browser screenshot /tmp/form-result.png
5858+echo "Screenshot saved: /tmp/form-result.png"
5959+6060+# Cleanup
6161+agent-browser close
6262+echo "Done"
-39
agents/skills/frontend-design/SKILL.md
···11----
22-name: frontend-design
33-description: Create unique, visually appealing frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
44----
55-66-This skill guides creation of distinctive, production-grade frontend interfaces that avoid generic "AI slop" aesthetics. Implement real working code with exceptional attention to aesthetic details and creative choices.
77-88-The user provides frontend requirements: a component, page, application, or interface to build. They may include context about the purpose, audience, or technical constraints.
99-1010-## Design Thinking
1111-1212-Before coding, understand the context and commit to a **BOLD** aesthetic direction:
1313-- **Purpose**: What problem does this interface solve? Who uses it?
1414-- **Tone**: Pick an extreme: brutally minimal, naturistic chaos, retro-futuristic, playful/toy-like, editorial/magazine, brutalist/raw, art deco/geometric, soft/pastel, industrial/utilitarian, etc. There are so many flavors to choose from. Use these for inspiration but design one that is true to the aesthetic direction.
1515-- **Constraints**: Technical requirements. Do semantic HTML, modern CSS, framework best practices, performance, accessibility.
1616-- **Differentiation**: What makes this UNFORGETTABLE? What's the one thing someone will remember?
1717-1818-**CRITICAL**: Choose a clear conceptual direction and execute it with precision. Bold maximalism and refined minimalism both work - the key is intentionality, not intensity.
1919-2020-Then implement working code (HTML/CSS/JS) that is:
2121-- Production-grade and functional
2222-- Visually striking and memorable
2323-- Cohesive with a clear aesthetic point-of-view
2424-- Meticulously refined in every detail
2525-2626-## Frontend Aesthetics Guidelines
2727-2828-Focus on:
2929-- **Typography**: Choose fonts that are beautiful, unique, and interesting. Avoid generic fonts like Arial and Inter; opt instead for distinctive choices that elevate the frontend's aesthetics; unexpected, characterful font choices. Pair a distinctive display font with a refined body font.
3030-- **Color & Theme**: Commit to a cohesive aesthetic. Use CSS variables for consistency. Dominant colors with sharp accents outperform timid, evenly-distributed palettes.
3131-- **Motion**: Use animations for effects and micro-interactions. Prioritize CSS-only solutions for HTML. Use Motion library for React when available. Focus on high-impact moments: one well-orchestrated page load with staggered reveals (animation-delay) creates more delight than scattered micro-interactions. Use scroll-triggering and hover states that surprise.
3232-- **Spatial Composition**: Unexpected layouts. Asymmetry. Overlap. Diagonal flow. Grid-breaking elements. Generous negative space OR controlled density.
3333-- **Backgrounds & Visual Details**: Create atmosphere and depth rather than defaulting to solid colors. Add contextual effects and textures that match the overall aesthetic. Apply creative forms like gradient meshes, noise textures, geometric patterns, layered transparencies, dramatic shadows, decorative borders, custom cursors, and grain overlays.
3434-3535-NEVER use generic AI-generated aesthetics like overused font families (Inter, Roboto, Arial, system fonts), cliched color schemes (particularly purple gradients on white backgrounds), predictable layouts and component patterns, and cookie-cutter design that lacks context-specific character.
3636-3737-Interpret creatively and make unexpected choices that feel genuinely designed for the context. No design should be the same. Vary between light and dark themes, different fonts, different aesthetics. NEVER converge on common choices (Space Grotesk, for example) across generations.
3838-3939-**IMPORTANT**: Pay attention to the design precision, and careful attention to spacing, typography, and subtle details. Elegance comes from executing the vision well.
-28
agents/skills/simplify/SKILL.md
···11----
22-name: simplify
33-description: Refactor code to be simpler while maintaining identical functionality
44----
55-66-# Simplify
77-88-Refactor the given code to make it **simpler, clearer, and more maintainable** without changing what it does.
99-1010-## Objective
1111-1212-Simplify and clean the code. Implementation should be **straightforward and pragmatic**. The goal is to get the most minimal code possible.
1313-1414-## Principles
1515-1616-- **Behavior parity:** Keep interfaces and semantics identical. No new features. Preserve flags, return codes, and observable side effects.
1717-- **KISS:** Prefer boring, obvious solutions over cleverness. Fewer moving parts > fewer lines.
1818-- **Small pieces:** Favor small, composable functions. Design for easy deletion and iteration.
1919-- **Prune aggressively:** Remove dead code, unused vars, redundant branches, defensive over-engineering, and needless indirection.
2020-- **Flatten flow:** Simplify complex conditionals and deep nesting; use clear guards and early returns.
2121-- **Standard library first:** Replace custom utilities with modern built-ins/framework primitives.
2222-- **Fail early and often:** Don't use blanket try/catch. Skip validations.
2323-- **Communicate with types:** Use types to express contracts and invariants. Avoid type acrobatics and generic abstractions.
2424-- **Abstractions when earned:** Introduce/keep them only if they reduce duplication or isolate likely change.
2525-- **Minimal deps:** Don't add dependencies unless they materially simplify and are commonly available for the target runtime.
2626-- **No micro-optimizations** unless they remove complexity or are explicitly required.
2727-- **Make rules explicit:** Turn hidden assumptions into defaults, parameters, or assertions.
2828-- **Naming for intent:** Prefer clear, intention‑revealing names; one responsibility per function/module.
-320
agents/skills/todoist/SKILL.md
···11----
22-name: todoist
33-description: Manage Todoist tasks, projects, labels, comments, and more via the td CLI
44----
55-66-# Todoist CLI (td)
77-88-Use this skill when the user wants to interact with their Todoist tasks.
99-1010-## Quick Reference
1111-1212-- `td today` - Tasks due today and overdue
1313-- `td inbox` - Inbox tasks
1414-- `td upcoming` - Tasks due in next N days
1515-- `td completed` - Recently completed tasks
1616-- `td task add "content"` - Add a task
1717-- `td task list` - List tasks with filters
1818-- `td task complete <ref>` - Complete a task
1919-- `td project list` - List projects
2020-- `td label list` - List labels
2121-- `td filter list/view` - Manage and use saved filters
2222-- `td workspace list` - List workspaces
2323-- `td activity` - Activity logs
2424-- `td notification list` - Notifications
2525-- `td reminder add` - Task reminders
2626-- `td stats` - Productivity stats
2727-- `td settings view` - User settings
2828-- `td completion install` - Install shell completions
2929-- `td view <url>` - View supported Todoist entities/pages by URL
3030-- `td update` - Self-update the CLI to the latest version
3131-3232-## Output Formats
3333-3434-All list commands support:
3535-- `--json` - JSON output (essential fields)
3636-- `--ndjson` - Newline-delimited JSON (streaming)
3737-- `--full` - Include all fields in JSON
3838-- `--raw` - Disable markdown rendering
3939-4040-## Shared List Options
4141-4242-Most list commands also support:
4343-- `--limit <n>` - Limit number of results
4444-- `--all` - Fetch all results (no limit)
4545-- `--cursor <cursor>` - Continue from pagination cursor
4646-- `--show-urls` - Show web app URLs for each item
4747-4848-## Global Options
4949-5050-- `--no-spinner` - Disable loading animations
5151-- `--progress-jsonl` - Machine-readable progress events (JSONL to stderr)
5252-- `-v, --verbose` - Verbose output to stderr (repeat: -v info, -vv detail, -vvv debug, -vvvv trace)
5353-- `--accessible` - Add text labels to color-coded output (due:/deadline:/~ prefixes, ★ for favorites). Also: `TD_ACCESSIBLE=1`
5454-5555-## References
5656-5757-Tasks, projects, labels, and filters can be referenced by:
5858-- Name (fuzzy matched within context)
5959-- `id:xxx` - Explicit ID
6060-- Todoist URL - Paste directly from the web app (e.g., `https://app.todoist.com/app/task/buy-milk-8Jx4mVr72kPn3QwB` or `https://app.todoist.com/app/project/work-2pN7vKx49mRq6YhT`)
6161-6262-## Priority Mapping
6363-6464-- p1 = Highest priority (API value 4)
6565-- p2 = High priority (API value 3)
6666-- p3 = Medium priority (API value 2)
6767-- p4 = Lowest priority (API value 1, default)
6868-6969-## Commands
7070-7171-### Today
7272-```bash
7373-td today # Due today + overdue
7474-td today --json # JSON output
7575-td today --workspace "Work" # Filter to workspace
7676-td today --personal # Personal projects only
7777-td today --any-assignee # Include tasks assigned to others
7878-```
7979-8080-### Inbox
8181-```bash
8282-td inbox # Inbox tasks
8383-td inbox --priority p1 # Filter by priority
8484-td inbox --due today # Filter by due date
8585-```
8686-8787-### Upcoming
8888-```bash
8989-td upcoming # Next 7 days
9090-td upcoming 14 # Next 14 days
9191-td upcoming --workspace "Work" # Filter to workspace
9292-td upcoming --personal # Personal projects only
9393-td upcoming --any-assignee # Include tasks assigned to others
9494-```
9595-9696-### Completed
9797-```bash
9898-td completed # Completed today
9999-td completed --since 2024-01-01 --until 2024-01-31
100100-td completed --project "Work" # Filter by project
101101-```
102102-103103-### Task Management
104104-```bash
105105-# List with filters
106106-td task list --project "Work"
107107-td task list --label "urgent" --priority p1
108108-td task list --due today
109109-td task list --filter "today | overdue"
110110-td task list --assignee me
111111-td task list --assignee "john@example.com"
112112-td task list --unassigned
113113-td task list --workspace "Work"
114114-td task list --personal
115115-td task list --parent "Parent task"
116116-117117-# View, complete, uncomplete
118118-td task view "task name"
119119-td task complete "task name"
120120-td task complete id:123456
121121-td task complete "task name" --forever # Stop recurrence
122122-td task uncomplete id:123456 # Reopen completed task
123123-124124-# Add tasks
125125-td task add "New task" --due "tomorrow" --priority p2
126126-td task add "Task" --deadline "2024-03-01" --project "Work"
127127-td task add "Task" --duration 1h --section "Planning" --project "Work"
128128-td task add "Task" --labels "urgent,review" --parent "Parent task"
129129-td task add "Task" --description "Details here" --assignee me
130130-131131-# Update
132132-td task update "task name" --due "next week"
133133-td task update "task name" --deadline "2024-06-01"
134134-td task update "task name" --no-deadline
135135-td task update "task name" --duration 2h
136136-td task update "task name" --assignee "john@example.com"
137137-td task update "task name" --unassign
138138-139139-# Move
140140-td task move "task name" --project "Personal"
141141-td task move "task name" --section "In Progress"
142142-td task move "task name" --parent "Parent task"
143143-td task move "task name" --no-parent # Move to project root
144144-td task move "task name" --no-section # Remove from section
145145-146146-# Delete and browse
147147-td task delete "task name" --yes
148148-td task browse "task name" # Open in browser
149149-```
150150-151151-### Projects
152152-```bash
153153-td project list
154154-td project list --personal # Personal projects only
155155-td project view "Project Name"
156156-td project collaborators "Project Name"
157157-td project create --name "New Project" --color "blue"
158158-td project update "Project Name" --favorite
159159-td project archive "Project Name"
160160-td project unarchive "Project Name"
161161-td project delete "Project Name" --yes
162162-td project browse "Project Name" # Open in browser
163163-td project move "Project Name" --to-workspace "Acme"
164164-td project move "Project Name" --to-workspace "Acme" --folder "Engineering"
165165-td project move "Project Name" --to-workspace "Acme" --visibility team
166166-td project move "Project Name" --to-personal
167167-# move requires --yes to confirm (without it, shows a dry-run preview)
168168-```
169169-170170-### Labels
171171-```bash
172172-td label list # Lists personal + shared labels
173173-td label view "urgent" # View label details and tasks
174174-td label view "team-review" # Works for shared labels too
175175-td label create --name "urgent" --color "red"
176176-td label update "urgent" --color "orange"
177177-td label delete "urgent" --yes
178178-td label browse "urgent" # Open in browser
179179-```
180180-181181-Note: Shared labels (from collaborative projects) appear in `list` and can be viewed, but cannot be deleted/updated via the standard label commands since they have no ID.
182182-183183-### Comments
184184-```bash
185185-td comment list --task "task name"
186186-td comment list --project "Project Name" -P # Project comments
187187-td comment add --task "task name" --content "Comment text"
188188-td comment add --task "task name" --content "See attached" --file ./report.pdf
189189-td comment view id:123 # View full comment
190190-td comment update id:123 --content "Updated text"
191191-td comment delete id:123 --yes
192192-td comment browse id:123 # Open in browser
193193-```
194194-195195-### Sections
196196-```bash
197197-td section list "Work" # List sections in project (or --project "Work")
198198-td section list --project "Work" # Same, using named flag
199199-td section create --project "Work" --name "In Progress"
200200-td section update id:123 --name "Done"
201201-td section delete id:123 --yes
202202-td section browse id:123 # Open in browser
203203-```
204204-205205-### Filters
206206-```bash
207207-td filter list
208208-td filter create --name "Urgent work" --query "p1 & #Work"
209209-td filter view "Urgent work" # Show tasks matching filter (alias: show)
210210-td filter update "Urgent work" --query "p1 & #Work & today"
211211-td filter delete "Urgent work" --yes
212212-td filter browse "Urgent work" # Open in browser
213213-```
214214-215215-### Workspaces
216216-```bash
217217-td workspace list
218218-td workspace view "Workspace Name"
219219-td workspace projects "Workspace Name" # or --workspace "Workspace Name"
220220-td workspace users "Workspace Name" --role ADMIN,MEMBER # or --workspace "..."
221221-```
222222-223223-### Activity
224224-```bash
225225-td activity # Recent activity
226226-td activity --since 2024-01-01 --until 2024-01-31
227227-td activity --type task --event completed
228228-td activity --project "Work"
229229-td activity --by me
230230-```
231231-232232-### Notifications
233233-```bash
234234-td notification list
235235-td notification list --unread
236236-td notification list --type "item_assign"
237237-td notification view id:123
238238-td notification read --all --yes # Mark all as read
239239-td notification accept id:123 # Accept share invitation
240240-td notification reject id:123 # Reject share invitation
241241-```
242242-243243-### Reminders
244244-```bash
245245-td reminder list "task name" # or --task "task name"
246246-td reminder add "task name" --before 30m # or --task "task name" --before 30m
247247-td reminder add "task name" --at "2024-01-15 10:00"
248248-td reminder update id:123 --before 1h
249249-td reminder delete id:123 --yes
250250-```
251251-252252-### Stats
253253-```bash
254254-td stats # View karma and productivity
255255-td stats --json
256256-td stats goals --daily 10 --weekly 50
257257-td stats vacation --on # Enable vacation mode
258258-td stats vacation --off # Disable vacation mode
259259-```
260260-261261-### Settings
262262-```bash
263263-td settings view
264264-td settings view --json
265265-td settings update --timezone "America/New_York"
266266-td settings update --time-format 24 --date-format intl
267267-td settings themes # List available themes
268268-```
269269-270270-### Shell Completions
271271-```bash
272272-td completion install # Install tab completions (prompts for shell)
273273-td completion install bash # Install for specific shell
274274-td completion install zsh
275275-td completion install fish
276276-td completion uninstall # Remove completions
277277-```
278278-279279-### View (URL Router)
280280-```bash
281281-td view <todoist-url> # Auto-route to appropriate view by URL type
282282-td view https://app.todoist.com/app/task/buy-milk-abc123
283283-td view https://app.todoist.com/app/project/work-def456
284284-td view https://app.todoist.com/app/label/urgent-ghi789
285285-td view https://app.todoist.com/app/filter/work-tasks-jkl012
286286-td view https://app.todoist.com/app/today
287287-td view https://app.todoist.com/app/upcoming
288288-td view <url> --json # JSON output for entity views
289289-td view <url> --limit 25 --ndjson # Passthrough list options where supported
290290-```
291291-292292-### Update
293293-```bash
294294-td update # Update CLI to latest version
295295-td update --check # Check for updates without installing
296296-```
297297-298298-## Examples
299299-300300-### Daily workflow
301301-```bash
302302-td today --json | jq '.results | length' # Count today's tasks
303303-td inbox --limit 5 # Quick inbox check
304304-td upcoming # What's coming this week
305305-td completed # What I finished today
306306-```
307307-308308-### Filter by multiple criteria
309309-```bash
310310-td task list --project "Work" --label "urgent" --priority p1
311311-td task list --filter "today & #Work"
312312-td task list --workspace "Work" --due today
313313-```
314314-315315-### Complete tasks efficiently
316316-```bash
317317-td task complete "Review PR"
318318-td task complete id:123456789
319319-td task uncomplete id:123456789 # Reopen if needed
320320-```