Skip to content

feat: add sites command to CLI#55

Merged
saurabhsharma2u merged 4 commits intomainfrom
feat/add-sites-command-6433421688746822513
Feb 26, 2026
Merged

feat: add sites command to CLI#55
saurabhsharma2u merged 4 commits intomainfrom
feat/add-sites-command-6433421688746822513

Conversation

@saurabhsharma2u
Copy link
Copy Markdown
Contributor

This PR introduces a new crawlith sites command that lists all tracked websites along with their snapshot statistics (count, last crawl date, page count, health score).

Changes include:

  • Core:
    • Updated SiteRepository with getAllSites().
    • Updated SnapshotRepository with getSnapshotCount() and getLatestSnapshot().
    • Exported repository classes from src/db/index.ts to make them accessible to the CLI.
  • CLI:
    • Added src/commands/sites.ts which implements the listing logic.
    • Registered the command in src/index.ts.
    • Added unit tests for the command in tests/sites.test.ts.
  • Tests:
    • Added plugins/core/tests/db_repos.test.ts to verify the new repository methods.

PR created automatically by Jules for task 6433421688746822513 started by @saurabhsharma2u

- Added `getAllSites` to `SiteRepository`
- Added `getSnapshotCount` and `getLatestSnapshot` to `SnapshotRepository`
- Exported repositories from `@crawlith/core`
- Implemented `crawlith sites` command in CLI
- Added tests for new repository methods and CLI command
@google-labs-jules
Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Rewrote `plugins/cli/src/index.ts` to ensure clean syntax and remove potential hidden artifacts that caused a "Declaration or statement expected" linting error in CI.

Also verified that tests pass:
- `plugins/core/tests/db_repos.test.ts`
- `plugins/cli/tests/sites.test.ts`
- Fixed `tests/db/repositories.test.ts` by ensuring `first_seen_snapshot_id` is set in manual DB inserts, matching schema expectations for `getPagesIteratorBySnapshot`.
- Fixed `tests/scoring.test.ts` by updating mock objects to include `meta.crawlStatus`, preventing TypeErrors in updated scoring logic.
- Fixed `tests/analyze.integration.test.ts` by adding `scope: 'site'` option to `analyzeSite` and updating tests to use it, ensuring full site analysis is returned when expected.
- Added `scope` option to `AnalyzeOptions` in `plugins/core/src/analysis/analyze.ts` to control filtering behavior.
@saurabhsharma2u saurabhsharma2u marked this pull request as ready for review February 26, 2026 20:56
@saurabhsharma2u saurabhsharma2u merged commit 09f5fdb into main Feb 26, 2026
6 checks passed
@saurabhsharma2u saurabhsharma2u deleted the feat/add-sites-command-6433421688746822513 branch February 26, 2026 20:57
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.

1 participant