Quick setup guide for the NL2SQL CLI tool.
- Node.js v18+ (works on Windows, macOS, and Linux - download here)
- OpenRouter API key (get one here)
-
Install dependencies:
npm install
-
Set API key (choose one):
- Linux/macOS: Environment variable:
export OPENROUTER_API_KEY='your-key' - Windows: Use Command Prompt or PowerShell:
Or create
setx OPENROUTER_API_KEY "your-key"
.envwithOPENROUTER_API_KEY=your-key(works cross-platform)
- Linux/macOS: Environment variable:
-
Build and link:
npm run build # On Windows, npm link handles executables automatically (no need for chmod) npm link -
Test:
nl2sql chat
- Run
npm run devfor development (cross-platform) - Use
npm run formatto format code with Prettier (cross-platform)
- "command not found: nl2sql": On Windows, use Git Bash for Unix-like commands, or run via
npm startif linked - "API key not found": Check with
echo %OPENROUTER_API_KEY%(Windows) orecho $OPENROUTER_API_KEY(Linux/macOS) - "No models directory": Run from a project with
models/folder (cross-platform)
For more help, see README.md.