Skip to content

feat(embed): make excludeDirs configurable via QMD_EXCLUDE_DIRS#405

Open
mvanhorn wants to merge 1 commit intotobi:mainfrom
mvanhorn:osc/271-configurable-exclude-dirs
Open

feat(embed): make excludeDirs configurable via QMD_EXCLUDE_DIRS#405
mvanhorn wants to merge 1 commit intotobi:mainfrom
mvanhorn:osc/271-configurable-exclude-dirs

Conversation

@mvanhorn
Copy link
Contributor

Fixes #271

Summary

The exclude directory list (node_modules, .git, .cache, vendor, dist, build) was hardcoded in two separate places with no way to extend it. Users with non-standard layouts (Obsidian vaults, temp directories, etc.) couldn't exclude additional directories from indexing.

Changes

  • Add QMD_EXCLUDE_DIRS env var (comma-separated) to append custom directories to the default exclude list
  • Extract getExcludeDirs() helper in store.ts to eliminate the duplication between store.ts and cli/qmd.ts
  • Add 3 unit tests covering default behavior, custom dirs, and whitespace handling

Usage

# Exclude .obsidian and tmp directories during indexing
QMD_EXCLUDE_DIRS=".obsidian,tmp" qmd collection add ~/vault --name notes

Default behavior is unchanged when the env var is unset.

This contribution was developed with AI assistance (Claude Code).

The exclude directory list was hardcoded to node_modules, .git, .cache,
vendor, dist, build in two separate places. Users with non-standard
layouts had no way to add directories like .obsidian or tmp.

Add QMD_EXCLUDE_DIRS env var (comma-separated) that appends to the
defaults. Extract a shared getExcludeDirs() helper to eliminate the
duplication between store.ts and cli/qmd.ts.

Fixes tobi#271

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

Feature request: make excludeDirs user-configurable

1 participant