Skip to content

eirikb/gg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

98 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gg.cmd

gg.cmd Release

[Changelog] [Download]

Image

Image

gg.cmd is a cross-platform and cross-architecture command-line interface (CLI) that acts as an executable wrapper for various tools such as Gradle, JDK/JVM, Node.js, and Java. It requires minimal dependencies and is similar in functionality to gradlew.

Install with bash (wget):

wget ggcmd.io/gg.cmd

Install with bash (curl):

curl -L ggcmd.io > gg.cmd

Install with PowerShell:

wget ggcmd.io -OutFile gg.cmd

or

Download the latest release

Install?
The concept involves placing a copy of gg.cmd in the root directory of your project.
This is similar to what you would do with gradlew or mvnw, except this method is applicable to multiple tools.
As a result, your colleagues would not have to install anything on their host machines.

Features

  • Simplify the management of other executables in your project
  • Automatically detect and execute the required executable version using project configuration files (such as package.json for Node.js projects)
  • Support for chaining multiple executables (e.g. gradle@6:java@17)
  • Cross-platform compatibility (Windows, macOS, and Linux)
  • Cross-architecture compatibility (x86_64 and ARM)
  • Fast and lightweight

Installs tool locally in a folder called .cache. Global install not supported. Adds every dependency into PATH before executing.

Usage

Using gg.cmd is easy. Simply place the executable in the root of your project and run it with the gg.cmd command followed by the desired executable and its required dependencies:

./gg.cmd [gg options] <executable name>@<version><+include_tags><-exclude_tags>:<dependent executable name>@<version><+include_tags><-exclude_tags> [executable arguments]

Example

sh gg.cmd npm install

Support table

Logo Commands Depends on Set environment variables Available tags Default tags
node
npm
npx
lts
deno
gradle java
maven
mvn
java
bld java
jbang java
java JAVA_HOME jdk
jre
lts
sts
mts
ea
ga
headless
headfull
fx
+jdk
+ga
go beta
openapi java beta

Node

Version from:

  • engines in package.json
  • Contents of .nvmrc

Gradle

Version from:

  • distributionUrl in gradle/wrapper/gradle-wrapper.properties
  • distributionUrl in gradle.properties

Download URL from:

  • distributionUrl in gradle/wrapper/gradle-wrapper.properties
  • distributionUrl in gradle.properties

JBang

The Java version is read from the JBang script using the //JAVA magic comment.

Java

Version from:

  • jdkVersion in gradle/wrapper/gradle-wrapper.properties
  • jdkVersion in gradle.properties

Examples

Here are a few examples of how gg.cmd can make your life easier:

Execute gradle

./gg.cmd gradle build

Replace gradlew and gradle JARs by gg.cmd

You can replace gradlew with a single gg.cmd and gradle.properties and can delete these files:

  • gradle/wrapper/gradle-wrapper.jar
  • gradle/wrapper/gradle-wrapper.properties
  • gradlew
  • gradlew.bat

Execute bld

In this example, bld is used to run an app using bld for the build process:

./gg.cmd bld run

Execute JBang

./gg.cmd jbang script.java

Execute specific version of Node.js

./gg.cmd node@14

Execute specific version of Gradle and the required version of JVM/JDK

./gg.cmd gradle@6:java@17 clean build

Create a new node project

./gg.cmd npm init -y

Create a new React project

./gg.cmd npx create-react-app my-app
cp gg.cmd my-app
cd my-app
./gg.cmd npm start

Execute code hosted on GitHub

gg.cmd offers a GitHub executor. It smartly checks if the content and the available release files.

For instance, one can run GitHub's CLI tool:

> sh ./gg.cmd gh/cli/cli --verison
gh version 2.73.0 (2025-05-19)
https://github.com/cli/cli/releases/tag/v2.73.0

Contributing

We welcome contributions to gg.cmd. If you have an idea for a new feature or have found a bug, please open an issue on the GitHub repository.

License

gg.cmd is licensed under the MIT License. See LICENSE for more information.