setup

package
v1.40.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 17, 2026 License: Apache-2.0 Imports: 23 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrStandaloneSkip signals the user chose standalone local mode during
	// onboarding instead of connecting a QualityMax account. Callers should
	// switch to standalone mode rather than treating this as a failure.
	ErrStandaloneSkip = errors.New("standalone local mode selected")

	// ErrEmptyAPIKey is returned when the API key prompt ends with no input.
	ErrEmptyAPIKey = errors.New("no API key provided")
)

Functions

func InstallSkills

func InstallSkills(backend string) (*skills.MaterializeResult, error)

InstallSkills materializes the qmax QA skill catalog into the backend's native skills directory (~/.claude/skills or ~/.codex/skills). It is idempotent and refreshes the catalog on every call, so existing users pick up new or updated skills on upgrade.

It is deliberately decoupled from RunOrch's one-time MCP install: the MCP entry is written once (guarded by IsOrchInstalled), but skills must keep syncing on every activation/upgrade — otherwise anyone who already had the MCP installed would never receive the skill catalog.

func InstallSkillsAll

func InstallSkillsAll(term *tui.Terminal)

InstallSkillsAll materializes the catalog into every supported CLI backend and reports each. Used by the `/skills install` command.

func InstallSkillsReport

func InstallSkillsReport(backend string, term *tui.Terminal)

InstallSkillsReport runs InstallSkills and reports the outcome to the terminal. Non-fatal: skills are additive, so a failure is surfaced but does not block backend activation.

func IsOrchInstalled

func IsOrchInstalled(backend string) bool

IsOrchSetupDone returns true if the qmax MCP entry already exists in the CLI's config file. Used to skip the setup banner on subsequent launches.

func LoginInteractive

func LoginInteractive() (*api.AuthConfig, error)

LoginInteractive prompts the user to paste their API key.

func LoginViaBrowser

func LoginViaBrowser() (*api.AuthConfig, error)

LoginViaBrowser performs Railway-style browser login:

  1. POST /api/auth/cli-login → get code + auth URL
  2. Open browser to auth URL
  3. Poll /api/auth/cli-poll until authorized or expired
  4. Exchange the user access token for a registered API token that works with both the REST API and the cloud MCP endpoint

func PrintSkillsStatus

func PrintSkillsStatus(term *tui.Terminal)

PrintSkillsStatus lists the qmax QA skill catalog and shows, per skill, whether it is currently materialized into the Claude Code, Codex, and opencode skills directories. Backs the `/skills` command so the catalog is visible from inside qmax-code, even though the skills themselves run in the CLI backends.

func PromptAgyGoogleLogin

func PromptAgyGoogleLogin(agyBin string)

PromptAgyGoogleLogin offers to launch Antigravity's Google OAuth flow. agy 1.1.x has no `auth login` subcommand: Google sign-in runs when the interactive CLI starts with no cached token. An AI Studio API key is not required. Skipped when stdin is not a TTY, when a file-backed OAuth token is already present, or when this process already offered the prompt.

func PromptChoice

func PromptChoice(prompt string, options []string) int

PromptChoice shows an interactive menu and returns the selected index. On a TTY it renders an arrow-key chooser (↑/↓ or j/k to move, Enter to confirm, digits 1-9 to select directly). When raw mode is unavailable (piped stdin, CI), it falls back to the numeric prompt.

func ReadSecret

func ReadSecret(prompt string) string

ReadSecret reads a line of input with characters hidden (replaced with dots). Shows a masked preview after completion.

func RunInteractive

func RunInteractive() (*api.AuthConfig, int, error)

RunInteractive guides a first-time user through login and project selection. It returns failures to main so the session receipt can be finalized before the process exits.

func RunOrch

func RunOrch(backend string, term *tui.Terminal)

RunOrchSetup runs the one-time integration setup for the chosen backend, printing progress to the terminal.

Types

type ConsentResult

type ConsentResult struct {
	Proceed        bool   // user said yes; false means cancel activation
	PermissionMode string // "standard" | "unattended"
	GlobalInstall  bool   // ok to write into ~/.claude/settings.json or ~/.codex/config.toml
}

ConsentResult is what activateBackend gets back from the consent prompt.

func PromptOrchConsent

func PromptOrchConsent(cfg *api.Config, backend string) ConsentResult

promptOrchConsent shows the autonomy + global-install dialog the first time a CLI backend is activated. If the user already chose persistently (cfg.OrchPermissionMode / cfg.OrchGlobalInstall) we skip the prompt.

Conductor's safety model: the user is the principal. We never sneak privilege escalation behind a backend switch. Mode choices are explicit and persisted.

type InstallResult

type InstallResult struct {
	MCPWritten    bool
	MCPPath       string
	AlreadyHadMCP bool
}

InstallResult describes what autosetup did so the caller can display it.

func InstallAgy

func InstallAgy() (*InstallResult, error)

InstallAgy writes the qmax MCP server into ~/.gemini/config/mcp_config.json so Antigravity CLI picks up qmax tools in ordinary `agy` sessions as well as sessions launched by qmax-code. agy has no per-invocation --mcp-config flag.

func InstallCC

func InstallCC() (*InstallResult, error)

SetupCCIntegration writes the qmax MCP server into ~/.claude/settings.json so Claude Code picks up qmax tools in EVERY session — not just when spawned by qmax-code. This gives CC full bidirectional capability inheritance:

  • CC gets all qmax QA tools (list, run, generate, crawl, review…)
  • When qmax-code is the host, CC's own tools (bash, file ops, web) are also fully active and the system prompt instructs CC to use both.

func InstallCodex

func InstallCodex() (*InstallResult, error)

SetupCodexIntegration writes the qmax MCP server into ~/.codex/config.toml so Codex picks up qmax tools whenever the user invokes `codex` directly, in addition to when qmax-code spawns it.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL