Repository navigation
Add s1 deepcrawl for whole-site crawls, release 2.3.0 - #17
Merged
Merged
Conversation
s1 deepcrawl <url> and the deepcrawl()/deepcrawlStatus() SDK helpers call
POST /deepcrawl and GET /deepcrawl/status/{taskId}: one task crawls a site or
section and returns every page as Markdown. The command waits for the task
(--timeout, polling every 2 s) and prints the stats, one line per page,
failed URLs and the result URL. Options cover --type, -n/--max-pages,
repeatable --include/--exclude path rules, --format json|zip (json by
default), -o/--output, --no-wait and --json; s1 deepcrawl status <taskId>
checks a task for free. Options are validated before any credits are spent.
The agent skill routes whole-site crawls to it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What changed
s1 deepcrawl <url>starts aPOST /deepcrawltask, pollsGET /deepcrawl/status/{taskId}every 2 s until it finishes or--timeoutruns out (default 300 s), then prints the message, a stats line, one line per page (title, URL, character count), failed URLs and theresultUrl/zipUrl. The help text and output say a task costs 20 credits.--type sitemap|all,-n/--max-pages(1-1000), repeatable--include <path>/--exclude <path>(up to 20 each, at most 200 characters),--format json|zip(the CLI defaults tojson; the API default stayszip),--no-wait(print the task id and exit),--timeout <seconds>,-o/--output <file>(writes{ pages, failed }for json, downloads the result URL when the result is too large to inline, or downloads the ZIP),--json(raw status response).s1 deepcrawl status <taskId>. A failed task exits 1 with the API's error. A completed task that found nothing prints its message.s1 deepcrawl status <taskId> [-o <file>] [--json]checks a task once (free).deepcrawl()anddeepcrawlStatus()plus types.deepcrawlStatusreturns a failed task (the API sends it as an HTTP 500 that still describes the task) instead of throwing. It throws for 404 (unknown task) and other errors.api.tsgains a smallsend()helper so the status call can use GET.request()behaves the same as before.enablePositionalOptions(), so options after a subcommand belong to that subcommand (s1 deepcrawl status <id> --jsonreachesstatus). Side effect:s1 search -Vnow errors;s1 -V/s1 --versionstill work.reference/examples.md.src/learn.tsdoesn't list commands, so it is unchanged.package.json/package-lock.json, CHANGELOG entry dated 2026-11-05, matching the 2.2.0 release.How it was tested
npm test(build +node --test tests/*.test.mjs): 47/47 pass. No live API calls.tests/deepcrawl.test.mjsruns the built CLI against a local mock Search1API (HTTP server). It covers the request body, polling throughprocessing, human output,--json,-ofor JSON pages and ZIP download,status --json,--no-wait, failed tasks (500), timeout, an empty completed task, and 11 invalid-option cases that must not reach the API.tests/sdk.test.mjs: the body sent bydeepcrawl(), and howdeepcrawlStatus()handles GET, task-id URL encoding, failed tasks (500), 404 and 502.tests/commands.test.mjs: help output fordeepcrawlanddeepcrawl status.npx tsc --noEmitis clean.npm pack --dry-runincludesdist/commands/deepcrawl.js. The repo has no lint setup.Sample output (mocked):
What to check after release
s1 deepcrawl https://hono.dev/docs/ -n 20 --include /docs(20 credits). It should finish in about 10-20 s with 20 pages listed. Then runs1 deepcrawl status <taskId> -o pages.jsonand check that the file haspages[].content.--format zip -o site.zipdownloads a valid ZIP from the livezipUrl.s1 deepcrawl status <unknown-id>shows the API's 404 "Task not found" error.s1 update/ npm deliver it.🤖 Generated with Claude Code