All Projects → beatlabs → Gomodctl

beatlabs / Gomodctl

Licence: apache-2.0
Search, Check, and Update Go modules.

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Gomodctl

Npmvet
A simple CLI tool for vetting npm package versions
Stars: ✭ 193 (+421.62%)
Mutual labels:  cli, packages
tcl-modules
A collection of pure Tcl, production-ready micro packages
Stars: ✭ 25 (-32.43%)
Mutual labels:  modules, packages
Stow
GNU Stow - mirror of savannah git repository occasionally with more bleeding-edge branches
Stars: ✭ 207 (+459.46%)
Mutual labels:  cli, packages
Npm Compare
Compare npm packages from your terminal
Stars: ✭ 55 (+48.65%)
Mutual labels:  cli, packages
A To Z List Of Useful Node.js Modules
Collection of most awesome node modules that will extend the capability of your node.js application.
Stars: ✭ 315 (+751.35%)
Mutual labels:  modules, packages
Cjstoesm
A tool that can transform CommonJS to ESM
Stars: ✭ 109 (+194.59%)
Mutual labels:  cli, modules
opensource
Collection of Open Source packages by Otherwise
Stars: ✭ 21 (-43.24%)
Mutual labels:  modules, packages
Npm Upgrade
Interactive CLI utility to easily update outdated NPM dependencies
Stars: ✭ 245 (+562.16%)
Mutual labels:  cli, packages
Modclean
Remove unwanted files and directories from your node_modules folder
Stars: ✭ 309 (+735.14%)
Mutual labels:  cli, modules
lint-deps
Lint for unused or missing dependencies in your node.js projects. Customize with plugins or configuration.
Stars: ✭ 48 (+29.73%)
Mutual labels:  modules, packages
Ndash
your npm dashboard! (react-native app)
Stars: ✭ 158 (+327.03%)
Mutual labels:  modules, packages
Box
Write reusable, composable and modular R code
Stars: ✭ 388 (+948.65%)
Mutual labels:  modules, packages
Httpimport
Module for remote in-memory Python package/module loading through HTTP/S
Stars: ✭ 153 (+313.51%)
Mutual labels:  modules, packages
Termux Extra Packages
Stars: ✭ 110 (+197.3%)
Mutual labels:  cli, packages
goproxy
go modules proxy. 墙内学习go语言的第一步 自建goproxy代理. 部署到 heroku
Stars: ✭ 22 (-40.54%)
Mutual labels:  modules, packages
Syncpack
Manage multiple package.json files, such as in Lerna Monorepos and Yarn/Pnpm Workspaces
Stars: ✭ 356 (+862.16%)
Mutual labels:  cli, packages
Mastering Modular Javascript
📦 Module thinking, principles, design patterns and best practices.
Stars: ✭ 3,972 (+10635.14%)
Mutual labels:  modules, packages
Jay
😎 Supercharged JavaScript REPL
Stars: ✭ 970 (+2521.62%)
Mutual labels:  cli
Moviescore
A cli tool to get movie ratings and reviews directly to your terminal!
Stars: ✭ 35 (-5.41%)
Mutual labels:  cli
Jcnavigator
A decoupled navigator framework of jumping between modules or apps for iOS development.
Stars: ✭ 33 (-10.81%)
Mutual labels:  modules

gomodctl

gomodctl build gomodctl release gomodctl snyk

gomodctl - search, check and update go modules.

Currently supported commands:

  • search - search for Go packages by the given term
  • info - search by the given term and show information about the matched package
  • check - check project dependencies for the version information and shows outdated packages
  • update - automatically sync project dependencies with their latest version
  • license - fetch license of a module with/without version

Installation

Execute:

$ go get github.com/beatlabs/gomodctl

Or using Homebrew 🍺

brew tap beatlabs/gomodctl https://github.com/beatlabs/gomodctl
brew install gomodctl

Features

gomodctl search

Search in Go registry and return matched results.

Command:

gomodctl search patron

Result:

                   NAME                   | STARS |   IMPORT COUNT    |  SCORE
