Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add support for indexing multiple directories into a single database #142

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
Copilot wants to merge 4 commits into main
base: main
Choose a base branch
Loading
from copilot/add-multiple-directory-processing

Conversation

Copy link
Contributor

Copilot AI commented Dec 24, 2025
edited
Loading

The CLI treated the second argument as a config file, preventing multiple directories from being indexed. Additionally, running the command sequentially overwrote previous data because each run reset the database.

Changes

CLI (src/bin/index.js)

  • Accept multiple directory paths as positional arguments
  • Identify config files by .js or .json extensions instead of position

Library (src/lib/markdowndb.ts)

  • Add indexFolders() method that accumulates files from multiple directories before writing to database
  • Fix watch mode path matching to handle overlapping directory names (e.g., /content and /content-backup)
  • Preserve existing indexFolder() for backward compatibility

Tests (src/tests/cli.spec.ts)

  • Add test verifying multiple directories index into a single database

Documentation (README.md)

  • Document multi-directory usage

Usage

# Index multiple directories
npx mddb ./blog ./docs ./notes
# With config file (detected by extension)
npx mddb ./blog ./docs markdowndb.config.js
# Watch mode
npx mddb ./blog ./docs --watch

Single directory usage remains unchanged.

Original prompt

This section details on the original issue you should resolve

<issue_title>Feature addition: processing multiple directories together</issue_title>
<issue_description> npx mddb DirOne/ dir_two/ fails as it thinks the second is a config file.

npx mddb "DirOne/ dir_two/" doesn't work, nor does a semi-colon instead of a space as a separator.

I could do them one by one in a python loop and with "late answer" from https://stackoverflow.com/questions/80801/how-can-i-merge-many-sqlite-databases could then merge them all into single ./markdowndb

If I do them one at a time like so:

npx mddb DirOne/ 
npx mddb dir_two/

Then only the last one's data is in the ./markdowndb DB</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copy link

changeset-bot bot commented Dec 24, 2025
edited
Loading

⚠️ No Changeset found

Latest commit: 5a749c3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copilot AI and others added 3 commits December 24, 2025 18:11
Co-authored-by: rufuspollock <180658+rufuspollock@users.noreply.github.com>
Co-authored-by: rufuspollock <180658+rufuspollock@users.noreply.github.com>
Co-authored-by: rufuspollock <180658+rufuspollock@users.noreply.github.com>
Copilot AI changed the title (削除) [WIP] Add feature for processing multiple directories together (削除ここまで) (追記) Add support for indexing multiple directories into a single database (追記ここまで) Dec 24, 2025
Copilot AI requested a review from rufuspollock December 24, 2025 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@rufuspollock rufuspollock Awaiting requested review from rufuspollock

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Feature addition: processing multiple directories together

2 participants

AltStyle によって変換されたページ (->オリジナル) /