flashy-cli
Version:
Fast AI-powered code completion using OpenAI API - No API key setup required!
141 lines (102 loc) • 3.46 kB
Markdown
and chat using Cerebras API - No API key setup required!
```bash
npm install flash-tool-oss
```
```bash
npx flash-tool-oss interactive
npx flash-tool-oss complete "def fibonacci"
npx flash-tool-oss chat "How do I create a React component?"
npx flash-tool-oss complete "function sortArray" --language javascript
```
```javascript
const Flash = require('flash-tool-oss');
const flash = new Flash();
// Complete code
const completion = await flash.complete('def fibonacci', 'python');
console.log(completion);
// Chat with AI
const response = await flash.chat('How do I create a React component?');
console.log(response);
// Process "using oss" commands (for Cursor integration)
const result = await flash.processUsingOss('using oss explain async/await');
console.log(result);
```
- ⚡ **Fast AI completions** using Cerebras gpt-oss-120b model
- 💬 **Interactive chat** with AI programming assistant
- 🔧 **Multi-language support** (Python, JavaScript, TypeScript, etc.)
- 🚀 **Zero configuration** - works immediately after installation
- 📦 **Easy installation** via npm
- 🎯 **Cursor integration** with "using oss" commands via MCP
- 🤖 **Automatic code application** - Cursor applies suggestions directly
The tool uses these default settings:
- Model: `gpt-oss-120b`
- Max tokens: 1024 (completion), 2048 (chat)
- Temperature: 0.3 (completion), 0.7 (chat)
- Top-p: 0.9
- Reasoning effort: medium
To integrate with Cursor chat using MCP (Model Context Protocol):
1. **Install the package:**
```bash
npm install flash-tool-oss
```
2. **Create MCP configuration** (see `CURSOR_SETUP.md` for detailed instructions):
```json
{
"mcpServers": {
"flash-tool-oss": {
"command": "node",
"args": ["node_modules/flash-tool-oss/src/mcp-server.js"],
"env": {}
}
}
}
```
3. **Use in Cursor chat:**
```
using oss create a React component that displays a todo list
```
You can also use the `processUsingOss` method programmatically:
```javascript
const Flash = require('flash-tool-oss');
const flash = new Flash();
// This will detect "using oss" commands and respond appropriately
const response = await flash.processUsingOss('using oss how do I debug this React error?');
```
- Ensure Python is installed and accessible via `python` command
- Install Python dependencies: `pip install cerebras-cloud-sdk`
- Check your internet connection
- The tool uses a pre-configured API key - no setup required
```bash
npx flash-tool-oss complete "def quick_sort"
npx flash-tool-oss complete "function debounce" --language javascript
npx flash-tool-oss complete "const MyComponent = () => {" --language javascript
```
```bash
npx flash-tool-oss chat "What's the difference between let, const, and var in JavaScript?"
npx flash-tool-oss chat "Review this code: function add(a, b) { return a + b; }"
npx flash-tool-oss chat "I'm getting a TypeError in my React app, how do I debug it?"
```
Fast AI-powered code completion