Fabric command line tools
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
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
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
Find recommended versions
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
Fabric