Skip to content

feat(cli): add no-snapshot navigation output - #179

Merged
kunchenguid merged 1 commit into
kunchenguid:mainfrom
lmn451:feat/navigation-no-snapshot
Oct 15, 2026
Merged

kunchenguid merged 1 commit into
kunchenguid:mainfrom
lmn451:feat/navigation-no-snapshot

Conversation

@lmn451

@lmn451 lmn451 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Why

Navigation-to-eval and chained page-level workflows often do not use the automatically printed accessibility tree. Returning that unused tree adds output to the agent context, while UID-based click/fill workflows still benefit from the existing default. This opt-in flag lets the caller choose metadata-only output without changing that default.

This is an AXI presentation option, not a new MCP/browser capability. Snapshot capture remains in place to preserve the existing metadata and reference-freshness behavior. Token and latency savings have not been measured in real workflows; this PR does not claim reduced CDP/browser work. No environment-variable control or server/transport change is introduced.

Closes #178.

Local checks

  • pnpm run build passed.
  • pnpm test: 731 tests across 27 files passed.
  • pnpm exec prettier --check . passed.
  • The built CLI was also exercised against automation-owned Chrome; the pipeline live-validation evidence below covers the product scenarios.

What Changed

  • Add --no-snapshot to newpage and selectpage to print page metadata without the accessibility tree or snapshot-derived suggestions.
  • Continue capturing snapshots to preserve page metadata and fresh element-reference generations; the flag takes precedence over --full and works before or after the URL or page ID.
  • Document the new flag and its usage in the README and CLI help.

Risk Assessment

✅ Low: The change is limited to opt-in navigation output formatting; it retains snapshot capture and freshness handling, leaves default output unchanged, and matches the stated scope.

Testing

Drove the CLI against isolated headless Chrome and a disposable local counter page. Default trees, metadata-only navigation (including flag placement and --full precedence), selected-page eval, explicit snapshot UID click, and rejection outside navigation all behaved as expected. Captured CLI transcripts; a screenshot was not applicable to this terminal-only surface. No broad test suite, lint, or build was run in this assigned live-test phase.

  • Live validation: ✅ go - 5 of 5 scenarios driven live against the product
Scenario Result Live Evidence
Navigation keeps automatic snapshots by default ✅ pass live Live newpage https://example.com and selectpage 2 CLI runs; selectpage transcript is in the Default selectpage output artifact.
Opt-out keeps page metadata and suppresses automatic tree output, regardless of flag placement or --full ✅ pass live Live newpage --no-snapshot http://127.0.0.1:19400, selectpage --no-snapshot 3 --full, and newpage http://127.0.0.1:19400 --full --no-snapshot runs; see the metadata-only output artifacts.
Selecting a page without its printed snapshot preserves selection for eval ✅ pass live Live selectpage --no-snapshot 3 --full followed by eval 'document.title'; see the selected-page eval output artifact.
Explicit snapshot after navigation still provides a usable UID ✅ pass live Live snapshot, click @g5:2_3, then eval 'document.querySelector("button").textContent'; snapshot and resulting value "1" were observed in CLI output.
Other commands reject the navigation-only flag ✅ pass live Live snapshot --no-snapshot returned Unknown flag --no-snapshot for snapshot with VALIDATION_ERROR.
Evidence: Default selectpage output
page:
  title: Example Domain
  refs: 9
snapshot:
uid=g3:1_0 RootWebArea "Example Domain" url="https://example.com/"
  uid=g3:1_1 StaticText "This domain is for use in documentation examples without needing permission. This is not a service; avoid relying on it for testing and monitoring purposes."
  uid=g3:1_2 StaticText "هذا النطاق مُخصص للاستخدام في أمثلة التوثيق دون الحاجة إلى إذن. هذه ليست خدمة، يُرجى تجنب الاعتماد عليها لأغراض الاختبار والمراقبة."
  uid=g3:1_3 StaticText "该域名仅用于文档示例,无需获得许可。这并非一项服务,请勿将其用于测试和监控目的。"
  uid=g3:1_4 StaticText "L’usage de ce domaine est réservé à des exemples de documentation, sans autorisation préalable. Il ne s’agit pas d’un service ; son utilisation à des fins de test ou de surveillance est à éviter."
  uid=g3:1_5 StaticText "Данный домен предназначен для использования в примерах документации без необходимости получения предварительного разрешения. Это не сервис; не рекомендуется его использование для тестирования и мониторинга."
  uid=g3:1_6 StaticText "Este dominio está destinado al uso en ejemplos de documentación sin necesidad de permiso. Esto no es un servicio; evitar utilizarlo para realizar pruebas o monitoreos."
  uid=g3:1_7 link "Learn more" url="https://iana.org/help/example-domains"
    uid=g3:1_8 StaticText "Learn more"
help[3]:
  Run `chrome-devtools-axi click @g3:1_7` to click the "Learn more" link
  Run `chrome-devtools-axi scroll down` to scroll down
  Use `chrome-devtools-axi eval <expr>` for JS expressions. For multi-statement code, pass a function: `eval "() => { ...; return result }"`
Evidence: Metadata-only newpage output
page:
  title: AXI Counter Fixture
  url: "http://127.0.0.1:19400"
  refs: 4
