> ## Documentation Index
> Fetch the complete documentation index at: https://docs.drkm.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# 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; for automation without a keyring, inject an API key from your secret manager into `$DRKM_TOKEN` at runtime.

```bash Terminal theme={null}
# Local outpost
drkm start

# Or an outpost you already have
drkm console login https://outpost.example --device
drkm console whoami
```

## 2. 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](https://docs.drkm.dev/skills.md) 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` searches threads, jobs, outposts and commands, and `Ctrl+Q` detaches without stopping a running agent.

```bash Terminal theme={null}
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 console
```

## 3. Write a worker

Create `worker.py`. A worker is a top-level function `run(records, context)`: the platform calls it once with the job's input records and a context, and it returns one JSON-compatible result for the job. This one flags sensor readings above a threshold. The function lives in its own module, not in the script you run.

```python worker.py theme={null}
def run(records, context):
    return [
        {
            "id": record["id"],
            "temperature": record["data"]["temperature"],
            "alert": record["data"]["temperature"] > 80,
        }
        for record in records
    ]
```

## 4. Submit and collect

First, [install the Python SDK](https://docs.drkm.dev/installation.md#get-the-python-sdk) in the Python environment you will use to run `submit.py`. The CLI's bundled SDK is separate from your own Python environment. Install `keyring` there too to reuse your terminal's saved sign-in.

Save this beside the worker as `submit.py` and run it. `connect()` points the SDK at an address you pass, else at `$DRKM_URL`, 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. `rows()` returns the worker's result as one row, under `output`.

```python submit.py theme={null}
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):
    for reading in row["output"]:
        print(reading["id"], reading["alert"])
```

> [!NOTE]
>
> Name every job: the name is what operators read in the job list. A job settles as completed, partial, failed or canceled; read state and coverage before treating the rows as the whole result.

## 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.

```bash Terminal theme={null}
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 outposts
```

## Where next

> [card] [The Python SDK](https://docs.drkm.dev/python-sdk.md)
>
> Records, workers, limits, detectors, plans and the job lifecycle.

> [card] [Add devices to the mesh](https://docs.drkm.dev/mesh.md)
>
> Invite a second machine and place work across both.

> [card] [Connectors and MCP](https://docs.drkm.dev/connectors.md)
>
> Give the agent the services and tools it needs.

> [card] [Skill files](https://docs.drkm.dev/skills.md)
>
> Teach the agent a repeatable procedure with one Markdown file.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.