Skip to main content
The Refine CLI is available as an npm package and can be installed globally or used directly with npx.

Prerequisites

Before installing the Refine CLI, ensure you have:
  • Node.js version 20 or higher
  • A package manager: npm, yarn, or pnpm

Check Node Version

node --version
If you need to update Node.js, download the latest version from nodejs.org.

Global Installation

Install the CLI globally to use it across all your projects:
npm install -g @refinedev/cli
Verify the installation:
refine --version
Output
@refinedev/[email protected]

Using with npx

Run CLI commands without global installation:
npx @refinedev/cli [command]
This is useful for:
  • Trying out the CLI without installing
  • Running one-off commands
  • Ensuring you’re using the latest version

Project Installation

The CLI is automatically included as a dev dependency when you create a new Refine project:
package.json
{
  "devDependencies": {
    "@refinedev/cli": "^2.16.51"
  }
}
Use it via npm scripts:
package.json
{
  "scripts": {
    "dev": "refine dev",
    "build": "refine build",
    "start": "refine start"
  }
}

Updating the CLI

Update to the latest version:
npm update -g @refinedev/cli

Uninstalling

Remove the global installation:
npm uninstall -g @refinedev/cli

Troubleshooting

Command Not Found

If refine command is not found after global installation:
  1. Check if the global bin directory is in your PATH:
    npm config get prefix
    
  2. Add it to your PATH in ~/.bashrc or ~/.zshrc:
    export PATH="$(npm config get prefix)/bin:$PATH"
    

Permission Errors

If you encounter permission errors on Linux/macOS:
sudo npm install -g @refinedev/cli
Or configure npm to use a different directory:
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
export PATH=~/.npm-global/bin:$PATH

Next Steps

Now that you have the CLI installed:

Build docs developers (and LLMs) love