Skip to main content

apdb

apdb is an agent-friendly Python debugger inspired by remote-pdb. It keeps the Python call site close to pdb, but exposes debugger control over a newline-delimited JSON TCP API instead of a human interactive shell.

The runtime and CLI use only the Python standard library.

Python API

import apdb

answer = 41
apdb.set_trace(port=8888)
print(answer + 1)

set_trace() blocks the target process whether or not a client is connected. The process resumes only after the TCP API receives a release command such as continue, next, step, or quit.

By default, apdb binds to 127.0.0.1 and uses no authentication:

apdb.set_trace(port=8888, host="127.0.0.1")

CLI

The package installs apdb_cli:

apdb_cli ping --port 8888
apdb_cli state --port 8888
apdb_cli where --port 8888
apdb_cli locals --port 8888
apdb_cli eval 'answer + 1' --port 8888
apdb_cli eval 'answer + 1' --port 8888 --output result.json
apdb_cli exec-file snippet.py --port 8888
apdb_cli exec-file snippet.py --port 8888 --output result.json
apdb_cli next --port 8888
apdb_cli step --port 8888
apdb_cli continue --port 8888

The CLI prints one JSON response to stdout and exits nonzero for connection failures or API errors.

TCP API

The TCP API speaks newline-delimited JSON. Each request and response is one JSON object followed by \n.

Request:

{"id": 1, "cmd": "state"}

Response:

{"id": 1, "ok": true, "result": {"status": "paused"}}

Supported v0 commands:

  • ping
  • state
  • where
  • locals
  • eval
  • exec
  • next
  • step
  • continue
  • quit

Security

apdb has no authentication in v0. Debugger access can inspect and evaluate code inside the target process. Bind to 127.0.0.1 unless you explicitly want to expose that control surface.

Agent Skill

This repository includes a bundled agent skill at skills/apdb/SKILL.md. Install that skill through apdb_cli when you want a coding agent to remember the apdb workflow.

Codex:

apdb_cli skills install --agent codex --scope user
apdb_cli skills install --agent codex --scope project

Claude Code:

apdb_cli skills install --agent claude-code --scope user
apdb_cli skills install --agent claude-code --scope project

Both:

apdb_cli skills install --agent all --scope user
apdb_cli skills install --agent all --scope project

Use --force to overwrite an existing installed skill. --scope global is an alias for --scope user.

Download files

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

Source Distribution

apdb-0.1.4.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

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

apdb-0.1.4-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file apdb-0.1.4.tar.gz.

File metadata

  • Download URL: apdb-0.1.4.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for apdb-0.1.4.tar.gz
Algorithm Hash digest
SHA256 e7432a8181ad83fdd567186c005563f74d7b2da3a6e379c0a2e15c711aa30a01
MD5 7f79279f7ca70ebfe24039b93cf0ba06
BLAKE2b-256 7a4c416792b98ec21050b69417f4c13a390a3ae3187592d58f88f9e611c3f888

See more details on using hashes here.

File details

Details for the file apdb-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: apdb-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 11.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for apdb-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 ced77786947b01daad602a157ac4855abb8556f08c4f0eea7fbbd375629e6605
MD5 dc3a5f91d32a3482a4b7276fa0b50b0f
BLAKE2b-256 3e2574b862bca5158f425f6030b1098d6bd8049b868f5e2c6b83b48a53c62dba

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.5

2 files

This release

0.1.4 This release

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page