Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 3 additions & 4 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
version: 2

project_name: tusk-cli

before:
hooks:
- go mod tidy
Expand Down Expand Up @@ -82,9 +84,6 @@ changelog:
order: 9999

release:
github:
owner: Use-Tusk
name: tusk-drift-cli
draft: false
prerelease: auto

Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,21 @@

<div align="center">

![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)
<br>
[![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)

</div>

> [!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
Expand Down Expand Up @@ -88,9 +91,9 @@ We recommend using [WSL](https://learn.microsoft.com/en-us/windows/wsl/install)

<details>
<summary><b>Installation steps</b></summary>
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:

Expand Down Expand Up @@ -118,14 +121,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

Expand Down
2 changes: 1 addition & 1 deletion cmd/short_docs/filter.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ tusk <list/run> -f 'method=POST,path=/checkout'
tusk <list/run> -f 'file=2025-09-24.*trace.*\\.jsonl'
```

See <https://github.com/Use-Tusk/tusk-drift-cli/blob/main/docs/drift/filter.md> for more details.
See <https://github.com/Use-Tusk/tusk-cli/blob/main/docs/drift/filter.md> for more details.
10 changes: 5 additions & 5 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
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):
# curl -fsSL https://cli.usetusk.ai/install.sh | sh -s -- v0.10.0
# 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:]')
Expand All @@ -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
;;
*)
Expand All @@ -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
Expand All @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions internal/agent/markdown_render_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)
}
Expand Down
4 changes: 2 additions & 2 deletions internal/tui/onboard/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion internal/tui/onboard/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

Expand Down
4 changes: 2 additions & 2 deletions internal/tui/onboard/view.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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()
}

Expand Down
14 changes: 9 additions & 5 deletions internal/version/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ 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"
)

Expand Down Expand Up @@ -248,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 := runtime.GOOS
osName := goos
switch osName {
case "darwin":
osName = "Darwin"
Expand All @@ -263,14 +267,14 @@ func getDownloadURL(version string) string {
}

// Map Go arch names to goreleaser names
arch := runtime.GOARCH
arch := goarch
if arch == "amd64" {
arch = "x86_64"
}

// Extension based on OS
ext := "tar.gz"
if runtime.GOOS == "windows" {
if goos == "windows" {
ext = "zip"
}

Expand Down
22 changes: 22 additions & 0 deletions internal/version/update_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,25 @@ func TestIsHomebrewPath(t *testing.T) {
})
}
}

func TestGetDownloadURLLinuxAMD64(t *testing.T) {
t.Parallel()

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("getDownloadURLForPlatform() = %q, want %q", got, want)
}
}

func TestGetDownloadURLDarwinARM64(t *testing.T) {
t.Parallel()

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("getDownloadURLForPlatform() = %q, want %q", got, want)
}
}
2 changes: 1 addition & 1 deletion scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Loading