Moon CLI
Moon CLI is a global multi-platform command-line router. It manages platforms, each with its own runner. Moontraze is one registered platform on Moon CLI.
You can use Moontraze in two ways:
- Moon CLI —
moon moontraze deploy - npx (npm) —
npx moontraze deploy(no install needed)
Both work the same. Choose whichever you prefer.
Two Ways to Use Moontraze CLI
Option A: Moon CLI
Moon CLI is a global router that manages multiple platforms.
Install once, use forever.
npm install -g moon-cliOr via curl:
Windows (PowerShell):
irm https://api.moontraze.com/cli/install.ps1 | iexWindows (CMD):
curl -o "%TEMP%\moon-install.ps1" https://api.moontraze.com/cli/install.ps1
powershell -ExecutionPolicy Bypass -File "%TEMP%\moon-install.ps1"Linux / macOS:
curl -fsSL https://api.moontraze.com/cli/install.sh | bashTermux (Android):
pkg install nodejs
curl -fsSL https://api.moontraze.com/cli/install.sh | bashOption B: npx (No Install)
If you don't want to install Moon CLI, use npx:
npx moontraze login
npx moontraze deploy --prod
npx moontraze updateSame commands, no global install.
Option C: npm install
Install Moontraze CLI locally:
npm install -g moontrazeThen use:
moontraze login
moontraze deploy --prodInstall Moon CLI
Windows (PowerShell)
irm https://api.moontraze.com/cli/install.ps1 | iexWindows (CMD)
curl -o "%TEMP%\moon-install.ps1" https://api.moontraze.com/cli/install.ps1
powershell -ExecutionPolicy Bypass -File "%TEMP%\moon-install.ps1"Linux / macOS
curl -fsSL https://api.moontraze.com/cli/install.sh | bashTermux (Android)
pkg install nodejs
curl -fsSL https://api.moontraze.com/cli/install.sh | bashAfter Install
Refresh PATH if moon is not found:
Windows CMD:
set PATH=%LOCALAPPDATA%\Moon\bin;%PATH%Windows PowerShell:
$env:Path = "$env:LOCALAPPDATA\Moon\bin;$env:Path"Linux / macOS / Termux:
export PATH="$HOME/.local/share/Moon/bin:$PATH"Verify:
moon -vInstall location:
- Windows →
%LOCALAPPDATA%\Moon - Linux / macOS / Termux →
~/.local/share/Moon
Global Moon Commands
# Version / help
moon -v
moon help
# Update / uninstall router
moon update
moon uninstall --yes
# Platform management
moon platform list
moon platform remove myweb
moon platform use mywebInstall Moontraze Platform
# One-time install
moon moontraze installMoontraze Commands
# Login
moon moontraze login
moon moontraze login --token <jwt>
# Link project
moon moontraze link my-site
# List sites
moon moontraze list
# Deploy
moon moontraze deploy
moon moontraze deploy --prod
# Update CLI
moon moontraze update
# Uninstall
moon moontraze uninstall --yesWithout Moon CLI (npx)
If you don't want to install Moon CLI:
npx moontraze login
npx moontraze deploy --prod
npx moontraze updateSame functionality, no global install.
Typical Workflow
With Moon CLI
moon -v
moon update
moon moontraze install
moon moontraze login
moon moontraze link my-site
moon moontraze deploy --prod
moon moontraze update
moon update
moon moontraze uninstall --yes
moon uninstall --yesWith npx
npx moontraze login
npx moontraze link my-site
npx moontraze deploy --prodHow Platforms Work
Moon CLI is a router. It does not implement login or deploy itself. Each platform provides its own runner.
- Moontraze is a registered platform
- Anyone can publish a free platform with a manifest URL
- Or register for a one-line professional install
Free / open platform:
- Host a manifest + tarball
- Users run
moon yourname install --from <url>
Registered platform:
- Listed in Moon CLI
- Users run
moon yourname install(no URL)
Publish a Free Platform
Step A — Build your CLI runner
// bin/myweb.js
#!/usr/bin/env node
const platform = process.env.MOON_PLATFORM || 'myweb';
const api = process.env.MOON_API || 'https://api.myweb.com';
const cmd = (process.argv[2] || '').toLowerCase();
if (cmd === 'login') { /* your login */ }
else if (cmd === 'deploy') { /* your deploy */ }
else if (cmd === 'list') { /* your list */ }
else console.log('Commands: login | deploy | list');Step B — Host manifest + tarball
// GET https://api.myweb.com/cli/manifest.json
{
"version": "1.0.0",
"tarball": "https://api.myweb.com/cli/myweb-1.0.0.tgz"
}Tarball layout (npm pack style):
package/bin/myweb.js
package/lib/...
package/package.jsonStep C — Tell users
moon myweb install --from https://api.myweb.com/cli/manifest.json
moon myweb login
moon myweb deploy
moon platform listLocal Add (This Machine Only)
For development. Other users cannot install this entry.
# Relative path
moon platform add myweb --runner ./myweb-cli.js --api https://api.myweb.com --label "My Web"
# Windows absolute
moon platform add myweb --runner C:\Users\Demo\apps\myweb\bin\cli.js --api https://api.myweb.com
# Linux / macOS / Termux
moon platform add myweb --runner /home/demo/.local/share/MyWeb/cli/bin/cli.js --api https://api.myweb.com
# npm package on this machine
moon platform add myweb --runner npm:myweb-cli --api https://api.myweb.com
moon platform list
moon platform use myweb
moon platform remove mywebNotes
- moon only routes to a runner; it does not implement login or deploy
moon platform add= local only- Worldwide users need
install --fromor a registered platform - Free platforms: you host manifest + tarball; document
--fromcommand - Registered platforms: users run
moon <name> installonly moon updateupdates the routermoon moontraze updateupdates the Moontraze CLI- Each user must run install once per machine
- Project link lives in
.moontraze/project.json(folder-local)