Skip to content

feat(update): add --exclude flag and resilient file reads#461

Open
JonathanWorks wants to merge 2 commits intotobi:mainfrom
JonathanWorks:feat/exclude-flag-and-resilient-reads
Open

feat(update): add --exclude flag and resilient file reads#461
JonathanWorks wants to merge 2 commits intotobi:mainfrom
JonathanWorks:feat/exclude-flag-and-resilient-reads

Conversation

@JonathanWorks
Copy link
Copy Markdown

Summary

Two small improvements to qmd update:

1. --exclude flag (fixes #459)

Inverse of -c — update all collections except named ones:

qmd update --exclude openclaw-docs
qmd update --exclude openclaw-docs --exclude pwm-reading

Mutually exclusive with -c (errors if both provided).

2. Resilient file reads (fixes #460)

Wraps readFileSync in try/catch during indexing. On ETIMEDOUT/ENOENT/EAGAIN:

  • Logs warning with filename and error code
  • Skips the file and continues indexing
  • Reports skipped files at end of collection update

Applies to both reindexCollection() (update path) and indexFiles() (collection add path).

Changes

  • src/cli/qmd.ts — CLI option parsing, updateCollections, indexFiles, help text
  • src/store.tsReindexResult type, reindexCollection error handling

Test plan

  • qmd update --exclude <collection> updates all except named
  • qmd update -c foo --exclude bar errors with mutual exclusivity message
  • File with ETIMEDOUT is skipped, remaining files indexed, summary reported
  • qmd update with no flags still updates all (backward compatible)

JasonOA888 and others added 2 commits March 21, 2026 00:59
The -c/--collection flag now works with 'qmd update' to filter
which collections to update. This is useful when you have many
collections and only want to re-index specific ones.

Usage:
  qmd update -c notes              # Update only 'notes' collection
  qmd update -c notes -c docs      # Update 'notes' and 'docs' collections
  qmd update                       # Update all collections (existing behavior)

Fixes tobi#298
- Add --exclude flag for qmd update (inverse of -c)
- Validate -c and --exclude are mutually exclusive
- Wrap readFileSync in try/catch with warning logs for ETIMEDOUT/ENOENT/EAGAIN
- Track and report skipped files at end of collection update
- Merged upstream PR tobi#335 for -c flag
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.

fix(update): readFileSync crashes on ETIMEDOUT instead of skipping file feat(update): add --exclude flag for qmd update

2 participants