Session Forge (sf): orchestrate remote worktrees and project setup for HAPI-managed sessions.
Project description
Session Forge (sf)
Session Forge orchestrates LLM-assisted development sessions across fleets of machines. It combines SSH automation, git worktrees, and project metadata into a single CLI (sf) that prepares workspaces for tools like HAPI. With a five-minute onboarding flow, you can install the CLI, bootstrap your hosts, sync worktrees, and then hand off sessions to HAPI for mobile control.
Highlights
- Idempotent orchestration – anchors repos on remote hosts, keeps feature branches in sync, and reuses git worktrees safely.
- Multi-host fanout – define hosts once and attach repos to features;
sf syncfans out the same feature branch everywhere. - Project overview – inspect host, repo, and feature mapping to keep fleets aligned.
- HAPI handoff – use SF to prepare worktrees, then run HAPI for mobile session control and approvals.
Project view (feature = workspace)
A feature in Session Forge is a project workspace that can span multiple repositories. sf attach binds repos to a feature, and sf sync lays them out under a shared directory on each host.
host: gpu-01
├─ repo-cache/
│ ├─ core.anchor/
│ └─ web.anchor/
└─ features/
└─ payments/
├─ core/ (worktree, feat/payments)
├─ web/ (worktree, feat/payments)
└─ infra/ (worktree, feat/payments)
That features/<feature> directory is the shared workspace. Start HAPI at a repo worktree or at the feature root if you want a cross‑repo session (or hop between repos in the same directory).
sf hapi start payments core
ssh ubuntu@gpu-01 'cd ~/features/payments && hapi'
Installation
uv tool install session-forge
# or, from source
git clone https://github.com/you/session-forge.git
cd session-forge
uv sync
uv run sf --help
Publishing to PyPI is automated on git tags (see "Release" below).
Need developer tooling? Sync extras during install:
uv sync --extra dev
Five-minute quickstart
# 1. install
uv tool install session-forge
# 2. initialize local state (creates a local host)
sf init
# 3. register a repo (and optional remote host)
sf repo add core git@github.com:org/core.git --base main
# sf host add a100-01 ubuntu@a100-01
# 4. verify host capabilities
sf bootstrap --hosts local
# 5. create a feature, attach repos, sync
sf feature new demo --base main
sf attach demo core
sf sync demo
# 6. launch HAPI for mobile control
sf hapi start demo core # prints SSH command
sf hapi start demo core --execute
# 7. verify worktree paths when needed
sf worktree list demo
CLI reference (MVP)
| Command | Description |
|---|---|
sf init |
Initialize ~/.sf state directory and config |
sf host add <name> <user@host> |
Register an SSH target |
sf repo add <name> <git-url> |
Register a git repo and base branch |
sf feature new <feature> |
Create a feature definition |
sf attach <feature> <repo> --hosts ... |
Attach a repo to a feature on specific hosts (defaults to local) |
sf sync <feature> |
Ensure anchor clone, feature branch, and worktrees exist on each host |
sf worktree list <feature> |
Show worktree paths per host |
sf hapi start <feature> <repo> |
Print SSH command to start HAPI in repo worktree |
sf feature destroy <feature> --yes |
Remove worktrees and delete the feature |
sf bootstrap --hosts ... |
Check git (and optional HAPI) on hosts (defaults to local) |
sf doctor |
Display local state summary |
Development
uv sync --extra dev
uv run pytest
uv run black --check src tests
Makefile recipes delegate to uv (make dev, make lint, make test).
Release
Publish happens automatically when you push a version tag (PyPI trusted publishing):
git tag v0.1.0
git push origin v0.1.0
To publish manually:
uv build
uv publish
HAPI integration
Session Forge focuses on project setup and worktree orchestration; HAPI provides the mobile session UI. After sf sync, start HAPI inside a repo worktree or the shared feature directory (use sf worktree list to locate paths).
License
Apache License 2.0
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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
File details
Details for the file session_forge-0.1.2.tar.gz.
File metadata
- Download URL: session_forge-0.1.2.tar.gz
- Upload date:
- Size: 20.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f2f0fe829aaaa251b5420cc9d4d1f02344d1542e5e3cabadca0a8e78faa27e3
|
|
| MD5 |
413b3923fb6310ec689ddacdc60d5ede
|
|
| BLAKE2b-256 |
363b5a70f7a060f46f737c285f9b56307a2694679a4741f18652d36a62533cc1
|
File details
Details for the file session_forge-0.1.2-py3-none-any.whl.
File metadata
- Download URL: session_forge-0.1.2-py3-none-any.whl
- Upload date:
- Size: 21.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4db75214fca4cb45de2b1b8af5b06f1cba321f841085fcbc3d4e44c66e5bc48a
|
|
| MD5 |
af06c0e43b951fb4fda44d97481136f6
|
|
| BLAKE2b-256 |
7491868c7967ce4ffc7a21155527b63f3e4dc283d06ea082655896873c9f2582
|