The Fabric command line tools (CLI) can be used by mod developers to generate new mods and find recommended Fabric versions directly from your terminal. If you happen to find an issue please make sure to report it on our GitHub page.

Installation

The Fabric CLI tools can be installed using npm or Deno.

npm

With Node.js 22 or newer and npm installed, run the following command to globally install the Fabric CLI tools:

npm install -g @fabricmc/cli

To update via npm, run:

npm install -g @fabricmc/cli@latest

To remove via npm, run:

npm uninstall -g @fabricmc/cli

Deno

After following the Deno installation instructions, run the following command to globally install the Fabric CLI tools:

deno install -A -g -n fabric https://fabricmc.net/cli

To update via Deno, run:

fabric upgrade

To remove via Deno, run:

deno uninstall fabric

Usage

Generate a mod

The init sub-command can be used to generate a customised template mod. To generate a new mod in the current directory, the following command can be used:

fabric init

You can optionally pass a directory path, if the directory does not exist it will be created.

fabric init MyCoolMod

If you wish to accept all of the default values you can pass the -y argument. The directory name is then used to influence the mod name.

fabric init MyCoolMod -y

The versions sub-command shows the recommended Fabric Loader, Loom and Fabric API versions for a Minecraft version, along with Yarn mappings when applicable. By default it uses the latest stable Minecraft version:

fabric versions

You can optionally pass a Minecraft version to look up a specific version:

fabric versions 1.21.1

Pass --json to get JSON output for use in scripts:

fabric versions 1.21.1 --json

Run without installing

With Node.js and npm, you can run the CLI without installing it globally:

npx @fabricmc/cli init

Alternatively, use Deno to run it directly:

deno run https://fabricmc.net/cli init

Deno is secure by default, so will ask for permission before making any changes to your system.