Metadata-Version: 2.4
Name: boat_sdk
Version: 1.0.1
Summary: Boat Public API v1
Home-page: https://docs.boat.dev/sdks
Author: OpenAPI Generator community
Author-email: OpenAPI Generator Community <team@openapitools.org>
License-Expression: MIT
Project-URL: Homepage, https://boat.dev
Project-URL: Documentation, https://docs.boat.dev/sdks
Project-URL: Reference, https://docs.boat.dev/api/reference
Keywords: OpenAPI,OpenAPI-Generator,Boat Public API v1
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: urllib3<3.0.0,>=2.1.0
Requires-Dist: python-dateutil>=2.8.2
Requires-Dist: pydantic>=2.11
Requires-Dist: typing-extensions>=4.7.1
Dynamic: author
Dynamic: home-page
Dynamic: license-file

# boat-sdk

Use Boat from your application code.

## Install

```bash
pip install boat-sdk
```

## Links

- SDK docs: https://docs.boat.dev/sdks
- API reference: https://docs.boat.dev/api/reference
- Dashboard: https://boat.dev/dashboard
- API keys: https://boat.dev/dashboard?tab=api-keys

## Flow

1. Create an API key in the Boat dashboard.
2. Create or resume a sandbox.
3. Prompt the sandbox.
4. Read events until the work is done.
5. Open desktop access when you need browser or GUI visibility.
6. Stop, resume, fork, or delete the sandbox according to your retention policy.

## Notes

- Put cleanup in `finally`: stop/archive or delete sandboxes you create for tests.
- Treat API key secrets, Boat secrets, SSH keys, and desktop stream URLs as sensitive.
- `updateSecrets` / `update_secrets` replaces the entire secret setup. Read the current setup first and send every env var and secret file that should remain.
- `rotateApiKey` / `rotate_api_key` rotates the raw secret in place. Store the returned secret immediately; it is shown once.
- Repository selection is idempotent. Selecting an already-selected repository updates its base branch.

## Example

```python
import os
import time

from boat_sdk import ApiClient, Configuration
from boat_sdk.api.boat_api import BoatApi
from boat_sdk.models.create_sandbox_request import CreateSandboxRequest
from boat_sdk.models.prompt_request import PromptRequest
from boat_sdk.models.update_sandbox_request import UpdateSandboxRequest

config = Configuration(
    host=os.getenv("BOAT_BASE_URL", "https://boat.dev/api/v1"),
    access_token=os.environ["BOAT_API_KEY"],
)

sandbox_id = None
with ApiClient(config) as client:
    sandbox = BoatApi(client)

    try:
        created = sandbox.create(CreateSandboxRequest(ttl_seconds=1800))
        sandbox_id = created.sandbox.id

        sandbox.update(sandbox_id, UpdateSandboxRequest(name="sdk-demo"))

        while sandbox.get(sandbox_id).sandbox.state not in {"ready", "idle"}:
            time.sleep(2)

        sandbox.prompt(
            sandbox_id,
            PromptRequest(
                provider="codex",
                prompt="Inspect the repository and summarize the test command.",
            ),
        )

        events = sandbox.events(sandbox_id)
        print(events.events)
    finally:
        if sandbox_id:
            sandbox.stop(sandbox_id)
```

## License

This SDK is MIT licensed. Boat, the Boat API, the Boat CLI, and the sandbox product are proprietary.
