- Python 3.11 or newer;
uv0.12 or newer;- Bun 1.3 or newer for Studio;
- Git.
uv sync --all-extras --locked
cd apps/studio && bun install --frozen-lockfileBuild the static frontend once, then start the local application process:
cd apps/studio && bun run build && cd ../..
uv run termkit studio examples/packs/demo-hydraulicsFor frontend iteration, run bun run dev in apps/studio and the Python server
separately. Set TERMKIT_STUDIO_DIST only when testing a non-default static
distribution. Studio binds to loopback unless --allow-remote is explicitly
provided; that override does not add authentication.
uv run ruff check .
uv run mypy src
uv run python scripts/export_schemas.py --check
uv run pytest --cov
cd apps/studio
bun run check
bun run test
bun run build
bun x playwright install chromium # first run only
bun run test:e2e
cd ../..
uv run python scripts/embed_studio_assets.py --check
uv buildPython tests are offline and use tmp_path for workspaces, registries, archives,
imports and runtime indexes. Browser tests must use original fixture data and a
temporary copy of a canonical pack.
TermSpec model changes require:
uv run python scripts/export_schemas.py
uv run python scripts/export_schemas.py --check
git diff -- src/termkit/spec/schemasThen update CHANGELOG.md, compatibility notes, fixtures, and an ADR when
identity, lifecycle or semantic meaning changes.
Workspace persistence changes require a new Alembic revision. Never edit an already released migration to make a current test pass. Test both a fresh database and an upgrade path.
apps/studio is a static React application. It may format view state but must
not duplicate evidence sufficiency, rights, review or release decisions from
the Python application layer. API writes create ChangeSets; no browser code
writes JSONL.
Use TanStack Query for server state, TanStack Table/Virtual for dense data, and Radix primitives for accessible overlays. Preserve keyboard navigation, visible focus, resizable panes and non-card list density. Do not introduce an admin dashboard theme, chat-first surface or decorative AI language.
uv run termkit validate examples/packs/demo-hydraulics
uv run termkit pack build examples/packs/demo-hydraulics --output /tmp/termkit-dist
uv run termkit pack verify /tmp/termkit-dist/*.termpack
uv run termkit runtime compile \
--pack examples/packs/demo-hydraulics \
--output /tmp/termkit-dist/demo.termdb \
--lock-output /tmp/termkit-dist/termkit.lock
uv buildBuild artifacts, .termkit/, downloaded corpora, private source material and
credentials must remain untracked.
src/termkit/studio_assets/ is the one intentional generated exception: it is
the reproducible, source-map-free Studio build shipped inside Python wheels.
After a frontend change, run uv run python scripts/embed_studio_assets.py and
review both the source change and the refreshed asset hashes. CI rebuilds Studio
and rejects stale embedded assets.