gopkg
is a lightweight dependency manager for Go projects. It provides an alternative to Go modules by managing dependencies through a custom gopkg.toml
file, with support for both local and global installations.
- Manage dependencies via
gopkg.toml
- Supports local (
./gopkg_modules/
) and global (~/.gopkg/modules/
) installation - Lockfile support via
gopkg.lock
- Auto detection mode (
--auto
) to scan Go imports and populategopkg.toml
- Adds
replace
directives togo.mod
automatically - CLI commands: install, update, remove, check, list, versions
- Clean command to wipe installed modules, cache, and lockfile
Install using go install
:
go install github.com/pageton/gopkg@latest
Or build manually:
git clone https://github.com/pageton/gopkg
cd gopkg
go build -o gopkg .
gopkg init
Creates a gopkg.toml
file and gopkg_modules/
directory.
gopkg add github.com/mattn/[email protected]
To add it globally, use:
gopkg add -g github.com/mattn/[email protected]
gopkg install
Or using alias:
gopkg i
Install globally:
gopkg install --global
Use --auto
to scan .go
files and populate gopkg.toml
:
gopkg install --auto
gopkg update
Update a specific module:
gopkg update github.com/mattn/go-sqlite3@latest
Update globally:
gopkg update -g
gopkg remove github.com/mattn/go-sqlite3
Remove globally:
gopkg remove -g github.com/mattn/go-sqlite3
gopkg versions github.com/mattn/go-sqlite3
gopkg check
gopkg clean --lock --cache
gopkg
├── cmd
│ ├── add.go
│ ├── check.go
│ ├── clean.go
│ ├── init.go
│ ├── install.go
│ ├── list.go
│ ├── remove.go
│ ├── root.go
│ ├── update.go
│ └── versions.go
├── core
│ ├── extract.go
│ ├── fetcher.go
│ ├── gomod.go
│ ├── importscan.go
│ ├── lockfile.go
│ ├── metadata.go
│ ├── module.go
│ ├── paths.go
│ └── version.go
├── go.mod
├── go.sum
└── main.go
Contributions are welcome. Please open an issue for suggestions or bugs, or submit a pull request directly. Make sure your code is clean and tested where appropriate.
MIT License