- Node.js ≥ 18
- npm account (for publishing)
npm install
npm run build # compiles TypeScript → dist/# Terminal 1 — recompile on every save
npm run dev
# Terminal 2 — run commands as you go
node dist/index.js recall "test"
node dist/index.js remember "a note"
node dist/index.js list
node dist/index.js statsnpm run build
npm link # creates a global `brain` → dist/index.js symlink
brain recall "test"
brain setup
brain remember "linked dev build"
npm unlink # remove when donerm ~/.config/second-brain/config.json
node dist/index.js recall "test" # wizard auto-triggers
# or
node dist/index.js setup # explicitnode dist/index.js remember "test memory" --tags dev,test
echo "piped content" | node dist/index.js remember
node dist/index.js recall "test memory" --limit 3
node dist/index.js list --limit 5
node dist/index.js stats
node dist/index.js append <id> "additional context"
node dist/index.js forget <id># Create account at https://www.npmjs.com/signup if needed
npm login
# → prompts for username, password, email, OTP (if 2FA enabled)npm run build
npm pack --dry-run # lists files that will be included
npm pack && tar -tzf *.tgz && rm *.tgz # inspect tarball then clean upThe tarball should contain only dist/ files, package.json, and README.md.
npm publish
# Available at: https://www.npmjs.com/package/second-brain-clinpm install -g second-brain-cli
brain --help
brain setup
npx second-brain-cli --help # test without global installnpm version patch # 0.1.0 → 0.1.1 (bug fixes)
npm version minor # 0.1.0 → 0.2.0 (new features)
npm version major # 0.1.0 → 1.0.0 (breaking changes)
# auto-creates a git commit + tag
npm publish