Skip to content

feat: PDF figure extraction tool + CLI infrastructure (doctor, install) - #30

Merged
klpanagi merged 3 commits into
devfrom
feat/pdf_figure_extraction
Jul 27, 2026
Merged

feat: PDF figure extraction tool + CLI infrastructure (doctor, install)#30
klpanagi merged 3 commits into
devfrom
feat/pdf_figure_extraction

Conversation

@klpanagi

Copy link
Copy Markdown
Owner

Summary

PDF Figure Extraction Tool

New pdf_extract_figures plugin tool that extracts embedded images from PDFs using PyMuPDF:

  • Parameters: file_path (required), output_dir, page, min_width, min_height, min_area, json_only
  • Output: JSON metadata (xref, page, dimensions, format, position, file size) + optional file saving
  • Verification: Manually tested with 2-page PDF (2 images), all filters working
  • Tests: 20 comprehensive tests (factory, validation, Python availability, execution, param passthrough)

CLI Infrastructure

Built the CLI layer with two commands:

matrixx doctor — Environment Diagnostics

5 health check categories:

Category What It Checks
installation Plugin registration, OpenCode version (>= 1.0.150)
configuration Config file validity (matrixx.jsonc)
authentication Provider API key status (Anthropic, OpenAI, Google)
dependencies Runtime deps: Bun, Node.js, Git, Python3
tools Optional: ast-grep, Gitleaks, PyMuPDF, Playwright

Flags: --json, --category <name>, --verbose

matrixx install — Setup Wizard

  • Interactive and --no-tui (CI/CD) modes
  • Subscription flags: --claude=<yes|no|max20>, --openai=<yes|no>, --gemini=<yes|no>, --copilot=<yes|no>, --opencode-zen=<yes|no>, --zai-coding-plan=<yes|no>
  • Auto-registers plugin in ~/.config/opencode/opencode.json

README Updates

  • Quick Start: CLI-based install (bunx opencode-matrixx install) + verify (doctor)
  • New CLI Reference section with doctor check table
  • Removed "Curious about the philosophy?" section at end
  • Added GitHub Star History chart

CI

  • Added 3 new mock.module() test files to isolation lists in both ci.yml and publish.yml

Verification

  • bun run typecheck — clean
  • bun test tests/cli/ — 32 pass, 0 fail
  • bun test tests/tools/pdf-extract-figures/ — 20 pass, 0 fail
  • bun run lint src/cli/ — clean (11 files, 0 errors)
  • All mock-heavy tests pass in isolation (44 tests across 3 files)

klpanagi added 3 commits July 27, 2026 18:45
Add pdf_extract_figures tool for extracting embedded images from PDFs
via PyMuPDF with filtering (page, min_width, min_height, min_area).

Add CLI infrastructure:
- matrixx doctor — environment diagnostics and health checks
  (plugin, config, auth, runtime, optional tools)
- matrixx install — setup wizard with --no-tui for CI/CD
- bin entry point + package.json registration

Update README with CLI reference, enhanced Quick Start,
GitHub Star History chart, remove Philosophy section.
Add tests/tools/pdf-extract-figures/tools.test.ts,
tests/cli/doctor/checks.test.ts, and tests/cli/install/index.test.ts
to mock-heavy isolation lists in both ci.yml and publish.yml to
prevent cross-file pollution from mock.module().
@klpanagi
klpanagi merged commit f1df13e into dev Jul 27, 2026
8 checks passed
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.

1 participant