Vivus Agent
An AI coding assistant VSCode extension powered by LM Studio, designed to work like Amp but with your own local/hosted language model.
Features
- 🤖 AI-Powered Coding Assistant: Get help with coding tasks, debugging, and explanations
- 🔧 Tool Calling Support: Execute file operations, terminal commands, and searches
- 💬 Interactive Chat Interface: Clean, integrated sidebar panel within VSCode
- 🌐 LM Studio Integration: Connect to your LM Studio instance with qwen3-4b-thinking model
- 📁 File System Tools: Read, write, edit files and directories
- ⚡ Terminal Integration: Execute shell commands directly from chat
- 🔍 Advanced Search: Find files and search content across your codebase
- 📚 Chat History: Store and retrieve conversation history with Appwrite backend
- 🔄 Streaming Responses: Real-time response display as the model generates text
- ⚙️ Easy Configuration: Settings button for quick access to preferences
- 🔁 Auto-Retry: Automatic retry logic for network timeouts and errors
Installation
Prerequisites
- LM Studio: Set up LM Studio at
https://llm.changeme.ai
with the qwen3-4b-thinking
model
- Node.js: Version 16 or higher
- VSCode: Version 1.74.0 or higher
Building from Source
Clone this repository:
git clone <your-repo-url>
cd vivus-agent
Install dependencies:
npm install
Compile the extension:
npm run compile
Open in VSCode and press F5
to launch the extension development host
Installing the Extension
Package the extension:
npx vsce package
Install the generated .vsix
file in VSCode:
- Open VSCode
- Go to Extensions view (
Ctrl+Shift+X
)
- Click the
...
menu and select "Install from VSIX..."
- Select the generated
.vsix
file
Usage
First Time Setup
On first launch, Vivus Agent will automatically ask if you'd like to set up chat history storage. This is completely optional but recommended for preserving your conversations.
Opening the Interface
- Activity Bar: Click the 🤖 robot icon on the left sidebar
- Keyboard Shortcut:
Ctrl+Shift+V
(or Cmd+Shift+V
on Mac)
- Command Palette:
Ctrl+Shift+P
→ "Open Vivus Agent Chat"
- Context Menu: Right-click selected code → "Ask about selected code"
Interface Overview
The sidebar contains three sections:
- Chat: Interactive conversation with the AI assistant
- Output: Detailed logs of tool executions and API calls
- History: Browse and restore previous chat sessions (auto-setup available)
The agent has access to several tools to help with your coding tasks:
read_file
: Read file contents with optional line ranges
write_file
: Create or overwrite files
edit_file
: Replace text within files
list_directory
: List files and directories
create_directory
: Create directories
run_command
: Execute shell commands in the workspace
check_command_exists
: Verify if commands are available
search_files
: Search for text patterns within files
find_files
: Find files by name patterns
get_file_info
: Get detailed file information
Example Interactions
User: "Create a new TypeScript file called utils.ts with some helper functions"
Agent: [Uses write_file tool to create the file with TypeScript helper functions]
User: "Find all TODO comments in my project"
Agent: [Uses search_files tool to find TODO patterns across the codebase]
User: "Run the build command and fix any errors"
Agent: [Uses run_command to execute build, then uses file tools to fix identified issues]
Configuration
Basic Settings
Configure the extension in VSCode settings or click the ⚙️ Settings button in the chat panel:
{
"vivusAgent.apiUrl": "https://llm.changeme.ai",
"vivusAgent.model": "qwen3-4b-thinking",
"vivusAgent.temperature": 0.7,
"vivusAgent.maxTokens": 2048,
"vivusAgent.enableStreaming": true,
"vivusAgent.timeoutMs": 300000,
"vivusAgent.retryAttempts": 3
}
⏱️ Timeout Settings for Thinking Models:
- Default timeout increased to 5 minutes (300000ms) for qwen3-4b-thinking
- Thinking models need more time to process complex requests
- Adjust
vivusAgent.timeoutMs
if you need longer/shorter timeouts
History Setup (Optional)
Easy 2-Step Setup: The extension will automatically offer to set up chat history on first use.
Manual Setup:
- Click the 🗄️ Setup History button in the History panel, OR
- Use Command Palette:
Ctrl+Shift+P
→ "Vivus Agent: Setup Chat History"
- Enter your Appwrite server URL (e.g.,
https://your-appwrite.com/v1
)
- Enter your Appwrite Project ID
- Done! ✅ Database, collection, and schema are created automatically
What gets configured automatically:
- ✅ Tests connection to your Appwrite server
- ✅ Configures all VSCode settings automatically
- ✅ Enables history storage
- ✅ Sets default database (
vivus-agent-history
) and collection (chat-sessions
) names
Requirements:
- An Appwrite server (free hosting available at Appwrite Cloud)
- A Project ID from your Appwrite console
- Manual Step: Create the database and collection in Appwrite console (or the extension will show helpful error messages)
Database Schema (create manually in Appwrite console):
- Database ID:
vivus-agent-history
- Collection ID:
chat-sessions
- Attributes:
title
(string), messages
(string), createdAt
(datetime), updatedAt
(datetime), userId
(string, optional)
Settings
vivusAgent.apiUrl
: LM Studio API URL (default: "https://llm.changeme.ai")
vivusAgent.model
: Model name to use (default: "qwen3-4b-thinking")
vivusAgent.temperature
: Response randomness (0-2, default: 0.7)
vivusAgent.maxTokens
: Maximum tokens for responses (default: 2048)
Development
Project Structure
src/
├── extension.ts # Extension entry point
├── chatPanel.ts # Chat UI webview
├── lmStudioClient.ts # LM Studio API client
├── toolManager.ts # Tool execution manager
└── tools/
├── fileSystemTool.ts # File operations
├── terminalTool.ts # Shell commands
└── searchTool.ts # Search functionality
Building
# Compile TypeScript
npm run compile
# Watch mode for development
npm run watch
Testing
The extension includes comprehensive tool implementations that mirror Amp's capabilities:
- File Operations: Full CRUD operations on files and directories
- Terminal Integration: Safe command execution with timeout controls
- Search Functionality: Efficient text and file search with filtering
- Error Handling: Robust error handling and user feedback
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
License
MIT License - see LICENSE file for details
Troubleshooting
Common Issues
- Connection Failed: Verify LM Studio is running at the configured URL
- Tool Errors: Check workspace permissions and file paths
- Model Not Found: Ensure the model name matches your LM Studio configuration
Debugging
Enable developer tools in the extension host:
- Press
Ctrl+Shift+P
in the extension development host
- Run "Developer: Toggle Developer Tools"
- Check the Console tab for error messages
Roadmap
- [ ] Streaming responses for better UX
- [ ] More advanced code analysis tools
- [ ] Integration with VSCode's language services
- [ ] Custom tool plugins
- [ ] Better error recovery and retries
- [ ] Conversation persistence
- [ ] Multiple model support
Note: This extension requires a properly configured LM Studio instance with tool calling support. Make sure your model supports function calling for the best experience.