Staff as code
Your Staff (business units, units, actors, their schedules, triggers, limits and the skills each one may use) can live in TypeScript files in a Git repository. You change a file, review it in a pull request, and apply it. The orkestia command checks the files on your machine, shows exactly what would change in your organization, and applies only what you approved.
Everything you can declare here you can also do by hand in the Staff console. Staff as code is the way to keep it reviewable and repeatable.
orkestia upgrade moves a project to the newest one.Install
You need Node.js 20 or newer (node --version).
macOS and Linux:
curl -fsSL https://download.orkestia.dev/framework/install.sh | sh
Windows (PowerShell, no admin rights needed):
irm https://download.orkestia.dev/framework/install.ps1 | iex
The script downloads the newest version, checks it against the release's SHA256SUMS and installs the orkestia command with your local npm. Nothing is downloaded from the npm registry for Orkestia's own packages.
orkestia --version
Run the script again to update the command. To pin a version, set ORKESTIA_FRAMEWORK_VERSION (for example ORKESTIA_FRAMEWORK_VERSION=0.1.4). downloads.json lists every version with each file's size and SHA256.
Start a project
In a new folder, or in an existing repository:
orkestia init
npm install
orkestia init keeps what is already in your package.json and adds:
| File | What it is |
|---|---|
package.json | @orkestia/cli and @orkestia/staff as dev dependencies, plus staff:compile and staff:plan scripts |
tsconfig.json | Editor settings for the staff files (only when you have none) |
app/staff/my-team.staff.ts | A starter staff file |
The dependencies point at the same download host, pinned to one version, so everyone on the project and your CI use exactly the same framework.
Write your Staff
Each app/staff/*.staff.ts file default-exports one staff(...) definition:
import { staff, usd } from "@orkestia/staff";
export default staff("my-team", ({ org }) => {
const support = org.bu("my-company").vertical("operations").unit("support", {
title: "Support",
charter: "Answer customer questions.",
});
support.actor("support-agent", { kind: "loop" })
.limits({ maxSteps: 12, budget: usd(5) })
.every(3600, "Read new support questions and draft the answers.");
});
org.bu(...).vertical(...).unit(...)is the same tree you see in the Staff console..actor(name, { kind })hires an actor in that unit:loop(runs on a schedule),trigger(wakes on an event) orhybrid..limits(...),.every(...),.listensTo(...),.canUse(skill(...))and.promptedBy(...)set what it does and what it may use.
Your editor completes and checks every option. The full reference ships with the package: node_modules/@orkestia/staff/README.md.
Check it on your machine
npx orkestia staff compile
This compiles every staff file to .orkestia/staff.blueprint.json without contacting Orkestia. Errors point at the file and line. In CI, use the sandboxed compile, which cannot read secrets, use the network or start processes:
npx orkestia staff compile --pure --out staff.blueprint.json
Connect to your organization
The live commands need an API token:
- In the Orkestia app, switch to the organization you want to manage, then Organization → API Tokens → + Issue new token. Copy the value once.
- Set it in your shell (or as a CI secret):
export ORKESTIA_MEMBER_TOKEN=...
A token belongs to one organization, and the commands use that one. Every live command acts with the token's permissions, as you. Never commit a token.
Plan and apply
npx orkestia staff validate # the server checks the blueprint: permissions, budgets, missing runners or models
npx orkestia staff plan # what would change: creates, updates, grants, archives
npx orkestia staff apply --yes --watch
planwrites.orkestia/staff.plan.json. Review it, or post it on the pull request.applychanges only what the plan showed, and you approve it as yourself: the command records the token's user as the approver.- Removing a unit or actor from a file never archives it. To archive one, say so in the file (below).
--watchfollows the apply until it finishes;orkestia staff watch <apply_run_uuid>picks it up again later.
Archive an actor or a unit
Archiving is explicit. Add it to the staff file:
export default staff("my-team", ({ org }) => {
// ...the rest of your Staff
org.archiveActor("old-agent", { reason: "Replaced by support-agent" });
org.archiveUnit("bu/my-company/vertical/operations/unit/old-team");
});
staff planlists each archive.- Archives are destructive, so
staff apply --yesskips them and tells you so. Apply them with:
npx orkestia staff apply --yes --allow-destructive --watch
An archived actor stops running, and its tokens and seat are released. Archive a unit's actors and child units along with it; they are archived first. Once something is archived, applying the same line again does nothing, so you can delete it from the file.
Upgrade
orkestia upgrade # moves the project's framework packages to the newest version
npm install
Then run the install script again to update the orkestia command itself.
Agents that serve people
Let a Staff agent do work for the person who asked it, in chat or from your own agent harness. The agent keeps its own identity and seat; the person is checked on every start, reads ride on their message and every write needs their tap
App Host
Host your Orkestia app — website, App Data, Files on site MinIO, and a Nostr Buzz relay — from the console, without running your own cluster.
