Thanks for looking. Shahi is a phone-shaped view of a running
herdr session — a thin native app over a small server
sidecar. This is the short version; CLAUDE.md is the long, candid one that
governs how the code is meant to grow, and it outranks anything here that
disagrees.
shared/ the wire contract and the end-to-end crypto — both clients import it
server/ Bun sidecar: owns herdr's unix socket, speaks HTTP + WebSocket
mobile/ the Expo app — the product, and where new work goes
plugin/ the herdr plugin: startup hook, actions, the service it installs
relay/ the blind relay: a Cloudflare Worker, one Durable Object per box
web/ the actively maintained responsive React PWA
e2e/ Playwright, against a stub of the server
The native app and web app are actively maintained together. Keep shared user flows aligned; native-only capabilities such as the built-in SSH tunnel remain native. See CLAUDE.md for the supported API contract.
bun install
bun run test # unit, workflow-policy and dependency checks
bun run typecheck # every workspace, incl. the appUse bun run test rather than a hand-written bun test …: it also runs
./.github, and bun skips a dot-directory unless a path names it with the
./, so .github alone silently runs nothing.
The app needs a Mac to build for iOS. See docs/on-a-mac.md and, for the SSH
module, docs/ssh.md.
A few principles from CLAUDE.md, because PRs are reviewed against them:
- Preserve supported contracts. Support the current and previous API generation for the release-policy window, without restoring protocols below API 5 / encrypted transport 2. See releases.
- Simplest thing that fully meets the requirement. No speculative abstraction or configuration.
- Grow in layers — the smallest version that works end to end, then build on a product that already works.
- Comments explain why, especially why not the obvious alternative. A comment that restates the code is worse than none.
- Commit messages are prose — what broke, how it was found, what it cost — not bullet lists of changed files.
- Unit, workflow-policy and dependency checks:
bun run test. - Native component tests:
bun run test:mobile. - Relay:
bun run test:relay. It starts its ownwrangler devon 8787 and fails if the port is taken; setSHAHI_TEST_RELAY_PORTto use another, orSHAHI_TEST_RELAY_EXTERNAL=1to test against a relay you already run on that port. - Browser:
bun run build:web && bun run test:e2e. - Hosted client and offline/update behavior:
bun run build:site && bun run test:hosted && bun run test:pwa. - Native flows, on a Mac with a simulator: the Maestro flows in
.maestro/and the Maestro runs ine2e/native/, which pair the app through the encrypted hosted fixture, and the XCUITest harness inmobile/uitests/. They run locally or by hand only; nothing in CI boots a simulator, and the EAS workflow for.maestro/runs only when started by hand. See local iOS development andmobile/uitests/README.md.
Fixture tests must never send writes to a real user session. Real-server tests
require both a named herdr session and a fresh XDG_CONFIG_HOME without installed
plugins: startup hooks can otherwise redirect the production service. Use
dedicated test workspaces and upload directories, revoke temporary devices, and
stop only the test services afterward. Never log terminal contents. Record real
server checks separately from fixture results and physical-device checks.
New behaviour should come with a test named after the symptom it prevents.
bun run typecheckand the unit tests pass.- No secrets, tokens, or personal data in the diff.
By contributing you agree your contributions are licensed under the repo's
LICENSE.