From d5f2f1f1afb4d5810c17b6fac8224cecb626bbf0 Mon Sep 17 00:00:00 2001 From: JY Tan Date: Fri, 20 Mar 2026 15:35:42 -0700 Subject: [PATCH 1/2] Commit --- .github/workflows/release.yml | 2 +- .goreleaser.yaml | 7 ++--- CONTRIBUTING.md | 2 +- README.md | 18 ++++++------ cmd/short_docs/filter.md | 2 +- install.sh | 10 +++---- internal/agent/markdown_render_test.go | 6 ++-- internal/tui/onboard/config.go | 4 +-- internal/tui/onboard/helpers.go | 2 +- internal/tui/onboard/view.go | 4 +-- internal/version/update.go | 15 ++++++---- internal/version/update_test.go | 40 ++++++++++++++++++++++++++ scripts/release.sh | 2 +- 13 files changed, 79 insertions(+), 35 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d13ffce..03b2556 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -87,7 +87,7 @@ jobs: { "version": "${{ github.ref_name }}", "published_at": "$(date -u +%Y-%m-%dT%H:%M:%SZ)", - "url": "https://github.com/Use-Tusk/tusk-drift-cli/releases/tag/${{ github.ref_name }}" + "url": "https://github.com/${{ github.repository }}/releases/tag/${{ github.ref_name }}" } EOF diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 3d78c58..fa248b9 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -1,5 +1,7 @@ version: 2 +project_name: tusk-cli + before: hooks: - go mod tidy @@ -82,9 +84,6 @@ changelog: order: 9999 release: - github: - owner: Use-Tusk - name: tusk-drift-cli draft: false prerelease: auto @@ -95,7 +94,7 @@ brews: name: homebrew-tap token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}" directory: Formula - homepage: https://github.com/Use-Tusk/tusk-drift-cli + homepage: https://github.com/Use-Tusk/tusk-cli description: "CLI for recording and replaying API traffic tests with Tusk Drift" license: Apache-2.0 commit_author: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 310b3a4..3af2518 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -146,7 +146,7 @@ Once the tag is pushed, GitHub Actions will automatically: - Generate checksums - Create a GitHub release with changelog - Upload all artifacts -- Update the latest version manifest on [GitHub Pages](https://use-tusk.github.io/tusk-drift-cli/). +- Update the latest version manifest on [cli.usetusk.ai](https://cli.usetusk.ai/latest.json). #### Supported platforms diff --git a/README.md b/README.md index cbe2702..5b75371 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,12 @@
-![GitHub Release](https://img.shields.io/github/v/release/Use-Tusk/tusk-drift-cli) -[![Build and test](https://github.com/Use-Tusk/tusk-drift-cli/actions/workflows/main.yml/badge.svg?branch=main)](https://github.com/Use-Tusk/tusk-drift-cli/actions/workflows/main.yml) +![GitHub Release](https://img.shields.io/github/v/release/Use-Tusk/tusk-cli) +[![Build and test](https://github.com/Use-Tusk/tusk-cli/actions/workflows/main.yml/badge.svg?branch=main)](https://github.com/Use-Tusk/tusk-cli/actions/workflows/main.yml) [![OpenSSF Best Practices](https://www.bestpractices.dev/projects/11340/badge)](https://www.bestpractices.dev/projects/11340) -[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/Use-Tusk/tusk-drift-cli/badge)](https://securityscorecards.dev/viewer/?uri=github.com/Use-Tusk/tusk-drift-cli) +[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/Use-Tusk/tusk-cli/badge)](https://securityscorecards.dev/viewer/?uri=github.com/Use-Tusk/tusk-cli)
-[![Go Report Card](https://goreportcard.com/badge/github.com/Use-Tusk/tusk-drift-cli)](https://goreportcard.com/report/github.com/Use-Tusk/tusk-drift-cli) +[![Go Report Card](https://goreportcard.com/badge/github.com/Use-Tusk/tusk-cli)](https://goreportcard.com/report/github.com/Use-Tusk/tusk-cli) [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![X URL](https://img.shields.io/twitter/url?url=https%3A%2F%2Fx.com%2Fusetusk&style=flat&logo=x&label=Tusk&color=BF40BF)](https://x.com/usetusk) [![Slack URL](https://img.shields.io/badge/slack-badge?style=flat&logo=slack&label=Tusk&color=BF40BF)](https://join.slack.com/t/tusk-community/shared_invite/zt-3fve1s7ie-NAAUn~UpHsf1m_2tdoGjsQ) @@ -88,9 +88,9 @@ We recommend using [WSL](https://learn.microsoft.com/en-us/windows/wsl/install)
Installation steps -Download the latest release from [GitHub Releases](https://github.com/Use-Tusk/tusk-drift-cli/releases/latest): +Download the latest release from [GitHub Releases](https://github.com/Use-Tusk/tusk-cli/releases/latest): -1. Download `tusk-drift-cli_*_Windows_x86_64.zip` (or `arm64` for ARM-based Windows) +1. Download `tusk-cli_*_Windows_x86_64.zip` (or `arm64` for ARM-based Windows) 2. Extract the ZIP file 3. Move `tusk.exe` to a directory in your PATH (e.g., `C:\tools\`), or add the extracted directory to your PATH: @@ -118,14 +118,14 @@ Note: Windows requires additional configuration for running tests. See [Windows ### Manual Download -Download pre-built binaries from [GitHub Releases](https://github.com/Use-Tusk/tusk-drift-cli/releases/latest). +Download pre-built binaries from [GitHub Releases](https://github.com/Use-Tusk/tusk-cli/releases/latest). ### Build from source ```bash # Go 1.25+ -git clone https://github.com/Use-Tusk/tusk-drift-cli.git -cd tusk-drift-cli +git clone https://github.com/Use-Tusk/tusk-cli.git +cd tusk-cli make deps make build diff --git a/cmd/short_docs/filter.md b/cmd/short_docs/filter.md index c8e3a15..147be25 100644 --- a/cmd/short_docs/filter.md +++ b/cmd/short_docs/filter.md @@ -13,4 +13,4 @@ tusk -f 'method=POST,path=/checkout' tusk -f 'file=2025-09-24.*trace.*\\.jsonl' ``` -See for more details. +See for more details. diff --git a/install.sh b/install.sh index b502f1a..f727e56 100644 --- a/install.sh +++ b/install.sh @@ -2,7 +2,7 @@ set -e # Tusk Drift CLI Installer (Linux/macOS only) -# For Windows, see: https://github.com/Use-Tusk/tusk-drift-cli#install +# For Windows, see: https://github.com/Use-Tusk/tusk-cli#install # Usage (latest): # curl -fsSL https://cli.usetusk.ai/install.sh | sh # Usage (specific version): @@ -10,7 +10,8 @@ set -e # Or via env var: # curl -fsSL https://cli.usetusk.ai/install.sh | TUSK_VERSION=0.10.0 sh -REPO="Use-Tusk/tusk-drift-cli" +REPO="Use-Tusk/tusk-cli" +ARTIFACT_PREFIX="tusk-cli" BINARY_NAME="tusk" OS=$(uname -s | tr '[:upper:]' '[:lower:]') @@ -21,7 +22,7 @@ case "$OS" in darwin*) OS="darwin" ;; mingw*|msys*|cygwin*) echo "Error: This script is for Linux/macOS only." - echo "For Windows installation, see: https://github.com/Use-Tusk/tusk-drift-cli#install" + echo "For Windows installation, see: https://github.com/Use-Tusk/tusk-cli#install" exit 1 ;; *) @@ -47,7 +48,6 @@ if [ -n "$REQUESTED_VERSION" ]; then *) VERSION_TAG="v$REQUESTED_VERSION" ;; esac else - # Try manifest first (fast, no rate limits) VERSION_TAG=$(curl -sL "https://cli.usetusk.ai/latest.txt" 2>/dev/null || echo "") # Fallback to GitHub API if manifest fails @@ -69,7 +69,7 @@ case "$OS" in *) OS_TITLE="$OS" ;; esac -DOWNLOAD_URL="https://github.com/$REPO/releases/download/${VERSION_TAG}/tusk-drift-cli_${VERSION_NUMBER}_${OS_TITLE}_${ARCH}.tar.gz" +DOWNLOAD_URL="https://github.com/$REPO/releases/download/${VERSION_TAG}/${ARTIFACT_PREFIX}_${VERSION_NUMBER}_${OS_TITLE}_${ARCH}.tar.gz" TMP_DIR=$(mktemp -d) cd "$TMP_DIR" diff --git a/internal/agent/markdown_render_test.go b/internal/agent/markdown_render_test.go index a473d3c..27fe3ff 100644 --- a/internal/agent/markdown_render_test.go +++ b/internal/agent/markdown_render_test.go @@ -6,7 +6,7 @@ import ( ) func TestRenderAgentMessage_DoesNotCreateMailtoForGitRemote(t *testing.T) { - input := "Remote: origin (git@github.com:Use-Tusk/tusk-drift-cli.git)" + input := "Remote: origin (git@github.com:Use-Tusk/tusk-cli.git)" out := renderAgentMessage(input, 100) @@ -26,11 +26,11 @@ func TestRenderAgentMessage_DoesNotCreateMailtoForPlainEmail(t *testing.T) { } func TestRenderAgentMessage_FallbackDoesNotLeakSanitizerBackticks(t *testing.T) { - input := "Remote: git@github.com:Use-Tusk/tusk-drift-cli.git | Email: jy@usetusk.ai" + input := "Remote: git@github.com:Use-Tusk/tusk-cli.git | Email: jy@usetusk.ai" out := renderAgentMessage(input, 100) - if strings.Contains(out, "`git@github.com:Use-Tusk/tusk-drift-cli.git`") || + if strings.Contains(out, "`git@github.com:Use-Tusk/tusk-cli.git`") || strings.Contains(out, "`jy@usetusk.ai`") { t.Fatalf("expected fallback/rendered output to not contain sanitizer backticks, got: %q", out) } diff --git a/internal/tui/onboard/config.go b/internal/tui/onboard/config.go index d1846d4..a347f84 100644 --- a/internal/tui/onboard/config.go +++ b/internal/tui/onboard/config.go @@ -149,7 +149,7 @@ func (m *Model) saveConfig() error { data := formatYAMLWithBlankLines(raw) // Prepend header comment with link to documentation - header := []byte("# Tusk Drift configuration\n# For all configuration options, see:\n# https://github.com/Use-Tusk/tusk-drift-cli/blob/main/docs/drift/configuration.md\n\n") + header := []byte("# Tusk Drift configuration\n# For all configuration options, see:\n# https://github.com/Use-Tusk/tusk-cli/blob/main/docs/drift/configuration.md\n\n") data = append(header, data...) if err := os.WriteFile(cfgPath, data, 0o600); err != nil { @@ -160,7 +160,7 @@ func (m *Model) saveConfig() error { if err := m.createDockerComposeOverrideFile(); err != nil { log.UserWarn(fmt.Sprintf("Warning: Could not create docker-compose override file: %v", err)) log.UserWarn("You will need to manually create docker-compose.tusk-override.yml.") - log.UserWarn(fmt.Sprintf("Refer to: %s", styles.LinkStyle.Render("https://github.com/Use-Tusk/tusk-drift-cli/blob/main/docs/drift/configuration.md#docker-support"))) + log.UserWarn(fmt.Sprintf("Refer to: %s", styles.LinkStyle.Render("https://github.com/Use-Tusk/tusk-cli/blob/main/docs/drift/configuration.md#docker-support"))) } } return nil diff --git a/internal/tui/onboard/helpers.go b/internal/tui/onboard/helpers.go index ecfcf0b..a75cdb2 100644 --- a/internal/tui/onboard/helpers.go +++ b/internal/tui/onboard/helpers.go @@ -13,7 +13,7 @@ func getSupportMessage() string { "Help us prioritize and bring Tusk Drift to your service!\n" + "Fill up this form to request support: " + styles.LinkStyle.Render("https://tally.so/r/w456Xo") + "\n\n" + "You may also:\n" + - " • create an issue at " + styles.LinkStyle.Render("https://github.com/Use-Tusk/tusk-drift-cli/issues") + "\n" + + " • create an issue at " + styles.LinkStyle.Render("https://github.com/Use-Tusk/tusk-cli/issues") + "\n" + " • contact " + styles.LinkStyle.Render("support@usetusk.ai") } diff --git a/internal/tui/onboard/view.go b/internal/tui/onboard/view.go index cd47add..b2ec192 100644 --- a/internal/tui/onboard/view.go +++ b/internal/tui/onboard/view.go @@ -135,7 +135,7 @@ func (m *Model) View() string { 2. A docker-compose.tusk-override.yml file has been created for you. Review it and uncomment extra_hosts if you're on Linux. See: %s -`, styles.LinkStyle.Render("https://github.com/Use-Tusk/tusk-drift-cli/blob/main/docs/drift/configuration.md#docker-support")) +`, styles.LinkStyle.Render("https://github.com/Use-Tusk/tusk-cli/blob/main/docs/drift/configuration.md#docker-support")) case dockerTypeFile: next += ` 2. Review the Docker run command in your config. @@ -216,7 +216,7 @@ func (m *Model) confirmIntroText() string { b.WriteString("Some configurations are pre-filled.\n") b.WriteString("You may adjust them in the config file later if necesssary.\n") b.WriteString("Refer to the documentation for more details:\n") - b.WriteString(styles.LinkStyle.Render("https://github.com/Use-Tusk/tusk-drift-cli/blob/main/docs/drift/configuration.md") + "\n\n") + b.WriteString(styles.LinkStyle.Render("https://github.com/Use-Tusk/tusk-cli/blob/main/docs/drift/configuration.md") + "\n\n") return b.String() } diff --git a/internal/version/update.go b/internal/version/update.go index bc11c53..02b3629 100644 --- a/internal/version/update.go +++ b/internal/version/update.go @@ -22,11 +22,16 @@ import ( ) const ( - latestVersionURL = "https://use-tusk.github.io/tusk-drift-cli/latest.json" - releaseURLFormat = "https://github.com/Use-Tusk/tusk-drift-cli/releases/download/%s/tusk-drift-cli_%s_%s_%s.%s" + latestVersionURL = "https://cli.usetusk.ai/latest.json" + releaseURLFormat = "https://github.com/Use-Tusk/tusk-cli/releases/download/%s/tusk-cli_%s_%s_%s.%s" homebrewUpgradeCmd = "brew upgrade use-tusk/tap/tusk" ) +var ( + runtimeGOOS = runtime.GOOS + runtimeGOARCH = runtime.GOARCH +) + // LatestRelease represents the response from the version check endpoint. type LatestRelease struct { Version string `json:"version"` @@ -252,7 +257,7 @@ func getDownloadURL(version string) string { ver := strings.TrimPrefix(version, "v") // Map Go OS names to goreleaser names - osName := runtime.GOOS + osName := runtimeGOOS switch osName { case "darwin": osName = "Darwin" @@ -263,14 +268,14 @@ func getDownloadURL(version string) string { } // Map Go arch names to goreleaser names - arch := runtime.GOARCH + arch := runtimeGOARCH if arch == "amd64" { arch = "x86_64" } // Extension based on OS ext := "tar.gz" - if runtime.GOOS == "windows" { + if runtimeGOOS == "windows" { ext = "zip" } diff --git a/internal/version/update_test.go b/internal/version/update_test.go index 2e64383..c007dda 100644 --- a/internal/version/update_test.go +++ b/internal/version/update_test.go @@ -48,3 +48,43 @@ func TestIsHomebrewPath(t *testing.T) { }) } } + +func TestGetDownloadURLLinuxAMD64(t *testing.T) { + t.Parallel() + + originalGoos := runtimeGOOS + originalGoarch := runtimeGOARCH + runtimeGOOS = "linux" + runtimeGOARCH = "amd64" + defer func() { + runtimeGOOS = originalGoos + runtimeGOARCH = originalGoarch + }() + + got := getDownloadURL("v1.2.3") + want := "https://github.com/Use-Tusk/tusk-cli/releases/download/v1.2.3/tusk-cli_1.2.3_Linux_x86_64.tar.gz" + + if got != want { + t.Fatalf("getDownloadURL() = %q, want %q", got, want) + } +} + +func TestGetDownloadURLDarwinARM64(t *testing.T) { + t.Parallel() + + originalGoos := runtimeGOOS + originalGoarch := runtimeGOARCH + runtimeGOOS = "darwin" + runtimeGOARCH = "arm64" + defer func() { + runtimeGOOS = originalGoos + runtimeGOARCH = originalGoarch + }() + + got := getDownloadURL("v1.2.3") + want := "https://github.com/Use-Tusk/tusk-cli/releases/download/v1.2.3/tusk-cli_1.2.3_Darwin_arm64.tar.gz" + + if got != want { + t.Fatalf("getDownloadURL() = %q, want %q", got, want) + } +} diff --git a/scripts/release.sh b/scripts/release.sh index 1869fbb..5c3f7c9 100644 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -150,4 +150,4 @@ git push origin "$NEW_VERSION" echo "" info "✓ Released $NEW_VERSION" info "GitHub Actions will now build and publish the release." -info "Watch progress at: https://github.com/Use-Tusk/tusk-drift-cli/actions" +info "Watch progress at: https://github.com/Use-Tusk/tusk-cli/actions" From 36f8ad91bad8d5d1a49286c98633e4bd2cfa8b76 Mon Sep 17 00:00:00 2001 From: JY Tan Date: Fri, 20 Mar 2026 16:23:35 -0700 Subject: [PATCH 2/2] Fixes --- README.md | 3 +++ internal/version/update.go | 15 +++++++-------- internal/version/update_test.go | 26 ++++---------------------- 3 files changed, 14 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index 5b75371..9174d55 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,9 @@
+> [!IMPORTANT] +> Previously used `tusk-drift-cli`? This repo has moved to `tusk-cli`, and older installed CLI versions may not auto-update across the rename. Please reinstall using the current install instructions below. + The Tusk CLI provides tools for automated testing workflows. It supports two products: - **[Tusk Drift](docs/drift/)** - Live traffic record/replay as API tests diff --git a/internal/version/update.go b/internal/version/update.go index 02b3629..ca5144e 100644 --- a/internal/version/update.go +++ b/internal/version/update.go @@ -27,11 +27,6 @@ const ( homebrewUpgradeCmd = "brew upgrade use-tusk/tap/tusk" ) -var ( - runtimeGOOS = runtime.GOOS - runtimeGOARCH = runtime.GOARCH -) - // LatestRelease represents the response from the version check endpoint. type LatestRelease struct { Version string `json:"version"` @@ -253,11 +248,15 @@ func isHomebrewPath(execPath string) bool { // getDownloadURL builds the download URL for the current platform. func getDownloadURL(version string) string { + return getDownloadURLForPlatform(version, runtime.GOOS, runtime.GOARCH) +} + +func getDownloadURLForPlatform(version, goos, goarch string) string { // Strip 'v' prefix for the filename (goreleaser uses version without 'v' in filename) ver := strings.TrimPrefix(version, "v") // Map Go OS names to goreleaser names - osName := runtimeGOOS + osName := goos switch osName { case "darwin": osName = "Darwin" @@ -268,14 +267,14 @@ func getDownloadURL(version string) string { } // Map Go arch names to goreleaser names - arch := runtimeGOARCH + arch := goarch if arch == "amd64" { arch = "x86_64" } // Extension based on OS ext := "tar.gz" - if runtimeGOOS == "windows" { + if goos == "windows" { ext = "zip" } diff --git a/internal/version/update_test.go b/internal/version/update_test.go index c007dda..ac8f9f4 100644 --- a/internal/version/update_test.go +++ b/internal/version/update_test.go @@ -52,39 +52,21 @@ func TestIsHomebrewPath(t *testing.T) { func TestGetDownloadURLLinuxAMD64(t *testing.T) { t.Parallel() - originalGoos := runtimeGOOS - originalGoarch := runtimeGOARCH - runtimeGOOS = "linux" - runtimeGOARCH = "amd64" - defer func() { - runtimeGOOS = originalGoos - runtimeGOARCH = originalGoarch - }() - - got := getDownloadURL("v1.2.3") + got := getDownloadURLForPlatform("v1.2.3", "linux", "amd64") want := "https://github.com/Use-Tusk/tusk-cli/releases/download/v1.2.3/tusk-cli_1.2.3_Linux_x86_64.tar.gz" if got != want { - t.Fatalf("getDownloadURL() = %q, want %q", got, want) + t.Fatalf("getDownloadURLForPlatform() = %q, want %q", got, want) } } func TestGetDownloadURLDarwinARM64(t *testing.T) { t.Parallel() - originalGoos := runtimeGOOS - originalGoarch := runtimeGOARCH - runtimeGOOS = "darwin" - runtimeGOARCH = "arm64" - defer func() { - runtimeGOOS = originalGoos - runtimeGOARCH = originalGoarch - }() - - got := getDownloadURL("v1.2.3") + got := getDownloadURLForPlatform("v1.2.3", "darwin", "arm64") want := "https://github.com/Use-Tusk/tusk-cli/releases/download/v1.2.3/tusk-cli_1.2.3_Darwin_arm64.tar.gz" if got != want { - t.Fatalf("getDownloadURL() = %q, want %q", got, want) + t.Fatalf("getDownloadURLForPlatform() = %q, want %q", got, want) } }