Metadata-Version: 2.5
Name: workpaper
Version: 0.1.0
Summary: Cloud computers for AI agents: create, run commands, read and write files, stop, start and fork running computers.
Project-URL: Homepage, https://workpaper.co
Project-URL: Documentation, https://docs.workpaper.co/sdk
License-Expression: MIT
Keywords: agents,ai,claude code,cloud computer,code execution,codex,sandbox,vm
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# workpaper

Cloud computers for AI agents, from Python. Each computer is a real Linux machine with its own kernel, ready in under a second. Stop it and it keeps its disk *and* memory; fork it while it runs. No dependencies.

```bash
pip install workpaper
```

Make an API key once with the CLI (`curl -fsSL https://workpaper.co/install | sh`, then `workpaper auth login`):

```bash
workpaper keys create my-app      # prints wpk_…; set it as WORKPAPER_API_KEY
```

## Quickstart

```python
from workpaper import Workpaper

wp = Workpaper()  # reads WORKPAPER_API_KEY

c = wp.run("my-agent")  # create it, or wake it if it exists
r = c.exec("python3 --version")
print(r.exit_code, r.stdout)

c.write("/home/user/app/main.py", "print('hi')")
c.exec("python3 main.py", cwd="/home/user/app", on_stdout=print)

c.stop()   # disk and memory saved, billing stops
c.start()  # running programs carry on from the same moment
```

## Fork a running computer

```python
base = wp.run("base")
base.exec("git clone https://github.com/you/app && cd app && pip install -r requirements.txt")

# Each copy starts with the files, memory and running programs of `base`.
tries = [base.fork(n) for n in ("try-a", "try-b")]
```

## API

| | |
|---|---|
| `Workpaper(api_key=None, wait_seconds=900, on_wait=None)` | `on_wait(position)` is called while waiting in line when every computer is busy (nothing is charged while waiting) |
| `wp.run(name, size="small", timeout=3600)` | Create or wake. `size`: `"small"` (2 vCPU, 4 GB, 10 GB) or `"large"` (4 vCPU, 8 GB, 20 GB, Docker running) |
| `wp.create(name, ...)` · `wp.find(name)` · `wp.list()` | |
| `c.exec(cmd, cwd=None, env=None, user="user", timeout=None, on_stdout=None, on_stderr=None)` | Runs under bash. Returns `ExecResult(exit_code, stdout, stderr)`; a non-zero exit is a result, not an error |
| `c.read(path)` · `c.read_text(path)` · `c.write(path, data)` | |
| `c.stop()` · `c.start(timeout=3600)` | Stop keeps everything; start resumes it |
| `c.fork(name)` | Copy a running computer into a new one |
| `c.delete()` | |
| `c.name` · `c.state` · `c.cpus` · `c.memory_mb` · `c.stops_at` · `c.fork_of` | |

Errors are `WorkpaperError` with `status` and, when the service is full, `reason == "at_capacity"`.

Every computer comes with Node 24, Python 3.12, uv, git, Claude Code, Codex and a headless browser. Limits and pricing: [docs.workpaper.co](https://docs.workpaper.co).