------------------------------------------+-------+-------------------+-----------
  github.com/beatlabs/patron/log          |    44 |                26 | 0.940500
  github.com/beatlabs/patron/trace        |    43 |                19 | 0.940500
  github.com/mantzas/patron/log           |    26 |                12 | 0.940500
  github.com/mantzas/patron/errors        |     9 |                12 | 0.940500
  github.com/beatlabs/patron              |    44 |                 9 | 1.000000
  github.com/beatlabs/patron/async        |    43 |                10 | 0.940500
  github.com/mantzas/patron/trace         |    26 |                 8 | 0.940500
  github.com/beatlabs/patron/examples     |    44 |                 8 | 0.940500
  github.com/beatlabs/patron/sync         |    46 |                 6 | 0.940500
  github.com/beatlabs/patron/sync/http    |    46 |                 6 | 0.931095
  github.com/mantzas/patron/encoding      |    20 |                 5 | 0.940500
  github.com/mantzas/patron               |    24 |                 4 | 1.000000
  github.com/mantzas/patron/encoding/json |     9 |                 5 | 0.931095
  github.com/mantzas/patron/examples      |    26 |                 4 | 0.940500
  github.com/mantzas/patron/async         |    24 |                 4 | 0.940500
  github.com/beatlabs/patron/trace/http   |    46 |                 4 | 0.931095
  github.com/mantzas/patron/sync          |    26 |                 3 | 0.940500
  github.com/mantzas/patron/sync/http     |    26 |                 3 | 0.931095
  github.com/mantzas/patron/info          |    13 |                 2 | 0.940500
  github.com/beatlabs/patron/async/kafka  |    44 |                 2 | 0.931095
------------------------------------------+-------+-------------------+-----------
                                                    NUMBER OF MODULES |    20
                                                  --------------------+-----------

Add --json parameter to the command to print result as a JSON.

Command:

gomodctl search github --json

Result:

...
{
  "Name": "gomock",
  "Path": "github.com/golang/mock/gomock",
  "ImportCount": 3900,
  "Stars": 3844,
  "Score": 0.99,
  "Synopsis": "Package gomock is a mock framework for Go."
},
{
  "Name": "uuid",
  "Path": "github.com/pborman/uuid",
  "ImportCount": 3579,
  "Stars": 318,
  "Score": 1,
  "Synopsis": "The uuid package generates and inspects UUIDs."
},
{
  "Name": "distribution",
  "Path": "github.com/docker/distribution",
  "ImportCount": 3549,
  "Stars": 5219,
  "Score": 1,
  "Synopsis": "Package distribution will define the interfaces for the components of docker distribution."
},
{
  "Name": "state",
  "Path": "github.com/juju/juju/state",
  "ImportCount": 3851,
  "Stars": 1614,
  "Score": 0.99,
  "Synopsis": ""
},
...

gomodctl info

Detailed information about the package with fetched documentation.

Command:

gomodctl info patron

Result:

                PATH               | STARS | IMPORT COUNT |  SCORE
-----------------------------------+-------+--------------+-----------
  github.com/beatlabs/patron/trace |    43 |           19 | 0.940500

Documentation:
PACKAGE

package trace
    import "github.com/beatlabs/patron/trace"
...

Use --imports and --importers flags to see list of imports in the package or importers using the package.

gomodctl check

Check module versions in the given Go project.

Command:

gomodctl check

Result:

              MODULE              |       CURRENT       |       LATEST
----------------------------------+---------------------+----------------------
  github.com/stretchr/testify     | v1.3.0              | v1.4.0
  go.mongodb.org/mongo-driver     | v1.1.1              | v1.2.1
  github.com/mitchellh/go-homedir | v1.1.0              | v1.1.0
  github.com/ory/dockertest       | v3.3.5+incompatible | v3.3.5+incompatible
  github.com/pkg/errors           | v0.8.1              | v0.9.1
  github.com/spf13/cobra          | v0.0.5              | v0.0.5
  github.com/spf13/viper          | v1.4.0              | v1.6.2
----------------------------------+---------------------+----------------------
                                     NUMBER OF MODULES  |          7
                                  ----------------------+----------------------

Add --json parameter to the command to print result as a JSON. Add --path parameter to the command to run command on another directory.

gomodctl check --json --path ~/projects/gomodctl

gomodctl scan

Scan for vulnerabilities using the tool gosec

Command:

gomodctl scan

Result

                MODULE                | CONFIDENCE | SEVERITY |                       CWE                       |                                                                    LINE,COLUMN
--------------------------------------+------------+----------+-------------------------------------------------+------------------------------------------------------------------------------------
  github.com/mitchellh/go-homedir     | HIGH       | MEDIUM   | https://cwe.mitre.org/data/definitions/78.html  | /go/pkg/mod/github.com/mitchellh/[email protected]/homedir.go
                                      |            |          |                                                 | ln:114 | col:10  exec.Command("getent", "passwd", strconv.Itoa(os.Getuid()))
