A command-line tool that lets you pick a resume file (PDF or DOCX) via a native file dialog, extracts its raw text, and uses an LLM (via the Groq API) to parse it into structured JSON matching a defined schema.
- Pick a file — opens a native OS file browser (via
zenity) restricted to.pdfand.docxfiles. - Extract text — reads the raw text content from the selected file:
- PDFs are parsed with
github.com/ledongthuc/pdf - DOCX files are parsed with
github.com/lu4p/cat
- PDFs are parsed with
- Parse with LLM — sends the raw resume text to Groq's chat completions API (
openai/gpt-oss-20bmodel) with a system prompt instructing it to extract fields matching a fixed JSON schema, and requests ajson_objectresponse format. - Structure the result — unmarshals the LLM's JSON output into a Go
Resumestruct and prints it.
The tool currently extracts:
type Resume struct {
Name string `json:"name"`
Email string `json:"email"`
Phone string `json:"phone"`
Skills []string `json:"skills"`
Education string `json:"education"`
}To parse against your own criteria, edit this struct and update the JSON schema described in the systemPrompt inside parseResumeWithLLM to match — the two need to stay in sync.
- Go installed (1.20+ recommended)
- A Groq API key
zenityinstalled on your system (for the file picker dialog):- Fedora:
sudo dnf install zenity - Debian/Ubuntu:
sudo apt install zenity - macOS: file dialogs work via a different native backend; no zenity install needed
- Fedora:
- Windows: uses the native Windows file dialog; no extra install needed
- Clone or copy this project into a folder.
- Initialize the Go module (if not already done):
go mod init resumeparser
- Install dependencies:
go get github.com/joho/godotenv go get github.com/ledongthuc/pdf go get github.com/lu4p/cat go get github.com/ncruces/zenity go mod tidy
- Create a
.envfile in the project root:GROQ_API_KEY=your_groq_api_key_here
go run main.goA file picker window will open. Select a .pdf or .docx resume. The tool will:
- Print the selected file path
- Extract and send the resume text to the LLM
- Print the parsed, structured fields
Everything currently lives in a single main.go file:
| Function | Responsibility |
|---|---|
extractText |
Reads a PDF or DOCX file and returns its raw text |
pickResumeFile |
Opens a native file picker dialog and returns the chosen path |
parseResumeWithLLM |
Sends resume text to Groq and returns a structured Resume |
main |
Wires the above together end-to-end |
- Only
.pdfand.docxare supported — no.doc,.rtf, or image-based/scanned PDFs (no OCR). - The schema is currently hardcoded for demonstration; swap in your actual parsing criteria.
- No retry logic if the LLM returns malformed JSON — errors are surfaced with the raw response for debugging.
- No batch mode yet — one resume per run.
no required module provides package ...— you forgot togo getthat dependency. Rungo mod tidy.open <file>: no such file or directory— the file picker didn't return the path you expected, or you hardcoded a filename that doesn't exist in your project folder.zenity: command not found/ dialog doesn't open — installzenityfor your OS (see Prerequisites).- LLM output doesn't match the schema — check the raw response printed in the error message; you may need to tighten the system prompt or reduce resume text length.