Skip to main content

dejima — Python client

Thin Python client for the Dejima API: run a fleet of AI coding agents on hardware you own.

Alpha (0.x). The API is stable in shape (v1/-prefixed) but fields may change until 1.0. This client is hand-written over the REST surface and mirrors openapi.yaml; the only non-generated piece is the PTY Session helper.

Install

pip install dejima-sdk            # REST client
pip install 'dejima[ws]'      # + WebSocket PTY attach()

Quickstart

from dejima import Client

# host/token from $DEJIMA_HOST and $DEJIMA_TOKEN, or pass explicitly:
dj = Client(host="100.84.12.7:7273")

isl = dj.create_island(repo="git@github.com:you/foo.git", agent="claude-code")
print(isl["name"], isl["state"])

# add a second agent on its own worktree
dj.add_agent(isl["name"], type="codex")

# one-shot command
out = dj.exec(isl["name"], ["git", "status", "--short"])
print(out["stdout"], "exit", out["exit_code"])

# fleet view
for i in dj.list_islands():
    print(i["name"], i["state"], len(i.get("agents", [])), "agents")

print(dj.overview())   # daemon health, VM memory, rollup

Interactive sessions

attach() opens the multi-attach PTY stream (needs the ws extra). The daemon speaks a small JSON-envelope protocol over the WebSocket — Session hides that, so you deal in raw bytes:

with dj.attach(isl["name"]) as s:   # or agent="p2"
    s.resize(40, 120)
    s.send(b"ls -la\n")
    print(s.recv())                 # bytes of PTY output, or None when closed

dj.attach_terminal("t1") does the same for an operator host terminal.

API coverage

The client covers the full v1 surface:

  • Islands — list/create/get/update/delete, hibernate/wake/reset/upgrade, clone, resources, workspace-ready, events.
  • Agents — list/add/get/update/remove, configure (provider/model).
  • Exec & files — exec, file read/write, logs.
  • Port broker — scopes (list/grant/revoke), intake/export/write.
  • Capability broker — grants (list/grant/revoke), execute.
  • MCP broker — grants (list/grant/revoke), mcp_call.
  • Credentials — Claude push/status, GitHub identities + repos, LLM providers.
  • Operator tokens — create/list/revoke (owner-only; role + island scope).
  • Events — webhook subscribe/list/unsubscribe.
  • Activity — team activity feed (activity, filterable).
  • Daemon — overview, agent-types, healthz, audit (filters + jsonl/csv export), clients, sessions-revoke, panic, admin-update, image-build, SSH account keys.
  • Host terminals — list/create/delete/relabel + attach_terminal.
  • Sessionsattach / attach_terminal (PTY) and session_url.

Every non-2xx response raises dejima.DejimaError (.status, .message).

Auth

  • Operator (unix socket / tailnet) needs no token.
  • Autonomy path (an agent driving its own/child islands) uses a per-island bearer token — set DEJIMA_TOKEN or pass token=.

Development

pip install -e '.[dev]'
pytest

Tests run against a stdlib http.server stub — no running daemon required.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dejima_sdk-0.8.71.tar.gz (15.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dejima_sdk-0.8.71-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

Details for the file dejima_sdk-0.8.71.tar.gz.

File metadata

  • Download URL: dejima_sdk-0.8.71.tar.gz
  • Upload date:
  • Size: 15.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.14

File hashes

Hashes for dejima_sdk-0.8.71.tar.gz
Algorithm Hash digest
SHA256 e5b75939991cc49b6c8f7aaf63228326780c73f65628fbe65d926c02e4e83f5c
MD5 a4e1d4d8463821c9f74a125ce79f37c6
BLAKE2b-256 8151a1e855d127bbb1fa92a3b97f0087d4fef6ef5081e2bcad466e7d37c99d6a

See more details on using hashes here.

File details

Details for the file dejima_sdk-0.8.71-py3-none-any.whl.

File metadata

  • Download URL: dejima_sdk-0.8.71-py3-none-any.whl
  • Upload date:
  • Size: 12.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.14

File hashes

Hashes for dejima_sdk-0.8.71-py3-none-any.whl
Algorithm Hash digest
SHA256 20064bfcbdcdd2069caa2db172b39ed811694ec5e197ab0e817267d35764130b
MD5 4dc1e960ca8b9aec5e95a49fa71bda7c
BLAKE2b-256 5d59e1cecc8b67051c2eb6078beab1670c5d837018b5cca4d4a30a93e525bb00

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.8.71 This release

2 files

0.8.70

2 files

0.8.69

2 files

0.8.68

2 files

0.8.67

2 files

0.8.66

2 files

0.8.65

2 files

0.8.64

2 files

0.8.63

2 files

0.8.62

2 files

0.8.61

2 files

0.8.60

2 files

0.8.59

2 files

0.8.58

2 files

0.8.57

2 files

0.8.56

2 files

0.8.55

2 files

0.8.54

2 files

0.8.53

2 files

0.8.52

2 files

0.8.51

2 files

0.8.50

2 files

0.8.49

2 files

0.8.48

2 files

0.8.47

2 files

0.8.46

2 files

0.8.45

2 files

0.8.44

2 files

0.8.43

2 files

0.8.42

2 files

0.8.41

2 files

0.8.40

2 files

0.8.39

2 files

0.8.38

2 files

0.8.37

2 files

0.8.36

2 files

0.8.35

2 files

0.8.34

2 files

0.8.33

2 files

0.8.32

2 files

0.8.31

2 files

0.8.30

2 files

0.8.29

2 files

0.8.28

2 files

0.8.27

2 files

0.8.26

2 files

0.8.25

2 files

0.8.24

2 files

0.8.23

2 files

0.8.22

2 files

0.8.21

2 files

0.8.20

2 files

0.8.19

2 files

0.8.18

2 files

0.8.17

2 files

0.8.16

2 files

0.8.15

2 files

0.8.14

2 files

0.8.13

2 files

0.8.12

2 files

0.8.11

2 files

0.8.10

2 files

0.8.9

2 files

0.8.8

2 files

0.8.7

2 files

0.8.6

2 files

0.8.5

2 files

0.8.4

2 files

0.8.3

2 files

0.8.2

2 files

0.8.1

2 files

0.8.0

2 files

0.7.2

2 files

0.7.1

2 files

0.7.0

2 files

0.6.9

2 files

0.6.8

2 files

0.6.7

2 files

0.6.6

2 files

0.6.5

2 files

0.6.4

2 files

0.6.3

2 files

0.6.2

2 files

0.6.1

2 files

0.6.0

2 files

0.5.3

2 files

0.5.2

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page