Get started
Quick start
From a signed-in terminal to a durable job: talk to the agent, submit a Python worker, watch it run, collect the rows.
1. Connect
Start the local outpost, or sign in to one you have access to, and confirm which account you are signed in as. Every command below reuses that sign-in. So does the SDK when the keyring package is installed beside it or you signed in with --credential-file; otherwise give it an API key in $DRKM_TOKEN.
# Local outpost
drkm start
# Or an outpost you already have
drkm console login https://outpost.example --device
drkm console whoami2. Talk to the agent
drkm on its own, or drkm console, opens the terminal workspace. drkm console chat -p sends one turn and prints the final answer, which is the form to use from scripts. Inside the workspace, /skills manages your skills and /skill-name runs one, @ picks an outpost to delegate to, /jobs and /outposts inspect work and the fleet, /tasks lists background runs, Ctrl+K opens the command list and Ctrl+Q detaches without stopping a running agent.
drkm console chat -p "What models, tools and peers does this outpost have?"
# Choose the effort for one turn, attach a file
drkm console chat -p "Summarize this" --attach report.pdf --effort high
# The interactive workspace
drkm console3. Write a worker
Create worker.py. A record worker is a top-level function run(record, context): it receives one input record and a context, and returns a JSON-compatible result. This one flags sensor readings above a threshold. The function lives in its own module, not in the script you run.
def run(record, context):
reading = record["data"]["temperature"]
return {
"id": record["id"],
"temperature": reading,
"alert": reading > 80,
}4. Submit and collect
Save this beside the worker as submit.py and run it. connect() points the SDK at an address you pass, else at $DRKM_OUTPOST, else at the outpost your terminal is signed in to. package() describes the worker and the files to seal with it; submit() returns a job ID at once. From then on the job belongs to the platform: it outlives this script, and wait() polls until it settles.
import drkm
drkm.connect()
worker = drkm.package("worker.py:run", ["worker.py"])
job_id = drkm.submit(
worker,
inputs=[
{"id": "sensor-a", "data": {"temperature": 72}},
{"id": "sensor-b", "data": {"temperature": 86}},
],
name="Check sensor temperatures",
)
status = drkm.wait(job_id)
print(status["state"], status["coverage"])
for row in drkm.rows(job_id):
print(row["record_id"], row["output"])5. Watch it run
The same job is visible from the terminal, the console and the SDK. drkm console jobs opens the Jobs screen on an interactive terminal and prints the ledger as JSON when piped; add the job ID for one job, and when piped --runs prints its partitions and attempts. In the console, open Outposts and its Jobs tab. From Python, drkm.Job(job_id) picks a submitted job up again from a later run.
drkm console jobs
drkm console jobs YOUR_JOB_ID
drkm console jobs YOUR_JOB_ID --runs | less
# The fleet this outpost can place work on
drkm console outpostsWhere next
Records, workers, limits, detectors, plans and the job lifecycle.
DeployAdd devices to the meshInvite a second machine and place work across both.
ConnectConnectors and MCPGive the agent the services and tools it needs.
BuildSkill filesTeach the agent a repeatable procedure with one Markdown file.