Interactive CLI: Your AI Development Environment
January 6, 2026 ยท View on GitHub
Since: v7.0.0 | Status: Production Ready | Availability: CLI
Why Interactive Mode?
NeuroLink's Interactive CLI transforms traditional command-line usage into a persistent development environment optimized for AI workflow iteration. Unlike standard CLIs where each command is isolated, Interactive Mode maintains session state, conversation memory, and configuration across all operations - enabling rapid experimentation, debugging, and production runbook execution.
Traditional CLI vs Interactive Mode
| Feature | Traditional CLI | NeuroLink Interactive | Productivity Impact |
|---|---|---|---|
| Session State | None - lost after each command | Full persistence across session | 10x faster parameter tuning |
| Memory | No context between commands | Conversation-aware with history | 5x reduction in repeated context |
| Configuration | Flags required per command | /set persists across entire session | 80% fewer keystrokes |
| Tool Testing | Manual per-tool invocation | Live discovery & testing with /mcp | 3x faster integration testing |
| Streaming | Optional per command | Real-time default with progress bars | Immediate feedback |
| Error Recovery | Start over from scratch | Session preserved, fix and retry | 90% time saved on errors |
| Workflow Replay | Copy-paste commands | Export/import full sessions | Reproducible workflows |
Measured productivity gains:
- 80% faster onboarding for new users
- 60% fewer configuration errors
- 3-5x faster prompt engineering iteration
- Universal accessibility from beginner to expert
Getting Started
Starting a Session
Basic session with auto-detected Redis memory:
npx @juspay/neurolink loop
๐ NeuroLink Interactive Loop Mode
๐ฌ Conversation Memory: Redis auto-detected
๐ Session ID: sess_abc123def456
Ready! Use /help to see available commands.
neurolink >
With explicit configuration:
# Enable conversation memory with Redis
npx @juspay/neurolink loop --enable-conversation-memory
# Disable memory entirely (prompt-by-prompt mode)
npx @juspay/neurolink loop --enable-conversation-memory=false
# Custom retention limits
npx @juspay/neurolink loop --max-sessions 100 --max-turns-per-session 50
# Start with specific provider
npx @juspay/neurolink loop --provider anthropic --model claude-3-sonnet
# Disable Redis auto-detection (in-memory only)
npx @juspay/neurolink loop --no-auto-redis
Your First Interactive Session
Step-by-step walkthrough:
$ npx @juspay/neurolink loop --enable-conversation-memory
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ NeuroLink Interactive Loop Mode v8.26.1 โ
โ Universal AI Platform - 13 Providers | 58+ MCP Tools โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ฌ Conversation Memory: Enabled (Redis)
๐ Session ID: sess_2026_01_01_143052
๐ง Provider: auto (will select best provider)
๐ Temperature: 0.7 (balanced creativity)
๐ก Quick Start:
โข Type your prompt or question directly
โข Use /set to configure (e.g., /set provider anthropic)
โข Use /help to see all commands
โข Use /mcp discover to see available tools
Ready! What would you like to do?
neurolink > Set the provider to Google AI Studio
Setting session variable...
โ
provider set to google-ai
neurolink > What capabilities do you have?
๐ค Generating response...
I'm an AI assistant powered by Google Gemini 3 Flash through NeuroLink. I have access to:
1. **Text Generation**: Complex reasoning, creative writing, coding
2. **Vision**: Image analysis and description
3. **Tool Usage**: 58+ MCP tools including:
- Filesystem operations (read, write, list files)
- Web search and browsing
- GitHub integration
- Database queries (PostgreSQL, SQLite, MongoDB)
- And many more...
4. **Extended Thinking**: Deep reasoning for complex problems
5. **Structured Output**: JSON schema-based responses
Would you like me to demonstrate any of these capabilities?
neurolink > Yes, list the files in the current directory
๐ค Using tool: listDirectory
๐ Path: .
Files in current directory:
โโโ src/
โโโ docs/
โโโ package.json
โโโ tsconfig.json
โโโ README.md
โโโ LICENSE
neurolink > /mcp discover
๐ Discovering MCP tools...
๐ Available MCP Servers (5):
โโโโโโโโโโโโโโโโโฆโโโโโโโโโโโโโโฆโโโโโโโโโโโโโโโ
โ Server โ Status โ Tools โ
โ โโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโฃ
โ filesystem โ โ
Active โ 9 tools โ
โ github โ โ
Active โ 15 tools โ
โ postgres โ โ
Active โ 8 tools โ
โ brave-search โ โ
Active โ 3 tools โ
โ memory โ โ
Active โ 4 tools โ
โโโโโโโโโโโโโโโโโฉโโโโโโโโโโโโโโฉโโโโโโโโโโโโโโโ
Total: 39 tools available
๐ก Use /mcp test <server> to test a specific server
๐ก AI can use these tools automatically in conversations
neurolink > /export json session.json
๐พ Exporting conversation...
โ
Exported 4 messages to session.json
Session Summary:
โโโ Provider: google-ai
โโโ Model: gemini-3-flash-preview
โโโ Messages: 4 (2 user, 2 assistant)
โโโ Tools Used: listDirectory (1x)
โโโ Duration: 3 minutes
neurolink > exit
๐ Goodbye! Session saved.
๐ก Resume this session:
npx @juspay/neurolink loop --session session.json
Loop Mode Deep Dive
Session Variables
Configure once, use throughout your session:
Setting Variables
neurolink > /set provider anthropic
โ
provider set to anthropic
neurolink > /set model claude-3-opus
โ
model set to claude-3-opus
neurolink > /set temperature 0.3
โ
temperature set to 0.3
neurolink > /set thinking-level high
โ
thinking-level set to high
neurolink > /set max-tokens 4000
โ
max-tokens set to 4000
Getting Current Values
neurolink > /get provider
๐ provider: anthropic
neurolink > /get all
๐ Current Session Configuration:
โโโ provider: anthropic
โโโ model: claude-3-opus
โโโ temperature: 0.3
โโโ thinking-level: high
โโโ max-tokens: 4000
โโโ conversation-memory: enabled
Unsetting Variables
neurolink > /unset temperature
โ
temperature unset (reverting to default: 0.7)
neurolink > /clear
โ ๏ธ Clear all session variables? (y/n): y
โ
All session variables cleared
Conversation Memory
How Memory Works
Interactive mode maintains conversation context automatically:
neurolink > My name is Alice and I work on the backend team
๐ค Nice to meet you, Alice! As a backend developer, you might be interested in...
neurolink > What's my name?
๐ค Your name is Alice, and you mentioned you work on the backend team.
neurolink > /history
๐ Conversation History (4 messages):
1. USER: My name is Alice and I work on the backend team
2. ASSISTANT: Nice to meet you, Alice! As a backend developer...
3. USER: What's my name?
4. ASSISTANT: Your name is Alice, and you mentioned you work on the backend team.
neurolink > /clear
โ ๏ธ This will clear conversation history but preserve session variables.
Continue? (y/n): y
โ
Conversation history cleared
๐ก Session variables (provider, model, etc.) preserved
Memory Persistence (Redis)
With Redis enabled, conversations persist across sessions:
# Session 1
neurolink > I'm debugging the authentication service
๐ค I can help with that. What specific issue are you seeing?
neurolink > exit
๐พ Session saved to Redis
# Later - Session 2 (same session ID)
npx @juspay/neurolink loop --session sess_abc123
neurolink > What was I working on?
๐ค You were debugging the authentication service. Have you made progress?
Provider Switching
Switch providers mid-session to compare responses:
neurolink > /set provider openai
โ
provider set to openai
neurolink > Explain quantum computing
๐ค [OpenAI GPT-4 response]
neurolink > /set provider anthropic
โ
provider set to anthropic
neurolink > Explain quantum computing
๐ค [Anthropic Claude response]
neurolink > /set provider google-ai
โ
provider set to google-ai
neurolink > Explain quantum computing
๐ค [Google Gemini response]
Model Experimentation
A/B test different models in the same session:
# Test different models on same prompt
neurolink > /set provider anthropic
neurolink > /set model claude-3-haiku
neurolink > Write a haiku about coding
๐ค [Haiku response - fast, concise]
neurolink > /set model claude-3-sonnet
neurolink > Write a haiku about coding
๐ค [Sonnet response - balanced]
neurolink > /set model claude-3-opus
neurolink > Write a haiku about coding
๐ค [Opus response - creative, detailed]
# Compare thinking levels
neurolink > /set thinking-level minimal
neurolink > Solve this logic puzzle: ...
๐ค [Quick response]
neurolink > /set thinking-level high
neurolink > Solve this logic puzzle: ...
๐ค [Deep reasoning response with extended thinking]
Command Reference
Session Management
| Command | Description | Example |
|---|---|---|
/set <key> <value> | Set session variable (persists across commands) | /set provider anthropic |
/get <key> | Get current value of variable | /get temperature |
/get all | Show all session variables | /get all |
/unset <key> | Remove session variable (revert to default) | /unset temperature |
/show | Alias for /get all | /show |
/clear | Clear conversation history (keeps variables) | /clear |
/reset | Reset everything (history + variables) | /reset |
/history | View conversation history | /history |
/history <n> | View last N messages | /history 10 |
/export <format> <file> | Export session (json, markdown, text) | /export json session.json |
/import <file> | Import previous session | /import session.json |
exit / quit / :q | Exit loop mode | exit |
Available Session Variables
| Variable | Type | Example | Description |
|---|---|---|---|
provider | string | anthropic | AI provider to use |
model | string | claude-3-opus | Specific model |
temperature | number | 0.7 | Creativity level (0-1) |
max-tokens | number | 4000 | Maximum response length |
thinking-level | string | high | Extended thinking mode |
streaming | boolean | true | Enable streaming responses |
tools | boolean | true | Enable MCP tool usage |
MCP Tools Commands
| Command | Description | Example |
|---|---|---|
/mcp discover | List all available MCP servers and tools | /mcp discover |
/mcp list | Alias for discover | /mcp list |
/mcp test <server> | Test connectivity to MCP server | /mcp test github |
/mcp add <name> <command> | Add MCP server to session | /mcp add myserver "npx my-mcp-server" |
/mcp remove <name> | Remove MCP server | /mcp remove myserver |
/mcp status | Show status of all servers | /mcp status |
/mcp exec <tool> <args> | Manually execute a tool | /mcp exec github create_issue --params '{"title":"Bug"}' |
HITL Commands
| Command | Description | Example |
|---|---|---|
/hitl status | View pending approvals | /hitl status |
/hitl approve <id> | Approve pending action | /hitl approve 1 |
/hitl reject <id> | Reject with reason | /hitl reject 2 --reason "Security concern" |
/hitl history | View approval history | /hitl history --last 10 |
/hitl config | View HITL configuration | /hitl config |
Help Commands
| Command | Description | Example |
|---|---|---|
/help | Show all available commands | /help |
/help <command> | Help for specific command | /help set |
/? | Alias for help | /? |
Real-World Workflows
Workflow 1: Development Iteration
Complete session showing code generation, refinement, and testing:
neurolink > /set provider anthropic
neurolink > /set model claude-3-sonnet
neurolink > /set temperature 0.3 # Lower temp for code
# Initial generation
neurolink > Create a TypeScript function to validate email addresses
๐ค Here's an email validation function:
```typescript
function validateEmail(email: string): boolean {
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
return emailRegex.test(email);
}
neurolink > Add support for validating domains
๐ค [AI remembers previous context, extends the function]
function validateEmail(email: string, allowedDomains?: string[]): boolean {
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
if (!emailRegex.test(email)) {
return false;
}
if (allowedDomains) {
const domain = email.split("@")[1];
return allowedDomains.includes(domain);
}
return true;
}
neurolink > Add unit tests
๐ค [AI remembers the function, generates tests]
import { describe, it, expect } from "vitest";
describe("validateEmail", () => {
it("should validate correct emails", () => {
expect(validateEmail("user@example.com")).toBe(true);
});
it("should reject invalid emails", () => {
expect(validateEmail("invalid")).toBe(false);
});
it("should validate against allowed domains", () => {
expect(validateEmail("user@company.com", ["company.com"])).toBe(true);
});
});
neurolink > /export markdown code-session.md โ Exported to code-session.md
### Workflow 2: Model Experimentation
Comparing responses across providers and models:
```bash
# Test prompt engineering across models
PROMPT="Explain dependency injection in 50 words"
neurolink > /set provider openai
neurolink > /set model gpt-4-turbo
neurolink > $PROMPT
๐ค [GPT-4 Turbo response]
Word count: 48
neurolink > /set provider anthropic
neurolink > /set model claude-3-opus
neurolink > $PROMPT
๐ค [Claude Opus response]
Word count: 52
neurolink > /set provider google-ai
neurolink > /set model gemini-3-flash
neurolink > $PROMPT
๐ค [Gemini 3 Flash response]
Word count: 47
# Compare thinking levels
neurolink > /set thinking-level minimal
neurolink > Solve: What is 15% of 280?
๐ค 42 [instant]
neurolink > /set thinking-level high
neurolink > Solve: If a train leaves at 2pm going 60mph...
๐ค [extended thinking visible]
Thinking... analyzing problem structure
Thinking... calculating distances
Thinking... verifying solution
Answer: [detailed solution with reasoning]
neurolink > /export json model-comparison.json
Workflow 3: MCP Tool Testing
Discovering, testing, and using MCP tools:
neurolink > /mcp discover
๐ Available MCP Servers (8):
โโโโโโโโโโโโโโโโโฆโโโโโโโโโโโโโโฆโโโโโโโโโโโโโโโ
โ Server โ Status โ Tools โ
โ โโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโฃ
โ filesystem โ โ
Active โ 9 tools โ
โ github โ โ
Active โ 15 tools โ
โ postgres โ โ Inactive โ 0 tools โ
...
neurolink > /mcp test postgres
๐ Testing MCP server: postgres
โ Connection failed: ECONNREFUSED
๐ก Fix: Set POSTGRES_CONNECTION_STRING environment variable
export POSTGRES_CONNECTION_STRING="postgresql://user:pass@localhost:5432/db"
neurolink > Great, let me fix that [sets env var externally]
neurolink > /mcp test postgres
โ
Connection successful!
๐ 8 tools available: query, schema, tables, insert, update...
neurolink > Use the GitHub tool to list my repositories
๐ค Using tool: github_list_repos
Found 23 repositories:
1. neurolink-examples (public)
2. ai-playground (private)
3. docs-site (public)
...
neurolink > Create an issue in neurolink-examples titled "Add HITL example"
๐ค Using tool: github_create_issue
๐ HITL Approval Required
Action: github_create_issue
Args:
repo: neurolink-examples
title: Add HITL example
body: [AI-generated description]
Approve? (y/n): y
โ
Issue created: neurolink-examples#42
๐ https://github.com/user/neurolink-examples/issues/42
neurolink > /export json github-workflow.json
Workflow 4: Documentation Generation
Using AI to generate docs with iterative refinement:
neurolink > /set provider anthropic
neurolink > /set temperature 0.5
neurolink > Read the file src/lib/neurolink.ts
๐ค Using tool: readFile
[File contents displayed]
neurolink > Generate API documentation for the NeuroLink class
๐ค # NeuroLink API Documentation
## Class: NeuroLink
Main SDK class for interacting with AI providers...
[Generated docs]
neurolink > Add examples for each method
๐ค [AI remembers the documentation, adds examples]
## Examples
### generate()
```typescript
const result = await neurolink.generate({
input: { text: "Hello" }
});
...
neurolink > Save this to docs/api/neurolink.md
๐ค Using tool: writeFile โ Saved to docs/api/neurolink.md
neurolink > Now generate docs for the MessageBuilder class
๐ค Reading src/lib/utils/messageBuilder.ts...
[Continues documentation generation]
neurolink > /export json doc-generation-session.json
---
## Tips & Tricks
### Power User Features
#### Keyboard Shortcuts
- **โ / โ** - Navigate command history
- **Tab** - Auto-complete commands and variables
- **Ctrl+C** - Cancel current operation (doesn't exit)
- **Ctrl+D** - Exit loop mode
- **Ctrl+L** - Clear screen
- **Ctrl+R** - Search command history
#### Multi-line Input
Use backslash continuation for multi-line prompts:
```bash
neurolink > Write a function that: \
... 1. Validates user input \
... 2. Sanitizes the data \
... 3. Returns typed result
๐ค [AI processes full multi-line prompt]
Or use triple backticks for code blocks:
neurolink > Review this code:
function process(data) { return data.map(x => x * 2); }
๐ค [AI reviews the code block]
Command Aliases
Create shortcuts for common operations:
# In your shell profile (.bashrc, .zshrc)
alias nlg="npx @juspay/neurolink loop --provider google-ai"
alias nla="npx @juspay/neurolink loop --provider anthropic"
alias nlo="npx @juspay/neurolink loop --provider openai"
# Usage
$ nlg # Starts loop with Google AI
$ nla # Starts loop with Anthropic
Session Persistence
Saving Sessions
Explicit save to file:
neurolink > /export json my-session.json
โ
Exported 15 messages to my-session.json
# Session includes:
# - All conversation history
# - Session variables
# - Tool usage logs
# - Timestamps
Resuming Sessions
# Resume from file
npx @juspay/neurolink loop --session my-session.json
# Resume from Redis (if enabled)
npx @juspay/neurolink loop --session-id sess_abc123
Sharing Sessions
Share reproducible workflows with team:
# Developer 1
neurolink > [Creates workflow]
neurolink > /export json workflow.json
# Developer 2
npx @juspay/neurolink loop --session workflow.json
# Can replay exact same workflow
Integration with Scripts
Piping Input
# Pipe file contents to AI
cat README.md | npx @juspay/neurolink generate "Summarize this:"
# Process output from commands
git diff | npx @juspay/neurolink generate "Review these changes"
# Chain with other tools
curl https://api.example.com/data | \
npx @juspay/neurolink generate "Analyze this JSON"
Non-Interactive Mode
# Run single command and exit
npx @juspay/neurolink generate "Hello" --provider anthropic --exit
# Batch processing
for file in *.md; do
npx @juspay/neurolink generate "Summarize: $(cat $file)" \
--provider google-ai \
--output summary-$file
done
CI/CD Usage
# .github/workflows/ai-review.yml
- name: AI Code Review
run: |
npx @juspay/neurolink loop --non-interactive <<EOF
/set provider anthropic
/set model claude-3-sonnet
Review the code changes:
$(git diff)
EOF
Troubleshooting
Common Issues
Issue: Command Not Recognized
Symptom:
neurolink > /set provider anthropic
Unknown command: /set
Solution: Ensure you're in loop mode:
# Wrong - regular CLI
npx @juspay/neurolink set provider anthropic
# Right - loop mode
npx @juspay/neurolink loop
neurolink > /set provider anthropic
Issue: Conversation Memory Not Working
Symptom: AI doesn't remember previous context
Solution:
# Check if memory is enabled
neurolink > /get all
...
conversation-memory: disabled # <-- Problem!
# Enable memory
npx @juspay/neurolink loop --enable-conversation-memory
# Or set Redis URL
export REDIS_URL=redis://localhost:6379
npx @juspay/neurolink loop # Auto-detects Redis
Issue: Provider Connection Failed
Symptom:
Error: Failed to connect to provider 'anthropic'
Solution:
# Check API key is set
echo $ANTHROPIC_API_KEY
# Set API key
export ANTHROPIC_API_KEY=sk-ant-...
# Or in .env file
ANTHROPIC_API_KEY=sk-ant-...
Issue: Session Export Empty
Symptom: Exported session has no messages
Solution:
# Check if conversation memory is enabled
neurolink > /get all
# Memory disabled - enable it
npx @juspay/neurolink loop --enable-conversation-memory
# Now messages will be tracked for export
Issue: MCP Tools Not Showing
Symptom:
neurolink > /mcp discover
No MCP servers found
Solution:
# Install MCP servers first
npx @juspay/neurolink mcp install filesystem
npx @juspay/neurolink mcp install github
# Verify in .mcp-config.json or configure manually
Debug Mode
Enable verbose logging:
# Via environment variable
export NEUROLINK_DEBUG=true
npx @juspay/neurolink loop
# Via flag
npx @juspay/neurolink loop --debug
# Debug output shows:
# - Session initialization
# - Variable changes
# - Provider selections
# - Tool executions
# - Memory operations
Example debug output:
[DEBUG] Initializing loop session
[DEBUG] Session ID: sess_abc123
[DEBUG] Redis connection: redis://localhost:6379 (connected)
[DEBUG] Conversation memory: enabled
[DEBUG] Loading session variables...
[DEBUG] Variable set: provider=google-ai
[DEBUG] Provider initialized: GoogleAIStudioProvider
[DEBUG] Model: gemini-3-flash-preview
[DEBUG] MCP servers discovered: 5
[DEBUG] Tools available: 39
See Also
- CLI Reference - Complete CLI command documentation
- Loop Sessions Quick Guide - Quick reference for loop mode
- MCP Integration - Deep dive into MCP tools
- Enterprise HITL - Using HITL in interactive sessions
- Conversation Memory - Redis persistence configuration
- Provider Setup - Configure AI providers