Thanks for helping improve the Tusk CLI!
If you have any questions, feel free to open an issue or email support@usetusk.ai.
- Requirements:
- Go 1.25+
- (Optional) Nix:
nix developto enter a dev shell
- Clone and prepare:
- Private modules:
go env -w GOPRIVATE="github.com/Use-Tusk/*" - Install deps:
make deps - Build:
make build - Run:
go run . --help
- Private modules:
- Common targets:
make build— build the binary (./tusk)make run— build and runmake test— run tests (module root)make test-ci— run tests for all packagesmake deps— download/tidy modulesmake fmt—go fmt .make lint— rungolangci-lintmake build-ci— build with version info (used in CI)
- Logging:
- Use
log.Debugfor debug logs (frominternal/log). - Use
log.ServiceLogorlog.TestLogto display logs in the TUI. - Use
log.UserInfo,log.UserWarn,log.UserError,log.UserSuccessfor styled user-facing output.
- Use
-
Create
.tusk/config.yamlin your service repo (seedocs/drift/configuration.md). -
Ensure
service.start.commandandservice.portare correct. -
Run:
tusk drift run --trace-dir .tusk/traces # or tusk drift run --trace-file path/to/trace.jsonl -
Useful flags:
--concurrency N--enable-service-logs(writes.tusk/logs/...)--filter 'regex'--save-results [--results-dir DIR]
- Keep CLI, SDK, and backend aligned with schema changes.
cmd/— Cobra commands (e.g.,run)internal/api/— protobuf-over-HTTP client for backend (TestRunService)auth/— Auth0 device code flow + token persistenceconfig/— config loader (Koanf)runner/— Executor, Unix socket server, matcher, comparisontui/— interactive test runner (Bubble Tea)utils/— helpers
docs/— architecture and configuration docs
- Keep edits focused and covered by tests where possible.
- Update
docs/drift/architecture.mdand/ordocs/drift/configuration.mdwhen adding flags or config. - Prefer small, reviewable PRs with a clear rationale.
- Use meaningful slog fields (avoid logging sensitive values).
go test ./...
go test -v ./...
go test -cover ./..."command not found" after go install:
- Add
$GOPATH/binto your PATH - Or use
go env GOPATHto find the path
Module issues:
go mod tidy # Clean up dependenciesBuild cache issues:
go clean -cache
go clean -modcacheRuntime issues:
- Port in use: stop any process on
service.port. - Readiness failing: check
service.readiness_check.*or add a health endpoint. - SDK connect failure: version mismatch or missing
TUSK_MOCK_SOCKET.
Set required env vars in your shell if necessary. To avoid potential conflicts with the service's env vars when running tests locally, this CLI doesn't load from .env.
Testing auth to Tusk dev:
TUSK_AUTH0_DOMAINTUSK_AUTH0_CLIENT_ID
By default, if there's a .tusk/config.yaml we'll use the API url in that for all Tusk Cloud requests. If no .tusk/config.yaml is found, we'll use the default API url (prod API url). You can override this by setting TUSK_API_URL in your shell.
Analytics can be disabled by setting is_tusk_developer to true in the config file (e.g. Users/name/Library/Application Support/tusk/cli.json).
Releases are automated using GoReleaser via GitHub Actions.
Use the release script to create and push a new version tag:
# Patch release (v1.0.0 → v1.0.1)
./scripts/release.sh patch
# Minor release (v1.0.0 → v1.1.0)
./scripts/release.sh minorThe script runs preflight checks, calculates the next version, and prompts for confirmation before tagging.
Once the tag is pushed, GitHub Actions will automatically:
- Build binaries for all supported platforms
- Create archives with README and LICENSE
- Generate checksums
- Create a GitHub release with changelog
- Upload all artifacts
- Update the latest version manifest on cli.usetusk.ai.
The release workflow builds for:
- Linux: amd64, arm64
- macOS (darwin): amd64, arm64
- Windows: amd64, arm64
All binaries include embedded version information:
internal/version.Version— git taginternal/version.BuildTime— build timestampinternal/version.GitCommit— git commit hash
For local testing or manual builds:
# Build for current platform
go build -o tusk
# Cross-compile (example: Linux)
GOOS=linux GOARCH=amd64 go build -o tusk-linux
# With version info (mimics CI builds)
VERSION=v1.2.3
BUILD_TIME=$(date -u '+%Y-%m-%d %H:%M:%S UTC')
GIT_COMMIT=$(git rev-parse HEAD)
go build \
-ldflags "-X github.com/Use-Tusk/tusk-cli/internal/version.Version=${VERSION} \
-X github.com/Use-Tusk/tusk-cli/internal/version.BuildTime=${BUILD_TIME} \
-X github.com/Use-Tusk/tusk-cli/internal/version.GitCommit=${GIT_COMMIT}" \
-o tuskTo test the GoReleaser configuration locally:
goreleaser release --snapshot --clean