Evidence: Metadata-only selectpage with --full
page:
  title: AXI Counter Fixture
  refs: 4
Evidence: Selected-page eval output
result: "\"AXI Counter Fixture\""
help[1]:
  Run `chrome-devtools-axi snapshot` to see current page state
Evidence: Explicit snapshot with fresh UID
page:
  title: AXI Counter Fixture
  refs: 4
snapshot:
uid=g5:2_0 RootWebArea "AXI Counter Fixture" url="http://127.0.0.1:19400/"
  uid=g5:2_1 main
    uid=g5:2_2 heading "Counter" level="1"
    uid=g5:2_3 button "0"
help[2]:
  Run `chrome-devtools-axi click @g5:2_3` to click the "0" button
  Use `chrome-devtools-axi eval <expr>` for JS expressions. For multi-statement code, pass a function: `eval "() => { ...; return result }"`
Evidence: newpage --full --no-snapshot output
page:
  title: AXI Final Fixture
  url: "http://127.0.0.1:19400"
  refs: 2

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 5 of 5 scenarios driven live against the product
Scenario Result Live Evidence
Navigation keeps automatic snapshots by default ✅ pass live Live newpage https://example.com and selectpage 2 CLI runs; selectpage transcript is in the Default selectpage output artifact.
Opt-out keeps page metadata and suppresses automatic tree output, regardless of flag placement or --full ✅ pass live Live newpage --no-snapshot http://127.0.0.1:19400, selectpage --no-snapshot 3 --full, and newpage http://127.0.0.1:19400 --full --no-snapshot runs; see the metadata-only output artifacts.
Selecting a page without its printed snapshot preserves selection for eval ✅ pass live Live selectpage --no-snapshot 3 --full followed by eval &#39;document.title&#39;; see the selected-page eval output artifact.
Explicit snapshot after navigation still provides a usable UID ✅ pass live Live snapshot, click @g5:2_3, then eval &#39;document.querySelector(&#34;button&#34;).textContent&#39;; snapshot and resulting value &#34;1&#34; were observed in CLI output.
Other commands reject the navigation-only flag ✅ pass live Live snapshot --no-snapshot returned Unknown flag --no-snapshot for snapshot with VALIDATION_ERROR.
  • HOME=<worktree-local temp HOME> CHROME_DEVTOOLS_AXI_SESSION=nav-live CHROME_DEVTOOLS_AXI_PORT=19324 pnpm exec tsx bin/chrome-devtools-axi.ts newpage https://example.com
  • pnpm exec tsx bin/chrome-devtools-axi.ts newpage --no-snapshot http://127.0.0.1:19400
  • pnpm exec tsx bin/chrome-devtools-axi.ts selectpage 2
  • pnpm exec tsx bin/chrome-devtools-axi.ts selectpage --no-snapshot 3 --full
  • pnpm exec tsx bin/chrome-devtools-axi.ts eval 'document.title'
  • pnpm exec tsx bin/chrome-devtools-axi.ts snapshot
  • pnpm exec tsx bin/chrome-devtools-axi.ts click @g5:2_3
  • pnpm exec tsx bin/chrome-devtools-axi.ts eval 'document.querySelector("button").textContent'
  • pnpm exec tsx bin/chrome-devtools-axi.ts snapshot --no-snapshot
  • pnpm exec tsx bin/chrome-devtools-axi.ts newpage http://127.0.0.1:19400 --full --no-snapshot
  • Closed disposable pages where possible, stopped both isolated bridges and the local fixture server, removed .test-runtime, and confirmed the worktree had no reported changes.
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@greptile-apps

greptile-apps Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Reviews (1) · Last reviewed commit: "feat(cli): allow metadata-only navigatio..." · Reviewed by Greptile

@kunchenguid
kunchenguid merged commit 73d1020 into kunchenguid:main Oct 15, 2026
5 checks passed
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: triaged against VISION.md on main b27878f (0.1.42).

VISION per-rule

  1. Scope / MCP parity: aligns. No new browser capability; new_page / select_page / take_snapshot calls are unchanged (stampFresh() still runs).
  2. No functionality chrome-devtools-mcp cannot provide: aligns. Presentation only, in formatPageOutput (src/cli.ts).
  3. AXI interface / agent use: aligns. Opt-out of a large auto tree for navigate-then-eval chains; the flag is declared in COMMAND_FLAGS so other commands still fail loud on it. Dropping snapshot-derived help is consistent, since those suggestions would point at UIDs that were not printed.
  4. Reshape without expanding capability: aligns.
  5. Reliability: aligns (neutral). Generation / fresh-ref semantics unchanged because capture still runs.
  6. Not an independent automation implementation: aligns.

Contract-class: opt-in. The unconfigured newpage / selectpage output is unchanged; the early return only happens when --no-snapshot is passed.

CI green (build-and-test, generated-files guard, no-mistakes), Greptile 5/5, diff reviewed. Squash-merged as 73d1020.

Speaking as Kun's firstmate: this is merged. Thank you @lmn451 — really appreciate you taking the time on this.

@github-actions

Copy link
Copy Markdown
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add --no-snapshot output option to newpage and selectpage

2 participants