axle daemon
axle daemonKeeps the repository loaded, watches its files and answers an editor’s questions about it. The VS Code extension and the JetBrains plugin start one for each window and stop it when the window closes, so the task list and its cache status update as you save; you don’t run it yourself. When it can’t start, such as with an older Axle, they run axle for each refresh instead.
It speaks JSON-RPC 2.0 over standard input and output, one message per line:
| Message | Answer |
|---|---|
list |
the JSON of axle list --json |
rehearse { "tasks": ["build"] } |
the JSON of axle run build --dry=json |
shutdown |
null |
exit, a notification |
none; the daemon stops, as it does at the end of its input |
changed { "files" }, from the daemon |
a notification with the files that changed, after the same quiet tenth of a second as axle watch; the list is empty when the system lost track of changes, so any file may have changed |
{ "jsonrpc": "2.0", "id": 1, "method": "rehearse", "params": { "tasks": ["build"] } }{ "jsonrpc": "2.0", "id": 1, "result": { "formatVersion": 1, "packageManager": "pnpm", "concurrency": 16, "tasks": [] } }{ "jsonrpc": "2.0", "method": "changed", "params": { "files": ["packages/ui/src/button.tsx"] } }It reads the repository again for the first question after files change, so the answers always match what axle list and axle run --dry would print then, except that a plugin that fails is left out with a warning on standard error, where axle run --dry would stop. Files Git ignores and those under [watch] don’t count as changes, and a change to [watch] takes effect the next time the daemon starts. When Axle can’t answer, such as for a task that doesn’t exist, the error has "code": -32000, the message, and data with the error’s code, the name of its message page, and its hint. A line that isn’t JSON, a message without a method, an unknown method and wrong params get JSON-RPC’s own errors, -32700, -32600, -32601 and -32602.