Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ bun.lockb
bin/
pdf2md

# test folder
test/

# IDE
.vscode/
.idea/
Expand Down
21 changes: 21 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# AGENTS.md

## Commands
- **Build**: `bun run build` - compiles to `bin/pdf2md`
- **Dev**: `bun run ./src/index.ts [args]` - run without compiling
- **Type check**: `bun tsc --noEmit`
- No test framework configured

## Architecture
- CLI tool using Commander.js with subcommands in `src/commands/`
- Entry: `src/index.ts` → commands: `convert` (default), `config`
- Utils: `src/utils/` - pdf extraction (unpdf), Gemini AI, config (conf)
- Compiles to standalone binary via `bun build --compile`

## Code Style
- **Runtime**: Bun (never npm/pnpm/yarn/node)
- **Module**: ESM with `.js` extensions in imports (even for .ts files)
- **Types**: Strict TypeScript, explicit error typing (`error: any`)
- **Imports**: node builtins with `node:` prefix, named exports preferred
- **Patterns**: async/await, ora spinners for progress, chalk for colors
- **Error handling**: try/catch with spinner.fail(), process.exit(1) for fatal errors
43 changes: 42 additions & 1 deletion bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,18 @@
"dependencies": {
"@google/generative-ai": "^0.24.1",
"chalk": "^5.6.2",
"chokidar": "^5.0.0",
"cli-progress": "^3.12.0",
"commander": "^14.0.2",
"conf": "^15.0.2",
"glob": "^13.0.0",
"ora": "^9.0.0",
"p-limit": "^7.2.0",
"unpdf": "^1.4.0"
},
"devDependencies": {
"@types/bun": "latest",
"@types/cli-progress": "^3.11.6",
"typescript": "^5"
}
}
Loading