workar-server
v0.1.39
Published
Server-side runner CLI for the distributed work system. Long-polls the API for work items, executes the configured command, and posts results back.
Readme
workar-server
Server-side runner CLI for the distributed work system. Long-polls the API for work items, executes the configured command, and posts results back.
Setup
npm install -g workar-serverAuthentication
Authentication uses email OTP. Run once before starting the work loop:
workar-server auth [--email [email protected]] [--server <url>]- Enter your email address (or pass
--email). - A 6-digit code is sent to that address.
- Enter the code — a JWT is saved to
~/.workar-server/config.json.
Alternatively, pass --api-key or set WORKAR_API_KEY to use an API key directly.
Running the work loop
workar-server \
[--server <url>] (default: $WORKAR_SERVER_URL or https://workar.tarsk.io)
[--api-key <key>] (or set WORKAR_API_KEY; falls back to saved JWT from auth)
[--defs <path>] (default: $TARSK_WORK_DEFS or ./work-defs.json)
[--timeout-ms <n>] (default: 600000)work-defs.json
Defines how each work type maps to a CLI command. Adding a new work type only requires a new entry here — no code changes needed.
[
{
"type": "image-gen",
"commands": ["node ../image-gen-cli/src/cli.js -p @prompt -m @model -o @workId.png"],
"contentType": "image/png",
"outputFile": "@workId.png"
}
]Token substitution: @<key> is replaced with the corresponding field from the
work JSON. @workId is always available. Substitution happens on the final argv
array, not on a shell string, so user-supplied values cannot cause injection.
