Add REST API server for AI agent integration #122
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements a REST API server that allows AI agents and external tools to interact with Zephyr IDE functionality programmatically. The API provides endpoints for project management, build operations, flashing, and workspace configuration access.
Features
API Server
Configuration Options
New VS Code settings added:
zephyr-ide.api_server_enabled
- Enable/disable the API serverzephyr-ide.api_server_port
- Configure server port (default: 8080)zephyr-ide.api_server_key
- Optional API key for authenticationAPI Endpoints
GET /api/status
- Extension and workspace statusGET /api/projects
- List all projects and their build configurationsPOST /api/projects
- Create new projects (initiates interactive process)GET /api/projects/{name}/builds
- Get build configurations for a projectPOST /api/projects/{name}/builds
- Add build configurationsPOST /api/build
- Trigger builds with optional project/build selectionPOST /api/flash
- Flash firmware to target devicesGET /api/workspace/config
- Get sanitized workspace configurationSecurity
X-API-Key
orAuthorization
headersDocumentation and Examples
docs/API.md
examples/api-client.py
) for AI agent integrationexamples/test-api.sh
) for endpoint validationUsage Example
Integration
The API server integrates seamlessly with existing Zephyr IDE functionality:
This enables AI agents to automate Zephyr development workflows, perform automated builds, manage projects, and integrate with CI/CD pipelines while maintaining the same reliability and feature set as the interactive extension.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
update.code.visualstudio.com
node /home/REDACTED/work/zephyr-ide/zephyr-ide/node_modules/.bin/vscode-test
(dns block)If you need me to access, download, or install something from one of these locations, you can either:
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.