Skip to content

Output Formats

gitinspect supports three output formats, controlled by the --format flag.

JSON (default)

bash
gitinspect inspect --format json .
json
{
  "tree": {
    "README.md": "# my-project\n...",
    "main.go": "package main\n...",
    "go.mod": "module github.com/user/project\n..."
  },
  "stats": {
    "file_count": 3,
    "total_bytes": 456,
    "total_tokens": 114,
    "truncated": false
  },
  "dependencies": [
    "github.com/go-git/go-git/v5@v5.12.0"
  ],
  "version": "0.1.0"
}

Fields

FieldTypeDescription
treemap[string]stringFile paths to file contents
stats.file_countintNumber of files included
stats.total_bytesintTotal bytes of all file contents
stats.total_tokensintEstimated total tokens across all files
stats.truncatedboolWhether any content was truncated
dependencies[]stringExtracted dependency strings
versionstringgitinspect version

Text

bash
gitinspect inspect --format text .
File: README.md
---
# my-project
...

File: main.go
---
package main
...

Useful for piping into LLM prompts directly.

YAML

bash
gitinspect inspect --format yaml .
yaml
tree:
  README.md: |
    # my-project
  main.go: |
    package main
stats:
  file_count: 2
  total_bytes: 123
  total_tokens: 31
  truncated: false
dependencies:
  - github.com/go-git/go-git/v5@v5.12.0
version: 0.1.0

Released under the Apache-2.0 License.