This repo is a small Node.js script for exporting Supabase data into an Obsidian vault.
export-obsidian.mjsholds all script logic (CLI parsing, Supabase fetches, note generation).export-obsidian.mddocuments behavior, output structure, and options..env.exampleshows required environment variables; copy to.envfor local runs.AGENTS.md(this file) describes contribution expectations.
There is no separate src/ or tests/ directory; keep changes localized and well-organized within export-obsidian.mjs.
node export-obsidian.mjs --out /path/to/Vaultruns the exporter.node export-obsidian.mjs --env /path/to/.env --out /path/to/Vaultoverrides the env file.node export-obsidian.mjs --helpprints CLI usage.
No build step is required. There are no automated tests in this repository.
- JavaScript (ES modules) with 2-space indentation and semicolons.
- Prefer clear function names that describe behavior (
inferYear,buildIssueNote). - Keep helper utilities (formatting, slugging, data fetchers) as small, pure functions when possible.
- Avoid introducing new dependencies unless required for core functionality.
- No test framework is configured.
- If you add tests, document how to run them and keep them lightweight (e.g., a
nodescript). - For manual validation, run the exporter against a test vault and inspect generated notes.
- No Git history is available to infer conventions. Use concise, imperative commit messages (e.g., "Add year inference fallback").
- PRs should include a brief description of changes, expected output differences, and any new environment requirements.
- If output structure changes, update
export-obsidian.mdand include a small example in the PR description.
- Required env vars:
VITE_SUPABASE_URL,VITE_SUPABASE_ANON_KEY. - Default env resolution:
./.envif present, otherwise./kitanocr-web/.env. - Output directories (
Overview.md,Years/,Issues/,Pages/) are overwritten each run.