Synapse VS Code Extension
A complete IDE experience for Synapse plugin development, providing visual tooling, IntelliSense, and API testing.
Features
Plugin Explorer
- Auto-detection: Automatically discovers plugins via
config.yaml in your workspace
- Plugin metadata: Shows name, version, and category
- Action listing: Lists all plugin actions with quick run access
- Quick actions: Run, Publish, Validate, Open Config from context menu
Action Execution
- Mode selection: Run actions in local, task, or job mode
- Parameter input: Quick Pick for simple params, JSON input for complex ones
- CLI integration: Uses Synapse CLI for local execution
- Progress indication: Real-time output in terminal
HTTP Client
- Built-in REST client: Test plugin API endpoints directly from VS Code
- Auto-configuration: Pre-fills URL, headers, and auth from your login
- Request templates: Quick templates for Train, Inference, and Deploy actions
- Response viewer: View formatted JSON responses with status and timing
Authentication
- Auto-login from CLI: Automatically loads credentials from
~/.synapse/config.json
- Secure login: Enter your API host and access token to connect
- Token storage: Credentials stored securely in OS keychain via VS Code SecretStorage
- Account view: Shows logged-in user and connected host
Development Experience
- JSON Schema validation: Real-time validation of
config.yaml
- Diagnostics: Inline errors and warnings as you type
- CodeLens: [Run] links above actions in config files
- Hover info: Documentation on hover for config fields
- Python snippets: BaseAction, TrainAction, InferenceAction templates
Status Bar
- Auth status: Shows logged-in user email or login prompt
- CLI status: Shows Synapse CLI version and path
Installation
From Marketplace
Search for "Synapse Plugin Development" in VS Code Extensions, or install from VS Code Marketplace.
From Source
git clone https://github.com/datamaker/synapse-vscode.git
cd synapse-vscode
npm install
npm run compile
Press F5 to launch Extension Development Host, or package as VSIX:
npx @vscode/vsce package
code --install-extension synapse-0.1.0.vsix
Usage
Login
Automatic: If you've logged in via the Synapse CLI (synapse login), the extension will automatically use your credentials from ~/.synapse/config.json.
Manual:
- Click the "Login" button in the status bar
- Enter your API host URL (e.g.,
https://api.synapse.sh)
- Enter your access token
Run an Action
- Open a workspace containing a Synapse plugin
- Click the play button next to an action in the Plugin Explorer, or
- Click the [Run] CodeLens above an action in
config.yaml
- Select execution mode (local/task/job)
- Enter parameters when prompted
Test API with HTTP Client
- Click the Synapse icon in the Activity Bar
- Expand the "HTTP Client" section
- Select an action and enter agent ID
- Click "Send Request" to test the API
Publish a Plugin
- Press
Ctrl+Shift+P → "Synapse: Publish Plugin"
- Choose "Dry Run" to preview, or "Publish" to upload
Commands
| Command |
Description |
Synapse: Login |
Authenticate with backend |
Synapse: Logout |
Sign out and clear credentials |
Synapse: Create Plugin |
Interactive wizard for new plugin |
Synapse: Publish Plugin |
Publish to registry |
Synapse: Validate Config |
Validate config.yaml |
Synapse: Run Action |
Execute with mode selection |
Synapse: Run Action (Local) |
Quick local execution |
Synapse: Select Plugin Directory |
Manually select plugin folder |
Synapse: Select CLI Path |
Configure Synapse CLI location |
Synapse: Open HTTP Client |
Open the HTTP testing panel |
Settings
| Setting |
Default |
Description |
synapse.defaultHost |
https://api.synapse.sh |
Default backend API URL |
synapse.defaultExecutionMode |
local |
Default run mode (local/task/job) |
synapse.pythonPath |
"" |
Python executable path |
synapse.cliPath |
synapse |
CLI executable path |
Python Snippets
| Prefix |
Description |
synapse-action |
Create a BaseAction class |
synapse-train |
Create a training action |
synapse-infer |
Create an inference action |
synapse-export |
Create an export action |
synapse-func |
Create a function-based action with @action decorator |
synapse-params |
Create a Pydantic params model |
synapse-result |
Create a result model |
synapse-progress |
Set action progress |
synapse-log |
Use context logger |
Requirements
- VS Code 1.85.0 or later
- Synapse CLI installed (
pip install synapse-sdk)
- Python 3.10+ (for plugin development)
License
MIT
| |