Public Python SDK and CLI for the ctxd platform.
Project description
ctxd
Public Python SDK and CLI for the ctxd platform.
Install:
pip install ctxd
The SDK exposes sync and async clients:
ClientAsyncClient
Authentication:
- Preferred for headless and scripts: create a user-bound API key through the authenticated application backend
- Provide it with
Client(api_key=...)orCTXD_API_KEY - The SDK sends that key as the bearer token directly to the MCP server
ctxd loginis still supported for interactive local OAuth login- If
CTXD_API_KEYis set and you runctxd login, the CLI first validates the key withget_profile(). If valid, it skips OAuth and reports that you are already authenticated. If invalid, it warns and asks whether to continue with interactive login.
Base URL resolution order:
base_url=passed to the clientCTXD_BASE_URL~/.ctxd/config.jsonhttps://mcp.ctxd.dev
Auth API URL resolution order:
CTXD_AUTH_API_URLhttps://api.ctxd.dev
Example:
from ctxd import Client
client = Client(api_key="297e24c4-4ee9-4739-828f-48f57f48ce11")
results = client.search("text:deployment application:slack")
profile = client.get_profile()
document = client.fetch_document("doc-123")
API key example:
from ctxd import Client
client = Client(api_key="297e24c4-4ee9-4739-828f-48f57f48ce11")
results = client.search("text:deployment application:slack")
Async example:
from ctxd import AsyncClient
async with AsyncClient(api_key="297e24c4-4ee9-4739-828f-48f57f48ce11") as client:
results = await client.search("text:deployment")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ctxd-0.1.7.tar.gz
(12.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
ctxd-0.1.7-py3-none-any.whl
(15.6 kB
view details)
File details
Details for the file ctxd-0.1.7.tar.gz.
File metadata
- Download URL: ctxd-0.1.7.tar.gz
- Upload date:
- Size: 12.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.26
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f711325afedfddb1b0986a6e85d27f60aa1ac8b022c955105094e916e26515a
|
|
| MD5 |
27f767469c77320b163ec8f00d1cb653
|
|
| BLAKE2b-256 |
7d0ca00549f79b78fbaab4c6b4a44c84eb48bd146285f3a7bea41c7e7ace9c1e
|
File details
Details for the file ctxd-0.1.7-py3-none-any.whl.
File metadata
- Download URL: ctxd-0.1.7-py3-none-any.whl
- Upload date:
- Size: 15.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.26
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1328e3d147741cdf86e79d8305db4b43de6aa3412abe62c147162515ac44b48a
|
|
| MD5 |
780c0b137f5fea7cecb3f43afd006f2f
|
|
| BLAKE2b-256 |
f2a528e6e3f8d4d8755fdab3951a24767346609af63116f1945f18a26effec25
|