cli/node/development.md
npm install -g pnpm)From the node/ directory:
pnpm install
There are two ways to run the CLI during development:
Uses tsx to run TypeScript directly. Pass CLI arguments after pnpm dev:
pnpm dev --help
pnpm dev version
pnpm dev add "test memory" --user-id alice
pnpm dev search "test" --user-id alice
pnpm dev config show
Note: Do NOT use
pnpm dev -- --help. With pnpm, arguments pass through directly — adding--inserts a literal--that breaks the CLI parser.
# Build first
pnpm build
# Run the compiled CLI
node dist/index.js --help
node dist/index.js version
node dist/index.js add "test memory" --user-id alice
mem0 available system-wide)pnpm build
pnpm link --global
# Now use it like a normal CLI
mem0 --help
mem0 version
Warning: If you also have the Python CLI installed, both register the
mem0command. The last one linked/installed wins. Unlink withpnpm unlink --global.
pnpm build
The compiled output is in dist/.
# Run all tests
pnpm test
# Watch mode
pnpm test:watch
# Check
pnpm lint
# Auto-fix
pnpm lint:fix
pnpm typecheck