charmbracelet/crush · error

unknown platform: %s

Error message

unknown platform: %s

What it means

The logout command determines which provider-specific logout routine to run based on the configured provider string. Only "hyper" and the copilot/github variants are supported; any other provider value falls into the default branch and produces this error. It is an explicit unsupported-value guard, not a transport failure.

Source

Thrown at internal/cmd/logout.go:88

		force, _ := cmd.Flags().GetBool("force")
		if !force {
			fmt.Print(logoutPromptStyle.Render(fmt.Sprintf("Are you sure you want to logout %s? (y/N) ", provider)))
			var response string
			_, err := fmt.Scanln(&response)
			if err != nil || (response != "y" && response != "Y" && response != "yes" && response != "Yes" && response != "YES") {
				fmt.Println(logoutHeaderStyle.Render("Logout cancelled."))
				return nil
			}
		}

		switch provider {
		case "hyper":
			return logoutHyper(c, ws.ID)
		case "copilot", "github", "github-copilot":
			return logoutCopilot(c, ws.ID)
		default:
			return fmt.Errorf("unknown platform: %s", provider)
		}
	},
}

func logoutHyper(c *client.Client, wsID string) error {
	ctx := getLogoutContext()

	if err := cmp.Or(
		c.RemoveConfigField(ctx, wsID, config.ScopeGlobal, "providers.hyper.api_key"),
		c.RemoveConfigField(ctx, wsID, config.ScopeGlobal, "providers.hyper.oauth"),
	); err != nil {
		return err
	}

	fmt.Println(logoutHeaderStyle.Render("Successfully logged out of Hyper."))
	return nil
}

View on GitHub (pinned to 7944b8e522)

Solutions

  1. If you used an API-key provider, remove the key from the config (crush.json / crushrc) or environment variables manually instead of using logout.
  2. Check `crush models` or your config to see which provider is active and whether it supports logout.
  3. Upgrade crush to the latest version in case logout support for your provider was added.
  4. Only use `crush logout` for hyper or copilot/github provider sessions.
Defensive patterns

Strategy: validation

Validate before calling

// Go: verify provider is logout-capable before invoking
switch provider {
case "hyper", "copilot", "github", "github-copilot":
    // ok
default:
    fmt.Println("provider %q has no logout flow; remove its credentials from config manually", provider)
}

Try / catch

if err := runLogout(provider); err != nil {
    if strings.HasPrefix(err.Error(), "unknown platform:") {
        // fall back to manual config cleanup
    }
    return err
}

Prevention

When it happens

Trigger: Running `crush logout` while the workspace config has a provider id other than hyper/copilot/github/github-copilot (e.g. anthropic, openai, gemini, minimax) that has no dedicated logout implementation.

Common situations: User logged in with a standard LLM provider (Anthropic/OpenAI/Gemini) and expects `crush logout` to clear it; typo in provider name in config; provider added in a newer version than the installed CLI supports for logout.

Related errors


AI-assisted analysis of charmbracelet/crush@7944b8e522 (2026-08-29). Data as JSON: /api/errors/9996068425b56ac3. Report an issue: GitHub.