Skip to content
/ gopkg Public

Alternative Go dependency manager using gopkg.toml, with local/global installs, lockfile support, and import auto-detection.

License

Notifications You must be signed in to change notification settings

pageton/gopkg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gopkg

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.

Features

  • 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 populate gopkg.toml
  • Adds replace directives to go.mod automatically
  • CLI commands: install, update, remove, check, list, versions
  • Clean command to wipe installed modules, cache, and lockfile

Installation

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 .

Usage

1. Initialize a project

gopkg init

Creates a gopkg.toml file and gopkg_modules/ directory.

2. Add a dependency

gopkg add github.com/mattn/[email protected]

To add it globally, use:

gopkg add -g github.com/mattn/[email protected]

3. Install dependencies

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

4. Update dependencies

gopkg update

Update a specific module:

gopkg update github.com/mattn/go-sqlite3@latest

Update globally:

gopkg update -g

5. Remove a dependency

gopkg remove github.com/mattn/go-sqlite3

Remove globally:

gopkg remove -g github.com/mattn/go-sqlite3

6. List available versions of a module

gopkg versions github.com/mattn/go-sqlite3

7. Check for outdated dependencies

gopkg check

8. Clean modules, lockfile, or cache

gopkg clean --lock --cache

Project Structure

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

Contributing

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.

License

MIT License

About

Alternative Go dependency manager using gopkg.toml, with local/global installs, lockfile support, and import auto-detection.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages