A file for guiding coding agents.
- Build:
zig build- If you're on macOS and don't need to build the macOS app, use
-Demit-macos-app=falseto skip building the app bundle and speed up compilation.
- If you're on macOS and don't need to build the macOS app, use
- Test (Zig):
zig build test- Prefer to run targeted tests with
-Dtest-filterbecause the full test suite is slow to run.
- Prefer to run targeted tests with
- Test filter (Zig):
zig build test -Dtest-filter=<test name> - Formatting (Zig):
zig fmt . - Formatting (Swift):
swiftlint lint --fix - Formatting (other):
prettier -w .
- Shared Zig core:
src/ - macOS app:
macos/ - GTK (Linux and FreeBSD) app:
src/apprt/gtk
- Do not use
xcodebuild - Use
zig buildto build the macOS app and any shared Zig code - Use
zig build runto build and run the macOS app - Run Xcode tests using
zig build test
- Don’t rebase a branch after it’s merged.
- Sync upstream into
upstream-mainvia--ff-only, then mergeupstream-mainintomain. - Avoid force-pushing
main; if needed, push alegacy/...backup ref first.
- Remotes:
origin=sidequery/ghostree(git@github.com:sidequery/ghostree.git)upstream=ghostty-org/ghostty(https://github.com/ghostty-org/ghostty.git) - Branch intent:
main= Ghostree customizations.upstream-main= mirror ofupstream/main(fast-forward only). - Never merge
upstream/maindirectly intomain; updateupstream-mainfirst, then mergeupstream-mainintomain. - Versioning:
Ghostree release version comes from
build.zig.zon(.version). Keep app target marketing versions aligned inmacos/Ghostty.xcodeproj/project.pbxproj. - Release naming:
use
Ghostree v0.X.Y. - Bundle identifier must stay
dev.sidequery.Ghostree(notcom.mitchellh.ghostty).
CI does NOT work for releases (upstream Namespace Cloud runners). All releases are built locally.
- Bump version in both
build.zig.zon(.version) and allMARKETING_VERSION = 0.X.Yentries inmacos/Ghostty.xcodeproj/project.pbxproj. - Commit the version bump, push to
main. - Tag and push:
git tag v0.X.Y && git push origin v0.X.Y - Create GitHub release:
gh release create v0.X.Y --repo sidequery/ghostree --title "Ghostree v0.X.Y" --notes "..." - Build locally:
bash scripts/release_local.sh(builds, signs, notarizes, staples the DMG). Requiresscripts/.env.release.localwithSIGN_IDENTITYandNOTARYTOOL_PROFILE. - Upload DMG to the GitHub release:
gh release upload v0.X.Y macos/build/ReleaseLocal/Ghostree.dmg --repo sidequery/ghostree - Get asset ID:
gh api repos/sidequery/ghostree/releases/tags/v0.X.Y --jq '.assets[] | select(.name == "Ghostree.dmg") | .id' - Get sha256:
shasum -a 256 macos/build/ReleaseLocal/Ghostree.dmg | awk '{print $1}' - Update homebrew cask at
../homebrew-tap-sidequery/Casks/ghostree.rb: setversion,sha256, andasset_idto the new values. - Commit and push the homebrew tap repo.
The release-tag workflow will queue forever on upstream's runners. Cancel them:
gh run cancel <run_id> --repo sidequery/ghostree
- Never create an issue.
- NEVER EVER EVER EVER EVER EVER open a PR against
ghostty-org/ghostty(upstream), under any circumstances. - If a PR is explicitly requested, it must target
sidequery/ghostreeonly, never upstream. - Before creating any PR, verify:
gh repo set-default --viewmust showsidequery/ghostree. If it does not, rungh repo set-default sidequery/ghostreefirst. - Always use
--repo sidequery/ghostreeflag withgh pr createas a safeguard. - NEVER use
--repo ghostty-org/ghosttyor any upstream reference ingh prcommands.