A while back I kept running into the same problem: I had a bunch of notes, specs, and markdown docs on my laptop, but when I opened ChatGPT and asked questions about them, the model obviously didn’t know they existed. Copy-pasting files was tedious; manually uploading one by one wasn’t much better. So I built a tiny CLI that does the boring bit for me: openai-folder-sync
, a command-line tool that syncs a local directory to an OpenAI Vector Store, so those files become searchable context for ChatGPT.
OpenAI’s file search is built around a vector store. You add files to a store, they’re processed into embeddings, and assistants (or ChatGPT via connected tools) can retrieve and ground answers using those files. It’s a clean model, but it assumes you’ll remember to upload and maintain your file set. A sync step—which mirrors a folder you already care about—is closer to how we work day to day.
openai-folder-sync
scans a directory on your machine, filters files by extension, and pushes them to an existing vector store. You can run it once to populate a store, or add it to your routine (e.g., a cron job) to keep your knowledge base fresh. There’s also a switch to embed git metadata (branch and commit) into the uploaded content, so when ChatGPT cites something, you know exactly which version it came from.
md,txt,pdf
)--git-info
)Repo: https://github.com/JensWalter/openai-folder-sync
It’s written in Rust and installs via Cargo:
cargo install --git https://github.com/JensWalter/openai-folder-sync.git
Cargo will build and place the openai-folder-sync binary on your PATH.
Usage
You’ll need an OpenAI API key and an existing vector store ID (looks like vs_…). Then point the CLI at your folder:
openai-folder-sync \
--vector-store 'vs_ABCDEFGHIJK' \
--local-dir '/Users/jens/tmp/wiki/content' \
--extensions md
Prefer running through Cargo during development?
cargo run -- \
--vector-store 'vs_ABCDEFGHIJK' \
--local-dir '/Users/jens/tmp/wiki/content' \
--extensions md
Most flags can also be set via environment variables:
export OPENAI_API_KEY=sk-...
export VECTOR_STORE=vs_ABCDEFGHIJK
export LOCAL_DIR=/Users/jens/tmp/wiki/content
export EXTENSIONS=md,txt,pdf
export GIT_INFO=true
openai-folder-sync
Common flags
--vector-store / VECTOR_STORE – target store ID
--local-dir / LOCAL_DIR – folder to sync
--extensions / EXTENSIONS – comma-separated list
--git-info / GIT_INFO – include git metadata (true|false)
--help – show all options
Once the files are in a vector store, ChatGPT (or your Assistants API apps) can retrieve relevant snippets from those files while answering your questions. That means you can ask things like “What did the proposal say about the migration timeline?” and the model will pull the relevant context from your synced docs—no copy-paste required. Your folder effectively becomes a living knowledge base.
I currently have no further plans for this tool. If you think something is still missing, just open an issue or PR.
⸻
If you want to try it, the repository includes install and usage details plus help output. I built it to make my own workflow simpler; if it saves you from a few copy-paste marathons and helps ChatGPT answer from your real documents, that’s a win. Happy syncing!