Quickstart
This guide walks you through installing Nilux AI, authenticating, and making your first request. You'll be productive in under 3 minutes.
Step 1: Install
Make sure you have Node.js >= 16 and npm >= 8, then install globally:
npm install -g @nilux/ai
Verify the installation:
nilux --version
See Installation for platform-specific details.
Step 2: Authenticate
Run nilux in your project directory. On first run, your browser will open automatically for sign-in:
$ nilux
Nilux AI
Opening browser for authentication...
Complete sign-in in your browser to continue.
Sign in with your account or create a new one in the browser. After authentication, the CLI will connect automatically.
Note: Nilux AI stores your session tokens in
~/.nilux/config.json. Use/logoutin the CLI to sign out.
Step 3: Make Your First Request
Navigate to any project directory and ask Nilux AI a question:
$ nilux
> Explain the authentication flow in this project
I'll trace the authentication flow through the codebase.
Reading src/auth/login.ts...
Reading src/lib/auth-context.tsx...
Reading src/proxy.ts...
Here's how authentication works:
1. User submits credentials via the login form
2. POST /api/auth/login returns access_token + refresh_token
3. Tokens are stored securely in the browser
4. Middleware checks the auth_token cookie on dashboard routes
5. On 401, the API client attempts token refresh automatically
The flow uses token-based auth with automatic refresh.
Common Use Cases
Explain Code
> Explain what this middleware function does
Fix a Bug
> Fix the null pointer error in handleSubmit
Add a Feature
> Add rate limiting to the login endpoint
Search the Codebase
> Find all places where we use dangerouslySetInnerHTML
Run Commands
> Run the tests for the auth module and fix any failures
Tips for Effective Use
- Be specific — Instead of "fix the bug", say "fix the race condition in the token refresh logic"
- Tell Nilux where to look — Mention file names or patterns: "Check the auth middleware in proxy.ts"
- Use subagents for big tasks — Nilux automatically delegates complex multi-step work to specialized agents
- Review diffs — Nilux shows you what it changed; always review before committing
- Use
/modelto switch models — TryNilux Profor complex reasoning tasks - Use
/balanceto check usage — Monitor your token consumption
Next Steps
- Models — Choose the right model for each task
- Tools — Learn about all built-in tools
- Configuration — Customize your setup
- Billing — Understand pricing and billing