@blazfoxx/blazecli
v1.0.6
Published
Full-featured AI coding CLI tool with BlazeAPI integration
Maintainers
Readme
BlazeCLI
A full-featured AI coding CLI tool that integrates with BlazeAPI — an AI gateway supporting multiple models, streaming, embeddings, image generation, and more.
Features
- 🤖 Multi-model support — Access any model via BlazeAPI (Claude, GPT-4, Gemini, and more)
- 💬 Interactive REPL — Full-featured interactive session with history and context management
- 🛠️ Rich tool system — File read/write, bash execution, web search, and 40+ built-in tools
- ⚡ Streaming responses — Real-time streaming with Server-Sent Events
- 🔐 Device code auth — OAuth2 device code flow for secure authentication
- 📦 MCP support — Model Context Protocol client for extending capabilities
- 🧠 Session memory — Persistent conversation history with context compaction
- 🎨 Beautiful TUI — React/Ink-based terminal UI with themes
- 🔌 Plugin system — Extend BlazeCLI with plugins
Installation
npm install -g @blazfoxx/blazecliFor detailed installation instructions, see INSTALL.md.
Quick Install
# Using npm
npm install -g @blazfoxx/blazecli
# Using yarn
yarn global add @blazfoxx/blazecli
# Using pnpm
pnpm add -g @blazfoxx/blazecliQuick Start
# Login with BlazeAPI
blaze login
# Start interactive session
blaze
# Run a single prompt
blaze "Explain this codebase"
# Start with a specific model
blaze --model claude-3-5-sonnet-20241022
# Run in non-interactive mode
blaze --print "List all TypeScript files"Commands
Interactive Commands
| Command | Description |
|---------|-------------|
| /help | Show help information |
| /session | Manage sessions |
| /model | Switch AI model |
| /config | View/edit configuration |
| /mcp | Manage MCP servers |
| /clear | Clear conversation |
| /exit | Exit BlazeCLI |
CLI Flags
| Flag | Description |
|------|-------------|
| --version | Show version number |
| --model <name> | Specify model to use |
| --print | Non-interactive mode, print output |
| --stream | Enable/disable streaming |
| --help | Show help |
Usage Examples
Basic Chat
# Interactive mode
blaze
> What is the difference between let and const in JavaScript?
> Can you show me an example?
> /exit
# Single prompt
blaze "Explain async/await in JavaScript"Code Generation
blaze "Create a Node.js Express server with:
- Health check endpoint
- User CRUD endpoints
- JWT authentication
- Error handling middleware"File Operations
# In interactive mode
> Read the package.json file and explain its dependencies
> Create a new file called utils.js with helper functions
> Update the README with installation instructionsCode Review
blaze "Review the code in src/api/client.ts and suggest improvements for:
- Error handling
- Performance
- Security"Debugging
blaze "I'm getting a 'Cannot read property of undefined' error.
Here's my code:
const user = data.users[0].profile.name;
What could be wrong?"Git Operations
# In interactive mode
> Run `git status` and explain what files changed
> Run `git diff` and summarize the changes
> Create a commit message for these changesConfiguration
BlazeCLI uses two configuration locations:
- Global:
~/.blaze/config.json— User-level settings - Project:
.blaze/config.json— Project-level overrides
Configuration Options
{
"model": "claude-3-5-sonnet-20241022",
"apiUrl": "https://api.blazeapi.app",
"outputStyle": "markdown",
"theme": "dark",
"streaming": true,
"timeout": 120000
}Environment Variables
| Variable | Description | Default |
|----------|-------------|---------|
| BLAZE_API_KEY | API key for BlazeAPI | - |
| BLAZE_API_URL | Custom API base URL | https://api.blazeapi.app |
| BLAZE_MODEL | Default model to use | claude-3-5-sonnet-20241022 |
| BLAZE_TIMEOUT | Request timeout in milliseconds | 120000 |
Setting Configuration
# View current configuration
blaze /config
# Set a configuration value
blaze /config set model gpt-4o
blaze /config set theme light
blaze /config set outputStyle json
# Reset to defaults
blaze /config resetSession Management
Listing Sessions
blaze /session listResuming a Session
blaze /session resume <session-id>Exporting Sessions
blaze /session export session.jsonClearing Current Session
blaze /clearMCP (Model Context Protocol)
BlazeCLI supports MCP servers for extended capabilities.
Adding an MCP Server
blaze /mcp add filesystem --command "npx -y @modelcontextprotocol/server-filesystem /path/to/dir"Listing MCP Servers
blaze /mcp listConnecting to an MCP Server
blaze /mcp connect filesystemDevelopment
Prerequisites
- Node.js 18+
- npm 8+
Setup
# Clone the repository
git clone https://github.com/blazfoxx/blazecli.git
cd blazecli
# Install dependencies
npm install
# Run in development mode
npm run dev
# Build for production
npm run build
# Run tests
npm test
# Type checking
npm run typecheck
# Linting
npm run lintProject Structure
blazecli/
├── bin/ # CLI entry points
├── src/
│ ├── api/ # API client and communication
│ ├── auth/ # Authentication handling
│ ├── commands/ # CLI commands
│ ├── config/ # Configuration management
│ ├── mcp/ # MCP client implementation
│ ├── session/ # Session management
│ ├── tools/ # Built-in tools
│ ├── ui/ # Terminal UI components
│ └── utils/ # Utility functions
├── dist/ # Compiled JavaScript
└── tests/ # Test filesFor detailed architecture, see ARCHITECTURE.md.
Testing
For comprehensive testing procedures, see TESTING.md.
Quick Tests
# Run unit tests
npm run test:unit
# Run integration tests
npm run test:integration
# Run with coverage
npm run test:coverageTroubleshooting
Common Issues
"command not found: blaze"
Ensure npm global bin directory is in your PATH:
export PATH="$(npm config get prefix)/bin:$PATH"Authentication Issues
Re-authenticate:
rm -rf ~/.blaze/.auth
blaze loginConnection Issues
Check API URL and connectivity:
blaze /config get apiUrl
curl -I https://api.blazeapi.app/healthFor more troubleshooting, see INSTALL.md.
Contributing
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Development Guidelines
- Follow the existing code style
- Write tests for new features
- Update documentation for API changes
- Run
npm run lintbefore committing - Ensure all tests pass (
npm test)
License
MIT — See LICENSE for details.
Links
Support
Made with ❤️ by the BlazeAPI Team
