Metadata-Version: 2.4
Name: redis-afs
Version: 0.1.0
Summary: Python SDK for the AFS control plane and agent filesystem mounts.
Author: Redis
License-Expression: AGPL-3.0-only
Project-URL: Homepage, https://github.com/redis/agent-filesystem/tree/main/sdk/python
Project-URL: Repository, https://github.com/redis/agent-filesystem
Project-URL: Issues, https://github.com/redis/agent-filesystem/issues
Keywords: afs,agent-filesystem,redis,sdk,mcp,workspace,checkpoint
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# `redis-afs`

Python SDK for creating AFS workspaces, mounting them in-process, reading and
writing files, checkpointing work, and running shell commands against an
isolated AFS-backed workspace.

## Install

```bash
pip install redis-afs
```

## Quick Start

```python
import os
from redis_afs import AFS

afs = AFS(api_key=os.environ["AFS_API_KEY"])
workspace = afs.workspace.create(name="foobar")

fs = afs.fs.mount(
    workspaces=[{"name": workspace["name"]}],
    mode="rw",
)

try:
    fs.write_file("/src/README.md", "hello world")
    result = fs.bash().exec("cat /foobar/src/README.md")
    print(result.stdout)
finally:
    fs.close()
```

`MountedFS` also works as a context manager:

```python
with afs.fs.mount(workspaces=[{"name": "foobar"}], mode="rw") as fs:
    fs.write_file("/README.md", "hello")
```

## Authentication

```bash
export AFS_API_KEY="afs_..."
```

Set `AFS_API_BASE_URL` to target a local or Self-managed control plane. If not
provided, the SDK defaults to `https://afs.cloud`.

## API Reference

See [api-docs.md](api-docs.md) for the full Python API surface, including
workspace management, checkpoints, mount semantics, file operations, shell
execution, low-level MCP access, and current limitations.

## Test

From `sdk/python`:

```bash
PYTHONPATH=src python3 -m unittest discover -s tests
```

From the project root:

```bash
PYTHONPATH=sdk/python/src python3 -m unittest discover -s sdk/python/tests
```
