Add --single flag to disable recursive crawling for single-page mode#44
Merged
YusukeHirao merged 4 commits intomainfrom Mar 5, 2026
Merged
Add --single flag to disable recursive crawling for single-page mode#44YusukeHirao merged 4 commits intomainfrom
YusukeHirao merged 4 commits intomainfrom
Conversation
--single フラグが CLI 定義に存在するが startCrawl の recursive 判定に 含まれておらず、フラグが無視されていた問題を修正。 isList と同様に flags.single が true の場合は recursive: false を設定する。 Closes #32 https://claude.ai/code/session_01MtQUvLdJfkZGTaQf6ThhSd
- crawl.spec.ts: vi.resetModules() を追加しモジュールキャッシュの問題を解消 - crawl.spec.ts: as never キャストを型安全な CrawlFlags 型に置換 - crawl.spec.ts: 未使用の mockWrite/mockGarbageCollect トップレベル変数を削除 - crawl.spec.ts: --single と --recursive 同時指定のエッジケーステストを追加 - pipeline.spec.ts: --single フラグが startCrawl に正しく伝搬されるテストを追加 https://claude.ai/code/session_01MtQUvLdJfkZGTaQf6ThhSd
- recursive 判定にコメントを追加し、--single が recursive を無効化する 意図を明確化 - --single と --list/--list-file の同時指定時に警告メッセージを出力 - 同時指定シナリオのテストを追加 https://claude.ai/code/session_01MtQUvLdJfkZGTaQf6ThhSd
例セクションに --single の使用例が欠けていたため追加。 https://claude.ai/code/session_01MtQUvLdJfkZGTaQf6ThhSd
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
This PR introduces a new
--singleflag to the crawl command that disables recursive crawling, allowing users to crawl only a single page without following links. It also adds validation to warn users when conflicting flags are specified together.closes: #32
Key Changes
--singleflag: When enabled, setsrecursive: falseto crawl only the specified page(s) without following links--singleflag takes precedence over the--recursiveflag when both are specified--listand--list-filemodes already disable recursion;--singleis now ignored with a warning when used alongside these flags--singleis specified together with--listor--list-fileto clarify which flag takes effect--singleflag behavior with and without--recursive--listmodeImplementation Details
startCrawl()to checkflags.singlein addition toisListwhen determining therecursiveoptioncrawl()function to detect and warn about--singlecombined with--listor--list-filehttps://claude.ai/code/session_01MtQUvLdJfkZGTaQf6ThhSd