--------------------------------------+------------+----------+-------------------------------------------------+------------------------------------------------------------------------------------
  github.com/olekukonko/tablewriter   | HIGH       | MEDIUM   | https://cwe.mitre.org/data/definitions/22.html  | /go/pkg/mod/github.com/olekukonko/[email protected]/csv.go
                                      |            |          |                                                 | ln:19 | col:15  os.Open(fileName)
--------------------------------------+------------+----------+-------------------------------------------------+------------------------------------------------------------------------------------
  github.com/olekukonko/tablewriter   | HIGH       | LOW      | https://cwe.mitre.org/data/definitions/703.html | /go/pkg/mod/github.com/olekukonko/[email protected]/table.go
                                      |            |          |                                                 | ln:782 | col:3  tmpWriter.WriteTo(t.out)
--------------------------------------+------------+----------+-------------------------------------------------+------------------------------------------------------------------------------------
  github.com/stretchr/testify         | HIGH       | MEDIUM   | https://cwe.mitre.org/data/definitions/22.html  | /Users/thomaschavakis/go/pkg/mod/github.com/stretchr/[email protected]/_codegen/main.go
                                      |            |          |                                                 | ln:184 | col:15  ioutil.ReadFile(path.Join(pd.SrcRoot, pd.ImportPath, fname))
--------------------------------------+------------+----------+-------------------------------------------------+------------------------------------------------------------------------------------

gomodctl update

Update module versions to latest minor

Command:

gomodctl update

Result:

Your dependencies updated to latest minor and go.mod.backup created
              MODULE              |      PREVIOUS       |         NOW
----------------------------------+---------------------+----------------------
  github.com/ory/dockertest       | v3.3.5+incompatible | v3.3.5+incompatible
  github.com/pkg/errors           | v0.8.1              | v0.9.1
  github.com/spf13/cobra          | v0.0.5              | v0.0.5
  github.com/spf13/viper          | v1.4.0              | v1.6.2
  github.com/stretchr/testify     | v1.3.0              | v1.4.0
  go.mongodb.org/mongo-driver     | v1.1.1              | v1.2.1
  github.com/mitchellh/go-homedir | v1.1.0              | v1.1.0
----------------------------------+---------------------+----------------------
                                     NUMBER OF MODULES  |          7
                                  ----------------------+----------------------

Add --json parameter to the command to print result as a JSON. Add --path parameter to the command to run command on another directory.

gomodctl update --json --path ~/projects/gomodctl

gomodctl license

Fetch licenses of the all dependencies of the current module. If module name provided, it will fetch license of specific module, version is optional.

Command:

gomodctl license

Result:

                MODULE                |              VERSION               |   LICENSE     
--------------------------------------+------------------------------------+---------------
  github.com/go-resty/resty/v2        | v2.1.0                             | MIT           
  github.com/olekukonko/tablewriter   | v0.0.4                             | MIT           
  github.com/securego/gosec           | v0.0.0-20200129084146-17df5b370244 | Apache-2.0    
  github.com/stretchr/testify         | v1.4.0                             | MIT           
  github.com/Masterminds/semver       | v1.5.0                             | MIT           
  github.com/google/licenseclassifier | v0.0.0-20200108231022-9dfa8d8474eb | Apache-2.0    
  github.com/mholt/archiver/v3        | v3.3.0                             | MIT           
  github.com/mitchellh/go-homedir     | v1.1.0                             | MIT           
  github.com/spf13/cobra              | v0.0.6                             | Apache-2.0    
  github.com/spf13/viper              | v1.5.0                             | MIT           
  golang.org/x/mod                    | v0.2.0                             | BSD-3-Clause  
--------------------------------------+------------------------------------+---------------
                                                NUMBER OF MODULES          |      11       
                                      -------------------------------------+---------------

Add --json parameter to the command to print result as a JSON.

Command:

gomodctl license github.com/beatlabs/patron
gomodctl license github.com/beatlabs/patron v0.30.0

Result:

Apache-2.0

How to ignore modules for version check and update

Create a gomodctl.yaml which has following structure which contains modules you want to ignore.

ignored_modules:
 - github.com/x/y
 - github.com/a/b

gomodctl checks directories for gomodctl.yaml in given order.

  1. path parameter
  2. current working directory
  3. home directory

How to configure for private modules

Since check and update rely on go toolchain, if you have any private module that isn't publicly accessible, don't forget to set up your environment variables. For more information and how to configure, please check Module configuration for non-public modules.

Code of conduct

Please note that this project is released with a Contributor Code of Conduct. By participating in this project and its community you agree to abide by those terms.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].