// Package main is the entry point for the agentteam CLI application.
// agentteam is the AgentTeam desktop client. It connects this machine to AgentTeam,
// runs local agent runtimes, hosts the authenticated local API, and manages
// local workspaces, apps, channels, and the background daemon service.
package main

import (
	"os"

	"github.com/tidbcloud/AgentTeam/desktop/internal/cmd"
)

// main initializes and executes the root CLI command.
func main() {
	if err := cmd.Execute(); err != nil {
		os.Exit(processExitCode(err))
	}
}

func processExitCode(err error) int {
	if code, ok := cmd.ExecExitCode(err); ok {
		return code
	}
	return 1
}
