Gleef CLI requires Node.js 18.0.0 or higher to run properly.

Installation

We recommend using npx to run Gleef CLI without global installation. This ensures you always use the latest version and avoids permission issues.
1

Recommended: Use npx

Run Gleef CLI directly with npx (no installation required):
npx @gleef/cli --version
For easier access, create an alias in your shell profile:
# Add to ~/.bashrc, ~/.zshrc, or your shell config
alias gleef="npx @gleef/cli"

# Then use normally
gleef --version
gleef init
gleef translate
2

Alternative: Global installation

If you prefer global installation for frequent use:
The Gleef CLI is updated frequently with new features and bug fixes. With global installation, you’ll need to manually update to get the latest version.
npm install -g @gleef/cli
Or using yarn:
yarn global add @gleef/cli
Then verify the installation:
gleef --version
3

Get your API key

Before using the CLI, you’ll need a Gleef API key:
  1. Visit https://app.gleef.eu/settings/api-keys
  2. Generate a new API key for CLI access
  3. Copy the key for the next step
4

Authenticate with Gleef

Log in to Gleef using your API key:
gleef login
You’ll be prompted to enter your API key. Alternatively, you can provide it directly:
gleef login --key YOUR_API_KEY

Verification

To verify everything is set up correctly, run:
gleef --help
You should see the list of available commands:
USAGE
  $ gleef COMMAND

COMMANDS
  help       Display help for gleef
  init       Initialize Gleef in your project
  login      Authenticate with Gleef
  pull       Get latest translations from Gleef
  translate  Generate and push translations to Gleef

Updating the CLI

If using npx (recommended): No action needed! You automatically get the latest version each time you run the command. If using global installation: Update to the latest version:
npm update -g @gleef/cli
Or with yarn:
yarn global upgrade @gleef/cli

Troubleshooting Installation

Permission Issues (macOS/Linux)

Recommended solution: Use npx @gleef/cli instead of global installation to avoid permission issues entirely. If you need global installation: You may need to use sudo:
sudo npm install -g @gleef/cli
Better alternative: Configure npm to use a different directory for global packages:
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.profile
source ~/.profile

Windows Installation

On Windows, you may need to run the command prompt as Administrator:
  1. Right-click on Command Prompt or PowerShell
  2. Select “Run as Administrator”
  3. Run the installation command

Node.js Version Issues

If you see errors about Node.js version compatibility:
  1. Check your Node.js version: node --version
  2. Update Node.js to version 18.0.0 or higher
  3. Consider using a Node.js version manager like nvm

Next Steps