The monemee CLI
One command sets up selling your app: npx monemee init. No API key to copy, no dependencies, Node.js 18.17 or newer.
Commands
| Command | What it does |
|---|---|
npx monemee init |
Detects your project, logs you in, creates or picks a product, writes a test secret to .env, adds .env to .gitignore and wires Monemee into your code |
npx monemee test-buy |
Runs a free test purchase: it skips the payment step, everything from the return to your app on is real |
npx monemee live |
Sets the return URL, creates a live secret and a webhook (sale.completed, license.*) for production |
npx monemee doctor |
Checks .env, secret, product and return URL |
npx monemee login / logout / whoami |
Manages the browser login |
What init changes in your project
- Express: creates the Monemee instance after
express(), addsapp.use(monemee.webhook())before your body parser andapp.use(monemee.routes())before your first route. At the top of the file it addstry { process.loadEnvFile(); } catch {}, which loads.envwithout a dependency on Node.js 20.12 or newer (skipped if the file already usesdotenvorloadEnvFile; on older Node.js load.envyourself). If the server file is ambiguous, it prints the snippet instead of editing. - Next.js: adds
lib/monemee.jsandapp/monemee/[...monemee]/route.js. - React: adds
src/components/MonemeeUpgrade.jsxwith a paywall, a test purchase button and a license key form.
Options
| Option | |
|---|---|
--yes |
Accept defaults (CI, AI assistants) |
--product <id> |
Use an existing product |
--title, --price |
Create a new product without prompts |
--url <https://...> |
Production address for live |
--ref <id> |
User ID for test-buy |
--port <n> |
Port of your local app for test-buy (default: from your server file, otherwise 3000) |
--return-path <path> |
Return path for live, for example /monemee/return (cookie login, default) or / (token login) |
--skip-install |
Print the install command instead of running it |
The login is stored in ~/.config/monemee/credentials.json, readable only by your user. Revoke it any time in Monemee under Settings > Connected apps.
Last updated: