Initial Release: OpenQode Public Alpha v1.3

This commit is contained in:
Gemini AI
2025-12-14 00:40:14 +04:00
Unverified
commit 8e8d80c110
119 changed files with 31174 additions and 0 deletions

91
docs/PROJECT_BRIEF.md Normal file
View File

@@ -0,0 +1,91 @@
# OpenQode v1.01 Preview Edition - Project Brief
## 🎯 Overview
OpenQode is a revolutionary fork that combines the power of **OpenCode's TUI interface** with **Qwen's generous free tier** and **advanced AI capabilities**. This hybrid solution delivers the best of both worlds in a single, user-friendly package.
## 🚀 Key Benefits
### vs Regular OpenCode
-**2,000 free daily requests** vs paid OpenAI models
-**No token limits** vs OpenAI token restrictions
-**60 RPM rate limit** for sustained productivity
-**Automatic credential refresh** - no manual token management
-**One-click authentication** vs complex API key setup
### vs Regular Qwen Code CLI
-**Rich TUI interface** vs command-line only
-**Visual chat experience** vs text-based interaction
-**Enhanced features** (Lakeview, Sequential Thinking)
-**Windows-optimized** with batch launcher
-**Self-contained package** vs complex installation
## 🎨 Unique Features
### Hybrid Architecture
- **OpenCode TUI** for superior user experience
- **Qwen OAuth** for seamless authentication
- **Cross-session credential sync** for persistent access
- **Automatic token refresh** for uninterrupted service
### Enhanced AI Capabilities
- **Lakeview Mode** - Concise, minimal output
- **Sequential Thinking** - Structured problem-solving
- **Multi-model support** - Coder and Vision models
- **Context-aware responses** with advanced reasoning
### User Experience
- **One-click launch** via OpenQode.bat
- **Smart authentication** - auto-detects and handles auth
- **Fallback options** - manual browser opening
- **Professional interface** with clear status indicators
## 📊 Technical Advantages
### Performance
- **60 RPM rate limit** vs typical 20 RPM limits
- **2,000 daily requests** for heavy usage
- **Zero cost** vs paid alternatives
- **Reliable uptime** with enterprise-grade infrastructure
### Integration
- **PowerShell-native** on Windows
- **Cross-platform compatible** (Windows, Linux, macOS)
- **Portable package** - no installation required
- **Profile integration** for system-wide access
## 🎯 Target Users
### Developers
- Want **free AI coding assistance**
- Need **TUI interface** for better productivity
- Require **high rate limits** for intensive work
- Prefer **one-click solutions**
### Teams
- Need **cost-effective AI tools**
- Want **consistent experience** across members
- Require **easy deployment** and setup
- Value **professional interfaces**
## 🏆 Competitive Edge
OpenQode dominates the market by offering:
1. **Free tier** that rivals paid services
2. **Professional TUI** missing from free tools
3. **Enterprise features** in consumer package
4. **Zero maintenance** with automatic updates
## 🔮 Future Roadmap
- **Multi-provider support** (OpenAI, Anthropic, Google)
- **Plugin ecosystem** for extended functionality
- **Cloud sync** for settings and sessions
- **Team collaboration** features
- **Advanced analytics** and usage tracking
---
Note: If `bin/opencode.exe` is not included in a GitHub clone, OpenQode will auto-download it during installation or first run. OpenCode UI features (for example Lakeview or Sequential Thinking) depend on the specific OpenCode build you are using.
**OpenQode v1.01 Preview Edition** - Where professional AI coding meets free accessibility.

165
docs/README.md Normal file
View File

@@ -0,0 +1,165 @@
# OpenQode v1.01 Preview Edition
**OpenCode + Qwen Integration Package**
OpenQode is a powerful integration of OpenCode with Qwen AI models, providing free access to advanced coding capabilities.
## Features
### Multiple AI Models
- Qwen Coder Model - Free 2,000 requests/day, 60 RPM
- Qwen Vision Model - Free 2,000 requests/day, 60 RPM
- OpenCode Big Pickle - Default OpenCode model
- OpenCode GPT-5 Nano - Experimental model
- Grok Code - Grok coding model
### Automatic Authentication
- Browser-based OAuth authentication for Qwen models
- Automatic credential management and refresh
- One-time setup, persistent access
### 🔐 Qwen Authentication
When you select a Qwen model, OpenQode will automatically:
1. Check if you're authenticated with Qwen
2. Initiate OAuth authentication if needed
3. Complete the OAuth flow (may happen in background)
4. Store credentials for automatic refresh
**Authentication Notes:**
- 🌐 Browser may open automatically, or authentication may complete in background
- 🔑 If browser doesn't open, visit: https://qwen.ai
- 📱 Use `./scripts/qwen-auth.ps1` for manual authentication
- 🔄 Use `./bin/opencode.exe auth logout qwen` to reset authentication
**Qwen OAuth Benefits:**
- ✅ 2,000 free requests per day
- ✅ No token limits
- ✅ 60 requests per minute rate limit
- ✅ Automatic credential refresh
### Enhanced Features
- Lakeview Mode - Concise, minimal output
- Sequential Thinking - Structured problem-solving
- TUI Interface - Terminal-based interaction
## Quick Start
### Option 1: TUI Default (Recommended)
```powershell
.\OpenQode.ps1
```
This will automatically launch the Terminal UI with Qwen Coder model.
### Installation (PowerShell or Batch)
If you cloned this repo without `bin/opencode.exe`, OpenQode will auto-download it during install or first run.
```powershell
.\Install.ps1
```
Or the batch alternative:
```bat
Install.bat
REM For system-wide PATH (run as Administrator):
Install.bat --systemwide
```
### Option 2: Model Selection Menu
```powershell
.\OpenQode-Menu.ps1
```
This will show a menu to choose your AI model.
### Option 3: Direct Launch with Specific Model
```powershell
# Launch with Qwen Coder (default)
.\OpenQode.ps1 -Model "qwen/coder-model"
# Launch with specific model
.\OpenQode.ps1 -Model "opencode/big-pickle"
```
### Option 4: Double-Click TUI
Simply double-click `OpenQode.bat` in Windows Explorer to start TUI immediately.
## First Time Setup
1. Run OpenQode and choose a Qwen model (option 1 or 2)
2. Your browser will open automatically
3. Complete authentication on qwen.ai
4. Return to terminal and press Enter
5. Enjoy free AI coding!
Note: If `bin/opencode.exe` is not present (for example, when cloning from GitHub), OpenQode will auto-download it during `Install.ps1` or on first run of `OpenQode.ps1`. You can also download it manually with `.\scripts\download-opencode.ps1`.
## Model Details
### Qwen Models (Free)
- 2,000 requests per day
- 60 requests per minute
- No token limits
- Automatic credential refresh
### OpenCode Models
- No authentication required
- Standard OpenCode features
## File Structure
```
OpenQode-v1.01-Preview/
(Note: `bin/opencode.exe` is auto-downloaded if missing)
├── OpenQode.ps1 # Main TUI launcher (default)
├── OpenQode-Menu.ps1 # Model selection menu
├── OpenQode.bat # Windows batch TUI launcher
├── Install.ps1 # Installation script
├── PACKAGE_INFO.txt # Package summary
├── bin/
│ └── opencode.exe # OpenCode binary
├── scripts/
│ ├── opencode-launcher.ps1
│ └── opencode-interactive.ps1
└── docs/
└── README.md # This file
```
## Troubleshooting
### Authentication Issues
```powershell
# Re-authenticate with Qwen
.\bin\opencode.exe auth qwen
```
### Check Authentication Status
```powershell
# List all authenticated providers
.\bin\opencode.exe auth list
```
### Model Switching
Run OpenQode again and choose a different model from the menu.
## System Requirements
- Windows 10/11
- PowerShell 5.1 or later
- Internet connection for Qwen authentication
## Version Information
- Version: 1.01 Preview Edition
- Release Date: December 2024
- Components: OpenCode + Qwen Integration
## Support
For issues and updates, check the original repositories:
- OpenCode: https://github.com/sst/opencode
- Qwen Code: https://github.com/QwenLM/qwen-code
---
**OpenQode v1.01 Preview Edition**
*Powerful AI Coding, Free for Everyone*

