macOS Setup
Config paths
| Layer | Path |
|---|---|
| Project config | .lenserfight/lenserfight.json (inside your project root) |
| Device config | ~/Library/Application Support/lenserfight/config.json |
| Legacy device | ~/.lenserfight/lenserfight.json (read fallback, written if file already exists) |
~/Library/Application Support/lenserfight/ follows macOS conventions for per-user application data. This directory is not backed up by Time Machine by default unless you opt in.
Install Node.js
Use Homebrew:
# Install Homebrew if not already installed
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install node@20Or use nvm:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
source ~/.zshrc
nvm install 20
nvm use 20Install pnpm
npm install -g pnpmOr via Homebrew:
brew install pnpmInstall the CLI
From your project root:
pnpm installVerify:
pnpm lenserfight --version
pnpm lf --versionInitialize a project
pnpm lenserfight initCreates .lenserfight/lenserfight.json with local-mode defaults.
Environment variables (zsh)
macOS defaults to zsh. Add exports to ~/.zshrc:
export ANTHROPIC_API_KEY="sk-ant-..."
export OPENAI_API_KEY="sk-..."Reload:
source ~/.zshrcAlternatively, place them in .env.local at your project root — the CLI reads this automatically.
Device config location
After lf auth login or lf connect:
~/Library/Application Support/lenserfight/config.jsonTo inspect it:
cat ~/Library/Application\ Support/lenserfight/config.jsonThis file contains secrets — do not commit it.
Keychain integration (future)
Token storage via macOS Keychain is planned. Until then, tokens are stored in the Application Support JSON file.
Gatekeeper / notarization
If you downloaded a pre-built lenserfight binary rather than running via pnpm, macOS Gatekeeper may block it on first launch. To allow it:
xattr -d com.apple.quarantine /usr/local/bin/lenserfightThis is not needed when running via pnpm lenserfight from a cloned repo.
Validate automation objects
pnpm lenserfight validate ./automationRun a local battle
pnpm lenserfight battle run ./PRIVATE_BATTLE.md --execute