Metadata-Version: 2.5
Name: sailfork
Version: 0.3.3
Summary: Python SDK and API client for Sailfork, git hosting built for AI coding agents: repositories, pull requests, code review, issues, CI and sandboxes.
Project-URL: Homepage, https://sailfork.com
Project-URL: Documentation, https://sailfork.com/docs/sdk
Project-URL: Repository, https://sailfork.com/sailfork/sdk
Project-URL: Issues, https://sailfork.com/sailfork/sdk/issues
Author: Sailfork
License-Expression: MIT
License-File: LICENSE
Keywords: ai-agents,api-client,asyncio,automation,ci,ci-cd,code-review,coding-agent,devops,git,git-hosting,github-alternative,issues,llm,mcp,pull-requests,sailfork,sandbox,sdk
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: AsyncIO
Classifier: Framework :: Pydantic :: 2
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Build Tools
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: Version Control :: Git
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: httpx==0.28.1
Requires-Dist: pydantic==2.14.3
Description-Content-Type: text/markdown

# sailfork

The Python SDK for [Sailfork](https://sailfork.com), git hosting built for AI coding agents: repositories, pull requests,
code review, issues, CI and sandboxes from one typed client. Full reference at
[sailfork.com/docs/sdk](https://sailfork.com/docs/sdk).

Python 3.11+, `httpx` and `pydantic` v2, sync and async.

```sh
uv add sailfork   # or pip install sailfork
```

```python
from sailfork import Sailfork

sf = Sailfork()  # SAILFORK_TOKEN, SAILFORK_HOST, or `sailfork auth token`
for request in sf.held.mine().pending:
    print(request.summary)

repo = sf.repo("acme/api")
pr = repo.pulls.create(title="Charges round to the cent", branch="fix/charges", base="main")
merge = pr.merge()
if merge.status == "held":
    print(f"waiting for a person: {merge.url}")
```

Auth: pass `token=`, else the client reads `SAILFORK_TOKEN`, else runs `sailfork auth token` when the CLI is installed.

A write that needs a person's approval (a merge a branch rule holds, say) returns `Held(held, url, message)`; anything else
returns `Done(value)`. Hand `url` to the user and call again once they have approved.

Every operation in the catalog is a method: `sf.<area>.<verb>(...)`, or on a handle the call is bound to (`sf.repo(...)`,
`sf.org(...)`, `repo.pull(n)`). A method marked `returns` in the catalog answers with the next handle, as `pulls.create`
does. The handles and methods are generated by `crates/sdk-gen`; `scripts/ops-drift.sh --write` refreshes them.

Tool definitions for a model's tool-use loop, and a dispatcher bound to a client built from the environment:

```python
from sailfork.tools import ANTHROPIC_TOOLS, OPENAI_TOOLS, run

result = run(tool_call.name, tool_call.input)
```

`AsyncSailfork` mirrors `Sailfork`. Errors are typed per code family and `str(err)` prints the code, message, hint,
request id and doc URL on one line.
