Repository navigation
Conversation
`squirrel audit <url> -f json` printed "New crawl: ...", "Found N URLs in sitemap" and intercepted logger lines on stdout ahead of the report, so `squirrel audit <url> -f json | jq` failed. Progress now takes an output stream, and audit sends it to stderr for every format except console. `squirrel audit -f <unknown>` now validates the format up front and exits 1, like `squirrel report -f`, instead of running the audit, printing nothing and exiting 0. Adds an end-to-end test against a local Bun.serve site that checks stdout starts with the report for json, xml, llm, markdown and text, and that an unknown format exits 1. Signed-off-by: Claude <[email protected]>
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
squirrel audit <url> -f json(andxml,llm,markdown,text) printed progress and log lines on stdout before the report. The first line wasNew crawl: http://..., followed byFound N URLs in sitemapand any intercepted logger lines. That brokesquirrel audit <url> -f json | jq .meta, which is how coding agents read the CLI.apps/cli/src/cli/progress.ts:Progress/createProgresstake an output stream ("stdout"by default). The spinner,log()and the final messages all write to that stream, and its TTY state controls the spinner.apps/cli/src/cli/commands/audit.ts: progress goes to stdout only for the console format and to stderr for every other format. The logger interceptor goes throughprogress.log, so it moves to stderr too.squirrel audit -f <unknown>now runsvalidateFormatbefore crawling and exits 1 withUnknown format: ..., the same assquirrel report -f. Before, it ran the whole audit, printed nothing and exited 0.crawlis unchanged: it has no--formatand its output is all console.[Unreleased] > Fixedentries.Known gap, not fixed here: the logger still picks colour for intercepted warn/error lines from stdout's TTY state. With
NO_COLORunset, stdout on a terminal and stderr redirected to a file, those lines can carry ANSI codes into the file.Agent skill (
squirrelscan/skills): no change needed. Piping-f json/-f llmnow works the way the skill already expects.Verification
Bun.servesite: stdout beganNew crawl: http://localhost:4100, thenFound 2 URLs in sitemap, then{. With the fix, stdout's first bytes are{/<?xml/<?xml/# squirrelscan/squirrelscan vfor json / xml / llm / markdown / text, andsquirrel audit http://localhost:4100 -f json 2>/dev/null | jq -c .metaprints the meta object.squirrel audit <url> -f bogusprintsError: Unknown format: bogus. Supported: ...and exits 1.apps/cli/tests/cli/audit-stdout.test.ts: runs the real entry point against aBun.servesite with a scratch HOME and--offline. The 7 tests fail on main and pass with this change.bun testin apps/cli: 2833 pass, 1 fail. The failure ischeckReachability > returns unreachable for non-existent domains, which also fails on main in this sandbox because the network proxy resolves every hostname.bun run typecheck,bun run lint,bun run format:checkin apps/cli: clean.Checklist
Signed-off-byline (git commit -s).Generated by Claude Code