Skip to content

Latest commit

 

History

History
48 lines (35 loc) · 1.32 KB

File metadata and controls

48 lines (35 loc) · 1.32 KB

NL2SQL CLI Setup

Quick setup guide for the NL2SQL CLI tool.

Prerequisites

Quick Setup

  1. Install dependencies:

    npm install
  2. Set API key (choose one):

    • Linux/macOS: Environment variable: export OPENROUTER_API_KEY='your-key'
    • Windows: Use Command Prompt or PowerShell:
      setx OPENROUTER_API_KEY "your-key"
      Or create .env with OPENROUTER_API_KEY=your-key (works cross-platform)
  3. Build and link:

    npm run build
    # On Windows, npm link handles executables automatically (no need for chmod)
    npm link
  4. Test:

    nl2sql chat

Development

  • Run npm run dev for development (cross-platform)
  • Use npm run format to format code with Prettier (cross-platform)

Common Issues

  • "command not found: nl2sql": On Windows, use Git Bash for Unix-like commands, or run via npm start if linked
  • "API key not found": Check with echo %OPENROUTER_API_KEY% (Windows) or echo $OPENROUTER_API_KEY (Linux/macOS)
  • "No models directory": Run from a project with models/ folder (cross-platform)

For more help, see README.md.