Skip to content

Dependency Extraction

gitinspect automatically extracts dependencies from common manifest files.

Supported Files

FileParserOutput Format
go.modLine parsergithub.com/foo/bar@v1.2.3
package.jsonJSON parserreact@^18.0.0
Cargo.tomlTOML parserserde@1.0
requirements.txtLine parserflask==2.0
GemfileRegex parserrails

How It Works

Dependencies are extracted from each manifest file as it's processed. They appear in the dependencies array of the output:

json
{
  "dependencies": [
    "github.com/go-git/go-git/v5@v5.12.0",
    "github.com/bmatcuk/doublestar/v4@v4.6.1",
    "gopkg.in/yaml.v3@v3.0.1"
  ]
}

Example

bash
gitinspect inspect --format json .

For a Go project with this go.mod:

module example.com/app

go 1.25

require (
    github.com/go-git/go-git/v5 v5.12.0
    gopkg.in/yaml.v3 v3.0.1
)

The output will include:

json
{
  "dependencies": [
    "github.com/go-git/go-git/v5@v5.12.0",
    "gopkg.in/yaml.v3@v3.0.1"
  ]
}

Released under the Apache-2.0 License.