Repository navigation
v0.2.0
plugyard can now be driven from another machine: over HTTP, by an AI agent through MCP tools, and from a container.
Before you update
Nothing you have needs changing. Site files, Chargerfiles, scenarios and saved chargers work as before.
- Updating from v0.1.x: stop running sites first (
plugyard site down, orplugyard stop <charger>), thenplugyard update. v0.1.x refuses to update while a site runs, and says which. From v0.2.0 on,updatestops and restarts them for you. - Nothing new listens unless you start it. The API runs only after
plugyard api uporsite up --api, and then on127.0.0.1only, until you make a token and name another address.
New
An HTTP API, for those with no shell where plugyard runs
On a shared staging server, the app and dashboard teams can now plug an EV in, present a tag or cause a fault themselves.
plugyard api token create mobile-team --site staging # prints the token, once
plugyard api up -d --listen 0.0.0.0:7070curl -X POST -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d '{"tag": "04A1B2C3"}' https://plugyard.example.com/v1/chargers/FAST-1/tap
curl -H "Authorization: Bearer $TOKEN" "https://plugyard.example.com/v1/chargers/FAST-1/wait?state=Charging"- It lists and inspects chargers, runs the actions of
plugyard exec, waits for a state, and reads a charger's log. Starting chargers, updating plugyard and anything that touches files stay on the command line. - Tokens have names, can be limited to one site, and can be read-only.
plugyard api logsshows who did what to which charger. - A web page in a browser cannot act through it.
plugyard api specprints the description as an OpenAPI document.
Tools for AI agents (MCP)
The API serves the same reading and actions as tools, at /mcp. In Claude Code:
claude mcp add --transport http plugyard https://plugyard.example.com/mcp \
--header "Authorization: Bearer $TOKEN"Then ask: "plug an EV into FAST-1, start a session with tag 04A1B2C3, and tell me what the CSMS answered".
- Reading:
list_chargers,inspect_charger,wait_for_state,read_logs. - Acting:
plug,unplug,tap,fault,clear_fault,go_offline,go_online,reboot,fail_next. - A read-only token is offered the reading tools only.
- Tried with Claude Code. Other agent clients have not been tried yet; reports are welcome.
A container image
plugyard is on Docker Hub as amraa1/plugyard, for linux/amd64 and linux/arm64.
docker run --rm -e CSMS_URL=ws://host.docker.internal:9000/ocpp amraa1/plugyard:0.2.0- With nothing mounted it runs three chargers against the CSMS you name. Mount a folder with your
site.yamlat/siteto run your own. plugyard site up --api <address>runs a site and the API in one process, which is what a container wants.examples/docker/compose.yamlis a ready setup for a server, with a volume and a restart after a crash or a reboot.
update and uninstall take care of what is running
plugyard updatestops running sites and the API, replaces the program, and starts them again with the same chargers. It asks first, and says how many transactions would end.plugyard uninstallstops them after you confirm.
Not yet tried
- The API and the tools behind a reverse proxy with HTTPS.
- The image on an ARM machine.
- A restart of running sites across a real update, since this is the first version that does it.
What's Changed
- Add an HTTP API for callers with no shell on the machine by @Amraa1 in #31
- Stop what is running for update and uninstall, and restart it by @Amraa1 in #32
- Add the container image and site up --api by @Amraa1 in #33
- Add wait and logs to the HTTP API by @Amraa1 in #34
- Serve the API's reading and actions as MCP tools by @Amraa1 in #35
Full Changelog: v0.1.4...v0.2.0