2025-01-24 13:04:43 -08:00
# Justfile
2025-01-31 11:44:55 -08:00
# list all tasks
default :
@just --list
2025-11-11 00:39:48 +06:00
# Run all style checks and formatting (precommit validation)
check-everything :
@echo "🔧 RUNNING ALL STYLE CHECKS..."
@echo " → Formatting Rust code..."
cargo fmt --all
@echo " → Running clippy linting..."
2026-02-06 20:10:24 -08:00
cargo clippy --all-targets -- -D warnings
2025-11-11 00:39:48 +06:00
@echo " → Checking UI code formatting..."
2026-03-11 08:46:05 -04:00
cd ui/desktop && pnpm run lint:check
2025-11-11 00:39:48 +06:00
@echo ""
@echo "✅ All style checks passed!"
2025-01-24 13:04:43 -08:00
# Default release command
2025-01-31 11:44:55 -08:00
release-binary :
2025-01-24 13:04:43 -08:00
@echo "Building release version..."
2026-07-02 10:29:29 +10:00
cargo build --release -p goose-cli --bin goose
2025-01-24 13:04:43 -08:00
@just copy-binary
2026-05-19 14:25:32 +02:00
# Build Windows executable on a Windows host
[ u n i x ]
2025-02-10 15:05:13 -08:00
release-windows :
2026-07-17 08:19:31 +10:00
@echo "just release-windows requires a Windows host because Goose Windows releases build the MSVC target. Use .github/workflows/bundle-windows.yml for CI builds."
2026-05-19 14:25:32 +02:00
@exit 1
[ w i n d o w s ]
release-windows :
2026-07-02 10:29:29 +10:00
@powershell.exe -NoProfile -ExecutionPolicy Bypass -Command 'rustup target add x86_64-pc-windows-msvc; if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }; cargo build --release --target x86_64-pc-windows-msvc -p goose-cli --bin goose; if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }; Write-Host "Windows executable created at ./target/x86_64-pc-windows-msvc/release/goose.exe"'
2025-02-10 15:05:13 -08:00
2025-03-04 08:12:14 +11:00
# Build for Intel Mac
release-intel :
@echo "Building release version for Intel Mac..."
cargo build --release --target x86_64-apple-darwin
@just copy-binary-intel
2025-02-13 15:00:37 -05:00
copy-binary BUILD_MODE="release" :
2026-07-02 10:29:29 +10:00
@rm -f ./ui/desktop/src/bin/goosed
2025-06-20 16:19:58 -07:00
@if [ -f ./target/{ { BUILD_MODE} } /goose ] ; then \
echo "Copying goose CLI binary from target/{{BUILD_MODE}}..." ; \
2026-06-23 22:19:43 +10:00
rm -f ./ui/desktop/src/bin/goose; \
2025-06-20 16:19:58 -07:00
cp -p ./target/{ { BUILD_MODE} } /goose ./ui/desktop/src/bin/; \
else \
2025-09-26 23:44:38 -05:00
echo "goose CLI binary not found in target/{{BUILD_MODE}}" ; \
2025-06-20 16:19:58 -07:00
exit 1; \
fi
2025-01-27 12:36:12 -05:00
2025-03-04 08:12:14 +11:00
# Copy binary command for Intel build
copy-binary-intel :
2026-07-02 10:29:29 +10:00
@rm -f ./ui/desktop/src/bin/goosed
2025-06-20 16:19:58 -07:00
@if [ -f ./target/x86_64-apple-darwin/release/goose ] ; then \
echo "Copying Intel goose CLI binary to ui/desktop/src/bin..." ; \
2026-06-23 22:19:43 +10:00
rm -f ./ui/desktop/src/bin/goose; \
2025-06-20 16:19:58 -07:00
cp -p ./target/x86_64-apple-darwin/release/goose ./ui/desktop/src/bin/; \
else \
echo "Intel goose CLI binary not found." ; \
exit 1; \
fi
2025-03-04 08:12:14 +11:00
2026-05-19 14:25:32 +02:00
# Copy Windows binary command on a Windows host
[ u n i x ]
2025-02-10 15:05:13 -08:00
copy-binary-windows :
2026-05-19 14:25:32 +02:00
@echo "just copy-binary-windows requires a Windows host because it copies the MSVC build output."
@exit 1
[ w i n d o w s ]
copy-binary-windows :
2026-07-02 10:29:29 +10:00
@powershell.exe -NoProfile -ExecutionPolicy Bypass -Command 'if (Test-Path ./target/x86_64-pc-windows-msvc/release/goose.exe) { \
2026-05-19 14:25:32 +02:00
Write-Host "Copying Windows binary to ui/desktop/src/bin..."; \
New-Item -ItemType Directory -Force "./ui/desktop/src/bin" | Out-Null; \
2026-07-02 10:29:29 +10:00
Remove-Item -Path "./ui/desktop/src/bin/goosed.exe" -Force -ErrorAction SilentlyContinue; \
Copy-Item -Path "./target/x86_64-pc-windows-msvc/release/goose.exe" -Destination "./ui/desktop/src/bin/" -Force; \
2025-02-10 15:05:13 -08:00
} else { \
2026-05-19 14:25:32 +02:00
Write-Host "Windows binary not found." -ForegroundColor Red; \
2025-02-10 15:05:13 -08:00
exit 1; \
2026-05-19 14:25:32 +02:00
}'
2025-02-10 15:05:13 -08:00
2025-01-24 13:04:43 -08:00
# Run UI with latest
run-ui :
2025-01-31 11:44:55 -08:00
@just release-binary
2025-01-24 13:04:43 -08:00
@echo "Running UI..."
2026-03-11 08:46:05 -04:00
cd ui/desktop && pnpm install && pnpm run start-gui
2025-01-27 12:36:12 -05:00
2025-10-06 20:59:26 -04:00
run-ui-playwright :
#!/usr/bin/env sh
just release-binary
echo "Running UI with Playwright debugging..."
RUN_DIR = " $HOME /goose-runs/ $( date +%Y%m%d-%H%M%S) "
mkdir -p " $RUN_DIR "
echo " Using isolated directory: $RUN_DIR "
2026-03-11 08:46:05 -04:00
cd ui/desktop && ENABLE_PLAYWRIGHT = true GOOSE_PATH_ROOT = " $RUN_DIR " pnpm run start-gui
2025-10-06 20:59:26 -04:00
2025-05-07 23:44:52 +10:00
run-ui-only :
@echo "Running UI..."
2026-03-11 08:46:05 -04:00
cd ui/desktop && pnpm install && pnpm run start-gui
2025-05-07 23:44:52 +10:00
2026-04-16 15:51:23 +10:00
debug-ui :
2026-07-02 10:29:29 +10:00
@echo "🚀 Starting goose frontend in external ACP backend mode"
2025-10-21 18:00:21 -04:00
cd ui/desktop && \
export GOOSE_EXTERNAL_BACKEND = true && \
2026-03-10 16:27:37 +01:00
export GOOSE_SERVER__SECRET_KEY = " ${ GOOSE_SERVER__SECRET_KEY :- test } " && \
2026-03-11 08:46:05 -04:00
pnpm install && \
2026-04-16 15:51:23 +10:00
pnpm run start-gui
2025-05-07 23:44:52 +10:00
2025-08-02 04:32:18 +10:00
# Run UI with main process debugging enabled
# To debug main process:
# 1. Run: just debug-ui-main-process
# 2. Open Chrome → chrome://inspect
# 3. Click "Open dedicated DevTools for Node"
# 4. If not auto-detected, click "Configure" and add: localhost:9229
debug-ui-main-process :
2025-09-26 23:44:38 -05:00
@echo "🔍 Starting goose UI with main process debugging enabled"
2025-08-02 04:32:18 +10:00
@just release-binary
cd ui/desktop && \
2026-03-11 08:46:05 -04:00
pnpm install && \
pnpm run start-gui-debug
2025-08-02 04:32:18 +10:00
2026-02-10 23:32:20 +01:00
# Package the desktop app locally for testing (macOS)
# Applies ad-hoc code signing with entitlements (needed for mic access, etc.)
package-ui :
@just release-binary
@echo "Packaging desktop app..."
2026-03-11 08:46:05 -04:00
cd ui/desktop && pnpm install && pnpm run package
2026-02-10 23:32:20 +01:00
@echo "Signing with entitlements..."
codesign --force --deep --sign - --entitlements ui/desktop/entitlements.plist ui/desktop/out/Goose-darwin-arm64/Goose.app
@echo "Done! Launch with: open ui/desktop/out/Goose-darwin-arm64/Goose.app"
2025-02-10 15:05:13 -08:00
# Run UI with latest (Windows version)
run-ui-windows :
@just release-windows
@powershell.exe -Command "Write-Host 'Copying Windows binary...'"
@just copy-binary-windows
2026-03-11 08:46:05 -04:00
@powershell.exe -Command "Write-Host 'Running UI...'; Set-Location ui/desktop; pnpm install; pnpm run start-gui"
2025-02-10 15:05:13 -08:00
2025-01-27 12:36:12 -05:00
# Run Docusaurus server for documentation
run-docs :
@echo "Running docs server..."
cd documentation && yarn && yarn start
2025-01-24 13:04:43 -08:00
# Run server
run-server :
2026-07-02 10:29:29 +10:00
@echo "Running external ACP backend..."
2026-07-29 19:54:49 +10:00
GOOSE_SERVER__SECRET_KEY = " ${ GOOSE_SERVER__SECRET_KEY :- test } " cargo run -p goose-cli --bin goose -- serve --platform desktop --enable-scheduler --host 127.0.0.1 --port 3000
2025-07-22 19:39:35 +10:00
2026-04-10 16:30:45 -04:00
# Check if generated ACP schema and TypeScript types are up-to-date
check-acp-schema : generate -acp -types
#!/usr/bin/env bash
set -e
echo "🔍 Checking ACP schema and generated types are up-to-date..."
2026-04-21 16:26:49 -04:00
if ! git diff --exit-code crates/goose/acp-schema.json crates/goose/acp-meta.json ui/sdk/src/generated/; then
2026-04-10 16:30:45 -04:00
echo ""
echo "❌ ACP generated files are out of date!"
echo ""
echo "Run 'just generate-acp-types' locally, then commit the changes."
exit 1
fi
echo "✅ ACP schema and generated types are up-to-date"
# Generate ACP JSON schema from Rust types
generate-acp-schema :
@echo "Generating ACP schema..."
2026-05-26 18:09:03 +02:00
cd crates/goose && cargo run --features code-mode,local-inference,aws-providers,telemetry,otel,rustls-tls,system-keyring --bin generate-acp-schema
2026-04-21 16:26:49 -04:00
@echo "ACP schema generated: crates/goose/acp-schema.json, crates/goose/acp-meta.json"
2026-04-10 16:30:45 -04:00
# Generate ACP TypeScript types from JSON schema (requires generate-acp-schema first)
generate-acp-types : generate -acp -schema
@echo "Generating ACP TypeScript types..."
2026-04-15 13:00:12 -04:00
cd ui/sdk && npx tsx generate-schema.ts
@echo "ACP TypeScript types generated in ui/sdk/src/generated/"
2026-04-10 16:30:45 -04:00
2026-04-15 13:00:12 -04:00
# Build SDK TypeScript package (schema + types + compile)
build-sdk : generate -acp -types
2026-04-10 16:30:45 -04:00
@echo "Compiling ACP TypeScript..."
2026-04-15 13:00:12 -04:00
cd ui/sdk && pnpm run build:ts
2026-04-10 16:30:45 -04:00
@echo "ACP package built."
2026-02-10 12:30:12 -03:00
# Generate manpages for the CLI
generate-manpages :
@echo "Generating manpages..."
cargo run -p goose-cli --bin generate_manpages
@echo "Manpages generated at target/man/"
2025-06-18 16:08:43 -07:00
# make GUI with latest binary
lint-ui :
2026-03-11 08:46:05 -04:00
cd ui/desktop && pnpm run lint:check
2025-06-18 16:08:43 -07:00
2025-01-24 13:04:43 -08:00
# make GUI with latest binary
make-ui :
2025-01-31 11:44:55 -08:00
@just release-binary
2026-03-11 08:46:05 -04:00
cd ui/desktop && pnpm run bundle:default
2025-01-24 13:04:43 -08:00
2026-05-19 14:25:32 +02:00
# make GUI with latest Windows binary on a Windows host
[ u n i x ]
make-ui-windows :
2026-07-17 08:19:31 +10:00
@echo "just make-ui-windows requires a Windows host because Goose Windows releases build the MSVC target. Use .github/workflows/bundle-windows.yml for CI builds."
2026-05-19 14:25:32 +02:00
@exit 1
[ w i n d o w s ]
2025-02-10 15:05:13 -08:00
make-ui-windows :
@just release-windows
2026-05-19 14:25:32 +02:00
@just copy-binary-windows
@powershell.exe -NoProfile -ExecutionPolicy Bypass -Command 'Set-Location ui/desktop; $env:ELECTRON_PLATFORM="win32"; node scripts/prepare-platform-binaries.js; if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }; pnpm run make --platform=win32 --arch=x64; if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }; Write-Host "Windows package build complete!"'
2025-02-10 15:05:13 -08:00
2025-03-04 08:12:14 +11:00
# make GUI with latest binary
make-ui-intel :
@just release-intel
2026-03-11 08:46:05 -04:00
cd ui/desktop && pnpm run bundle:intel
2025-03-04 08:12:14 +11:00
2025-06-20 16:19:58 -07:00
2025-01-31 11:44:55 -08:00
2025-02-13 15:00:37 -05:00
# Run UI with debug build
run-dev :
@echo "Building development version..."
cargo build
@just copy-binary debug
@echo "Running UI..."
2026-03-11 08:46:05 -04:00
cd ui/desktop && pnpm run start-gui
2025-02-13 15:00:37 -05:00
# Install all dependencies (run once after fresh clone)
install-deps :
2026-03-11 08:46:05 -04:00
cd ui/desktop && pnpm install
2025-02-13 15:00:37 -05:00
cd documentation && yarn
2025-07-16 17:06:20 -04:00
ensure-release-branch :
2025-01-31 11:44:55 -08:00
#!/usr/bin/env bash
branch = $( git rev-parse --abbrev-ref HEAD) ; \
2025-07-16 17:06:20 -04:00
if [ [ ! " $branch " = = release/* ] ] ; then \
echo " Error: You are not on a release branch (current: $branch ) " ; \
2025-01-31 11:44:55 -08:00
exit 1; \
fi
2025-02-02 16:05:38 -08:00
# check that main is up to date with upstream main
git fetch
# @{u} refers to upstream branch of current branch
if [ " $( git rev-parse HEAD) " != " $( git rev-parse @{ u} ) " ] ; then \
2025-07-16 17:06:20 -04:00
echo "Error: Your branch is not up to date with the upstream branch" ; \
2025-02-02 16:05:38 -08:00
echo " ensure your branch is up to date (git pull)" ; \
exit 1; \
fi
2025-01-31 11:44:55 -08:00
# validate the version is semver, and not the current version
validate version :
#!/usr/bin/env bash
if [ [ ! "{{ version }}" = ~ ^[ 0-9] +\. [ 0-9] +\. [ 0-9] +( -.*) ?$ ] ] ; then
echo "[error]: invalid version '{{ version }}'."
echo " expected: semver format major.minor.patch or major.minor.patch-<suffix>"
exit 1
fi
current_version = $( just get-tag-version)
if [ [ "{{ version }}" = = " $current_version " ] ] ; then
echo " [error]: current_version ' $current_version ' is the same as target version '{{ version }}' "
echo " expected: new version in semver format"
exit 1
fi
2025-11-05 06:54:42 -05:00
get-next-minor-version :
@python -c "import sys; v=sys.argv[1].split('.'); print(f'{v[0]}.{int(v[1])+1}.0')" $( just get-tag-version)
get-next-patch-version :
@python -c "import sys; v=sys.argv[1].split('.'); print(f'{v[0]}.{v[1]}.{int(v[2])+1}')" $( just get-tag-version)
2026-03-23 09:30:44 -04:00
# derive the prior release tag from a version
# patch bump (e.g. 1.25.1): prior is v1.25.0 (deterministic)
# minor bump (e.g. 1.26.0): prior is highest v1.25.* GitHub release
get-prior-version version :
#!/usr/bin/env bash
IFS = '.' read -r major minor patch <<< "{{ version }}"
if [ [ " $patch " -gt 0 ] ] ; then
echo " v ${ major } . ${ minor } . $(( patch - 1 )) "
elif [ [ " $minor " -gt 0 ] ] ; then
prev_minor = $(( minor - 1 ))
prefix = " v ${ major } . ${ prev_minor } . "
best = $( gh release list --limit 100 --exclude-drafts --exclude-pre-releases \
--json tagName --jq " [.[] | select(.tagName | startswith(\" ${ prefix } \"))][0].tagName " )
if [ [ -n " $best " && " $best " != "null" ] ] ; then
echo " $best "
fi
fi
2025-01-31 11:44:55 -08:00
2026-03-23 09:30:44 -04:00
# update version numbers in all manifests
bump-version version :
@just validate { { version } } || exit 1
2025-01-31 11:44:55 -08:00
@uvx --from= toml-cli toml set --toml-path= Cargo.toml "workspace.package.version" { { version } }
2026-03-24 09:29:49 -04:00
@cd ui/desktop && npm pkg set "version={{ version }}"
2026-03-23 09:30:44 -04:00
# update Cargo.lock after bumping versions in Cargo.toml
2025-03-06 12:53:03 -08:00
@cargo update --workspace
2026-03-23 09:30:44 -04:00
# rebuild canonical model registry and mapping report from models.dev
build-canonical-models :
2025-12-18 11:44:01 -05:00
@cargo run --bin build_canonical_models
2026-03-23 09:30:44 -04:00
# bump version, rebuild canonical models, and commit
prepare-release version :
@just bump-version { { version } }
@just build-canonical-models
2025-12-18 11:44:01 -05:00
@git add \
Cargo.toml \
Cargo.lock \
ui/desktop/package.json \
2026-03-24 10:15:03 -04:00
ui/pnpm-lock.yaml \
2026-07-02 13:05:16 +02:00
crates/goose-provider-types/src/canonical/data/canonical_models.json \
crates/goose-provider-types/src/canonical/data/provider_metadata.json
2025-01-31 11:44:55 -08:00
@git commit --message "chore(release): release version {{ version }}"
# extract version from Cargo.toml
get-tag-version :
@uvx --from= toml-cli toml get --toml-path= Cargo.toml "workspace.package.version"
2025-07-16 17:06:20 -04:00
# create the git tag from Cargo.toml, checking we're on a release branch
tag : ensure -release -branch
2025-02-02 16:05:38 -08:00
git tag v$( just get-tag-version)
2025-01-31 11:44:55 -08:00
# create tag and push to origin (use this when release branch is merged to main)
tag-push : tag
# this will kick of ci for release
2025-02-02 16:05:38 -08:00
git push origin tag v$( just get-tag-version)
2025-01-31 11:44:55 -08:00
# generate release notes from git commits
2025-07-16 17:06:20 -04:00
release-notes old :
2025-01-31 11:44:55 -08:00
#!/usr/bin/env bash
2025-07-16 17:06:20 -04:00
git log --pretty= format:"- %s" { { old } } ..v$( just get-tag-version)
2025-03-26 14:25:07 -04:00
2026-01-23 17:44:35 -08:00
### s = file separator based on OS
2025-03-26 14:25:07 -04:00
s := if os( ) = = "windows" { "\\" } else { "/" }
2026-05-07 09:12:18 +02:00
linux_vulkan_features := if os( ) = = "linux" { "--features vulkan" } else { "" }
2025-03-26 14:25:07 -04:00
### testing/debugging
os :
echo "{{os()}}"
echo "{{s}}"
# Make just work on Window
set windows-shell : = ["powershell .exe ", "-NoLogo ", "-Command "]
### Build the core code
### profile = --release or "" for debug
### allparam = OR/AND/ANY/NONE --workspace --all-features --all-targets
2025-07-22 19:39:35 +10:00
win-bld profile allparam :
2025-03-26 14:25:07 -04:00
cargo build { { profile} } { { allparam} }
### Build just debug
2025-07-22 19:39:35 +10:00
win-bld-dbg :
2025-03-26 14:25:07 -04:00
just win-bld " " " "
### Build debug and test, examples,...
2025-07-22 19:39:35 +10:00
win-bld-dbg-all :
2025-03-26 14:25:07 -04:00
just win-bld " " "--workspace --all-targets --all-features"
### Build just release
win-bld-rls :
just win-bld "--release" " "
### Build release and test, examples, ...
win-bld-rls-all :
just win-bld "--release" "--workspace --all-targets --all-features"
2026-03-11 08:46:05 -04:00
### Install pnpm stuff
2025-03-26 14:25:07 -04:00
win-app-deps :
2026-03-11 08:46:05 -04:00
cd ui{ { s} } desktop ; pnpm install
2025-03-26 14:25:07 -04:00
### Windows copy {release|debug} files to ui\desktop\src\bin
2026-01-23 17:44:35 -08:00
### s = os dependent file separator
2025-03-26 14:25:07 -04:00
### profile = release or debug
win-copy-win profile :
copy target{ { s} } { { profile} } { { s} } *.exe ui{ { s} } desktop{ { s} } src{ { s} } bin
copy target{ { s} } { { profile} } { { s} } *.dll ui{ { s} } desktop{ { s} } src{ { s} } bin
2026-07-02 10:29:29 +10:00
if exist ui{ { s} } desktop{ { s} } src{ { s} } bin{ { s} } goosed.exe del /f /q ui{ { s} } desktop{ { s} } src{ { s} } bin{ { s} } goosed.exe
2025-03-26 14:25:07 -04:00
### "Other" copy {release|debug} files to ui/desktop/src/bin
2026-01-23 17:44:35 -08:00
### s = os dependent file separator
2025-03-26 14:25:07 -04:00
### profile = release or debug
win-copy-oth profile :
find target{ { s} } { { profile} } { { s} } -maxdepth 1 -type f -executable -print -exec cp { } ui{ { s} } desktop{ { s} } src{ { s} } bin \;
### copy files depending on OS
### profile = release or debug
win-app-copy profile="release" :
just win-copy-{ { if os( ) = = "windows" { "win" } else { "oth" } } } { { profile} }
2026-03-11 08:46:05 -04:00
### Only copy binaries, pnpm install, start-gui
2025-03-26 14:25:07 -04:00
### profile = release or debug
2026-01-23 17:44:35 -08:00
### s = os dependent file separator
2025-03-26 14:25:07 -04:00
win-app-run profile :
just win-app-copy { { profile} }
just win-app-deps
2026-03-11 08:46:05 -04:00
cd ui{ { s} } desktop ; pnpm run start-gui
2025-03-26 14:25:07 -04:00
### Only run debug desktop, no build
win-run-dbg :
just win-app-run "debug"
### Only run release desktop, nu build
win-run-rls :
just win-app-run "release"
### Build and run debug desktop. tot = cli and desktop
### allparam = nothing or -all passed on command line
### -all = build with --workspace --all-targets --all-features
win-total-dbg *allparam :
just win-bld-dbg{ { allparam} }
just win-run-dbg
### Build and run release desktop
### allparam = nothing or -all passed on command line
### -all = build with --workspace --all-targets --all-features
win-total-rls *allparam :
just win-bld-rls{ { allparam} }
just win-run-rls
2025-05-20 07:08:54 -07:00
2025-08-12 14:03:49 -04:00
build-test-tools :
cargo build -p goose-test
record-mcp-tests : build -test -tools
GOOSE_RECORD_MCP = 1 cargo test --package goose --test mcp_integration_test
2025-10-06 20:59:26 -04:00
git add crates/goose/tests/mcp_replays/