Skip to main content

Autofix CLI (Standalone Installer)

Use the @sailfish-ai/autofix CLI to enable Sailfish Autofix across your AI coding agents — without needing the desktop app.

Quick Start

npx @sailfish-ai/autofix setup

This command will:

  1. Open your browser to authenticate with Sailfish
  2. Detect which AI coding agents are installed on your machine
  3. Install the Autofix skill and MCP server for each detected agent

Once complete, open any supported agent and run /autofix <issue-id> to investigate and fix issues.

Prerequisites

  • Node.js >= 18.0.0 (download)
  • A Sailfish accountcreate one if you haven't already
  • At least one supported AI coding agent installed

Installation Options

No global install needed — npx runs it directly:

npx @sailfish-ai/autofix setup

Option B: Install globally

npm install -g @sailfish-ai/autofix
sailfish-autofix setup

Option C: From the Sailfish web app

Click "Fix with CLI" on any issue page to get a one-liner with an embedded auth token:

npx @sailfish-ai/autofix setup --token <token>

This skips the browser login step entirely.

Option D: Via Agent Skills

If your tool supports the Agent Skills standard:

npx skills add @sailfish-ai/autofix
note

This installs only the skill. Run npx @sailfish-ai/autofix setup separately to configure authentication and the MCP server.

Selecting specific agents

If you only want to configure certain agents:

npx @sailfish-ai/autofix setup --agents claude-code,cursor

Non-interactive mode

For CI or scripted setups, skip confirmation prompts:

npx @sailfish-ai/autofix setup --token <token> --yes

Supported Agents

AgentSkill LocationMCP Config Location
Claude Code~/.claude/skills/~/.claude.json
Cursor~/.cursor/skills/~/.cursor/mcp.json
Codex (OpenAI)~/.codex/skills/~/.codex/config.toml
GitHub Copilot~/.agents/skills/~/.vscode/mcp.json
OpenCode~/.agents/skills/~/.config/opencode/config.json
Windsurf~/.windsurf/skills/~/.windsurf/mcp.json
Gemini CLI~/.gemini/skills/~/.gemini/settings.json
Goose~/.agents/skills/~/.config/goose/config.yaml
Generic (Agent Skills)~/.agents/skills/Manual MCP setup

All agents also get a copy at ~/.agents/skills/sailfish-autofix/ (cross-client convention).

Using Autofix

After setup, open any configured agent and tell it:

/autofix 12345

Replace 12345 with the Sailfish issue ID. The agent will:

  1. Fetch exception details and stack traces from Sailfish
  2. Gather telemetry — backend logs, frontend logs, network hops, user actions
  3. Map stack traces to your source code
  4. Propose and implement a fix
  5. Create a pull request via your GitHub or Bitbucket integration

Managing Your Installation

Check status

See which agents are configured and whether authentication is valid:

npx @sailfish-ai/autofix status

Diagnose issues

If something isn't working, run the diagnostic tool:

npx @sailfish-ai/autofix doctor

This checks credentials, backend connectivity, and agent installations, and suggests fixes.

Re-authenticate

If your session expires:

npx @sailfish-ai/autofix login

Uninstall

Remove all installed skills, MCP configurations, and credentials:

npx @sailfish-ai/autofix uninstall

To keep your credentials but remove skill and MCP config:

npx @sailfish-ai/autofix uninstall --keep-credentials

Command Reference

setup — All-in-one install

npx @sailfish-ai/autofix setup [options]

Authenticates, detects agents, and installs the skill + MCP server configuration.

OptionDescription
--token <token>Use a pre-authenticated token from the Sailfish web app
--globalInstall skill globally for all projects (default: true)
--agents <list>Comma-separated list of agents to configure (e.g. claude-code,cursor)
-y, --yesSkip confirmation prompts

uninstall — Clean removal

npx @sailfish-ai/autofix uninstall [options]

Removes all installed skills, MCP configurations, and optionally credentials.

OptionDescription
--keep-credentialsKeep authentication credentials (only remove skill + MCP config)
-y, --yesSkip confirmation prompts

login — Authenticate

npx @sailfish-ai/autofix login [options]

Opens your browser to sign in via OAuth. Credentials are stored at ~/.sailfish/credentials.json.

OptionDescription
--token <token>Exchange a short-lived token instead of browser flow

logout — Remove credentials

npx @sailfish-ai/autofix logout

status — Show current state

npx @sailfish-ai/autofix status

Displays authentication status and which agents have the skill and MCP server installed.

doctor — Diagnose issues

npx @sailfish-ai/autofix doctor

Checks credentials, backend connectivity, and agent installations. Suggests fixes for any issues found. If credentials are expired, doctor will attempt to re-authenticate automatically.

serve — Run MCP server

npx @sailfish-ai/autofix serve

Starts the MCP server in STDIO mode. This command is used internally by agent configurations — you don't need to run it manually.

How It Works

The CLI installs two things for each detected agent:

1. Agent Skill

A SKILL.md file following the Agent Skills open standard is placed in the agent's skills directory. This file tells the AI agent how to investigate and fix issues step-by-step using Sailfish telemetry data.

2. MCP Server

A Model Context Protocol server configuration is added to the agent's config file. The MCP server provides the following tools for accessing telemetry:

ToolDescription
autofix_get_issue_exceptionsFetch exception details, stack traces, occurrence counts
autofix_get_backend_logsServer-side logs for a recording session
autofix_get_frontend_logsBrowser console logs
autofix_get_network_request_logsHTTP request/response logs
autofix_get_network_hopsService-to-service call chain (distributed tracing)
autofix_get_print_statementsstdout/print output
autofix_get_user_actionsUser interaction events (clicks, navigation)
autofix_get_frontend_display_dataFrontend display state snapshots
autofix_update_issue_statusReport fix progress back to Sailfish
autofix_create_pull_requestCreate a PR via GitHub/Bitbucket integration
autofix_clone_reposClone company repos locally

Authentication

Credentials are stored at ~/.sailfish/credentials.json with mode 0600 (owner read/write only). The MCP server reads credentials via the SAILFISH_JWT_FILE environment variable, which is set automatically in agent configurations.

Coexistence with the Desktop App

The standalone CLI works alongside the Sailfish desktop app (Veritas). They use compatible credential formats but separate MCP server names:

  • Desktop app registers as sailfishTelemetry / sailfishEnterprise
  • Standalone CLI registers as sailfishAutofix

Both can be installed simultaneously without conflict.

Troubleshooting

"No supported agents detected"

Specify agents manually:

npx @sailfish-ai/autofix setup --agents claude-code

"Credentials expired"

Re-authenticate:

npx @sailfish-ai/autofix login

"Cannot reach backend"

Ensure you can reach https://api.sailfish.ai from your network, then run:

npx @sailfish-ai/autofix doctor