Overview Version History Q & A Rating & Review
DFCode VS Code Extension
VS Code extension for DFCode AI coding agent.
Features
💬 Chat Interface : Interactive AI chat directly in VS Code sidebar
🎯 Code Actions : Explain, refactor, document, and fix code with one click
🔧 File Operations : Apply code changes directly from chat
🖥️ Terminal Integration : View command outputs in chat
🔄 Real-time Streaming : See AI responses as they generate
Prerequisites
Install DFCode CLI globally:
npm install -g dfcode
# or
bun install -g dfcode
Configure your API keys for LLM providers
Installation
From Source
Build the extension:
bun install
bun run compile --cwd packages/vscode
Package the extension:
cd packages/vscode
vsce package
Install in VS Code:
Open VS Code
Go to Extensions view (Ctrl+Shift+X)
Click "..." menu → "Install from VSIX"
Select the generated .vsix file
Development Mode
Open this folder in VS Code
Press F5 to launch Extension Development Host
A new VS Code window will open with the extension loaded
Usage
Opening Chat
Click the DFCode icon in the Activity Bar (left sidebar)
Or use keyboard shortcut: Ctrl+Shift+D / Cmd+Shift+D
Code Actions
Select code in the editor, right-click and choose:
DFCode: Explain Code - Get explanation of selected code
DFCode: Refactor Code - Get refactored version
DFCode: Generate Documentation - Add doc comments
DFCode: Fix Issues - Find and fix problems
Configuration
Open VS Code Settings (Ctrl+,) and search for "DFCode":
Setting
Default
Description
dfcode.server.port
4096
Port for DFCode server
dfcode.server.autoStart
true
Auto-start server on VS Code launch
dfcode.server.path
"dfcode"
Path to dfcode executable
dfcode.provider.default
"anthropic"
Default LLM provider
Provider config file locations used by the extension:
Scope
Path
Workspace
.dfcode/dfcode.jsonc (or .dfcode/dfcode.json)
Global (Linux/macOS)
$XDG_CONFIG_HOME/dfcode/dfcode.jsonc (fallback: ~/.config/dfcode/dfcode.jsonc)
Global (Windows)
%APPDATA%\\dfcode\\dfcode.jsonc (fallback: %USERPROFILE%\\AppData\\Roaming\\dfcode\\dfcode.jsonc)
Architecture
VS Code Extension
├── Core
│ └── ServerManager - Manages dfcode server lifecycle
├── Chat
│ ├── Panel - Webview panel for chat UI
│ └── Webview - HTML/CSS/JS for chat interface
└── Commands
├── CodeActions - Editor context menu commands
└── Index - Command registration
Development
Project Structure
packages/vscode/
├── src/
│ ├── extension.ts # Extension entry point
│ ├── core/
│ │ └── server.ts # Server management
│ ├── chat/
│ │ ├── panel.ts # Chat panel logic
│ │ └── webview.ts # Webview HTML generator
│ └── commands/
│ ├── index.ts # Command registration
│ └── codeActions.ts # Code action handlers
├── package.json # Extension manifest
└── tsconfig.json # TypeScript config
Building
# Compile TypeScript
bun run compile --cwd packages/vscode
# Watch mode for development
bun run watch --cwd packages/vscode
# Type check
bun run typecheck --cwd packages/vscode
Debugging
Open packages/vscode in VS Code
Go to Run and Debug view (Ctrl+Shift+D)
Select "Run Extension" and press F5
A new VS Code window opens with the extension loaded
Set breakpoints in the source code
License
MIT