BIN
docs/screenshots/agents.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

BIN
docs/screenshots/menu.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 KiB

120
docs/tui-redesign-plan.md Normal file
View File

@@ -0,0 +1,120 @@
# TUI Professional Visual Redesign - Implementation Plan
## Goal
Improve TUI text rendering to be professional-grade like Claude Code, fixing HTML entities, text wrapping, streaming jitter, and layout consistency. **VISUAL ONLY - NO functionality changes.**
---
## User Review Required
> [!IMPORTANT]
> **New Dependencies Required**: This plan requires installing `he` (HTML entity decoder) and `wrap-ansi` (width-aware text wrapping). Both are lightweight, pure ESM-compatible, and widely used.
---
## Root Cause Analysis
| Issue | Source | Fix |
|-------|--------|-----|
| `'` showing literally | `marked` outputs HTML entities, no decoder | Add `he.decode()` before rendering |
| Text bleeding into borders | No width calculation for wrapping | Use `wrap-ansi` with calculated width |
| Inconsistent spacing | No theme system, hardcoded values | Create centralized theme module |
| Streaming jitter | React re-renders on every token | Add batched streaming component |
| List indentation broken | Inline tokens not properly wrapped | Fix list rendering in markdown |
---
## Proposed Changes
### Phase 1: Add Dependencies
```bash
npm install he wrap-ansi
```
---
### Phase 2: Create Theme Module
#### [NEW] bin/tui-theme.mjs
Central theme configuration:
- Spacing scale: xs=0, sm=1, md=2, lg=3
- Semantic colors: fg, muted, info, warning, error, accent, border
- Border styles with fallback for non-unicode terminals
- Consistent component styling
---
### Phase 3: Fix Markdown Renderer
#### [MODIFY] bin/ink-markdown-esm.mjs
**Changes:**
1. Import `he` for HTML entity decoding
2. Import `wrap-ansi` for width-aware wrapping
3. Apply `he.decode()` to all text content before rendering
4. Fix inline token rendering to decode entities
5. Improve list item wrapping and indentation
6. Add terminal width awareness for proper wrapping
---
### Phase 4: Update Card Components
#### [MODIFY] bin/opencode-ink.mjs (lines 477-590)
**Changes:**
1. Import theme module
2. Update SystemCard, UserCard, AgentCard, ErrorCard to use theme
3. Add consistent padding/margin from theme
4. Add flex-based width constraints
5. Ensure proper overflow handling
---
### Phase 5: Add Streaming Stability (Optional)
#### [MODIFY] bin/opencode-ink.mjs
**Changes:**
1. Add batched state update for streaming content
2. Implement 16ms throttle to reduce jitter
3. Use stable keys for message list
---
## Verification Plan
### Manual Testing (User)
Since there are no automated TUI tests in this project, verification is manual:
1. **HTML Entity Test**:
- Launch TUI: `node bin/opencode-ink.mjs`
- Send message containing apostrophes: "what's the best approach?"
- ✅ Verify: apostrophes render as `'` not `'`
2. **Text Wrapping Test**:
- Resize terminal to 80 columns
- Send long message
- ✅ Verify: text wraps cleanly, doesn't touch borders
3. **List Rendering Test**:
- Ask AI to list something: "list 5 programming languages"
- ✅ Verify: bullet points render with proper indentation
4. **Code Block Test**:
- Ask AI for code: "write a hello world in Python"
- ✅ Verify: code block has border, syntax highlighting
5. **Streaming Stability Test**:
- Send message requiring long response
- ✅ Verify: output streams without major jitter
6. **Functionality Preservation Test**:
- `/help` → Shows help card
- `/agents` → Shows agent menu with scrolling
- `/context` → Toggles context
- `/clear` → Clears messages
- ✅ All commands work exactly as before
### Cross-Platform Testing
- Windows Terminal + PowerShell
- Windows CMD
- Linux bash (if available)