A lightweight command-line tool written in Go that parses JSON files and extracts values using dot-notation paths.
This project is built as a learning exercise to deepen my understanding of Go, type handling, error design, and CLI tooling.
⚠️ This project is still under active development
Expect breaking changes, missing edge cases, and ongoing refactoring.
Current focus areas:
- API stabilization
- Performance improvements
- Expanded JSON path features
- Better CLI UX
- Parse JSON files from disk
- Access nested values using dot notation
- Supports:
- Objects
- Arrays (by index)
- Scalars (string, number, boolean, null)
- Custom error handling for:
- Invalid keys
- Array out-of-bounds access
- Pretty printing result with
--pretty
Get the pkg
go get https://github.com/seggewiss/jp.gitjp [--pretty] <file> <dotNotationPath>Given data.json:
{
"user": {
"name": "John",
"age": 30,
"tags": ["dev", "go"]
}
}Run:
jp data.json user.nameOutput:
{
"user.name": "John"
}Array access:
jp data.json user.tags.0Output:
{
"user.tags.0": "dev"
}This project is part of my effort to:
- Get my hands into Go again
- Build production-style project structure (cmd/, pkg/)
- Practice error handling patterns
- Work with encoding/json internals
- Improve testing discipline
- No JSONPath support (only simple dot notation)
- No wildcards or filters
- No streaming for large JSON files
- Limited CLI features
- Error messages still evolving
- JSONPath-like expressions
- Performance optimizations for large files
- Optional JSON streaming decoder
- More expressive error reporting
- Benchmark suite
This project is intentionally kept minimal and experimental. The goal is not just functionality, but understanding how Go handles real-world data traversal and tooling design.