cmd

package
v1.346.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2026 License: MIT Imports: 49 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AgentProvisionerCmd = &cobra.Command{
	Use:   "agent-provisioner",
	Short: "HTTP provisioner server for session Pods",
	Long: `Starts an HTTP server that provisions a session Pod on demand.

Endpoints:
  GET  /healthz   – liveness/readiness probe (always 200)
  GET  /status    – current provisioning state as JSON
  POST /provision – accepts SessionSettings JSON; triggers the session
                    startup sequence asynchronously (returns 202)

On Pod restart the server automatically provisions from --settings-file
(the K8s Secret volume mount) without waiting for a /provision call.`,
	RunE: runAgentProvisioner,
}

AgentProvisionerCmd is the "agent-provisioner" sub-command. It starts an HTTP server (default :9001) that provisions session Pods.

The proxy server calls POST /provision with the session settings JSON after the Pod becomes ready. The provisioner then:

  1. Runs the full setup sequence (write-pem, clone-repo, compile, sync-extra)
  2. Starts agentapi (or claude-agentapi / codex-agentapi) as a subprocess
  3. Waits for agentapi to become ready
  4. Sends the initial message (if any)

On Pod restart, if --settings-file already exists (mounted from the K8s Secret), provisioning is triggered automatically without waiting for a /provision call.

View Source
var ClientCmd = &cobra.Command{
	Use:   "client",
	Short: "AgentAPI Client CLI",
	Long:  "Command line client for interacting with AgentAPI endpoints",
}
View Source
var HelpersCmd = &cobra.Command{
	Use:   "helpers",
	Short: "Helper utilities for agentapi-proxy",
	Long:  "Collection of helper utilities and tools for working with agentapi-proxy",
	Run: func(cmd *cobra.Command, args []string) {
		fmt.Println("Available helpers:")
		fmt.Println("  setup-claude-code - Setup Claude Code configuration")
		fmt.Println("  generate-token - Generate API keys for agentapi-proxy authentication")
		fmt.Println("  generate-setting - SlackBot 設定から session settings JSON を組み立てて出力する")
		fmt.Println("  init - Initialize Claude configuration (alias for setup-claude-code)")
		fmt.Println("  setup-gh - Setup GitHub authentication using gh CLI")
		fmt.Println("  send-notification - Send push notifications to registered subscriptions")
		fmt.Println("  merge-mcp-config - Merge multiple MCP server configuration directories")
		fmt.Println("  merge-settings-config - Merge multiple settings configuration directories")
		fmt.Println("  sync - Sync Claude configuration from Settings Secret")
		fmt.Println("  migrate - Migrate derived Secrets into agentapi-settings-* (unified source)")
		fmt.Println("  prune-stale-resources - Delete stale Kubernetes resources for sessions missing their settings secret")
		fmt.Println("  delete-expired-sessions - Delete Kubernetes resources for sessions created more than N days ago")
		fmt.Println("Use 'agentapi-proxy helpers --help' for more information about available subcommands.")
	},
}
View Source
var ServerCmd = &cobra.Command{
	Use:   "server",
	Short: "Start the AgentAPI Proxy Server",
	Long:  "Start the reverse proxy server for AgentAPI that routes requests based on configuration",
	Run:   runProxy,
}

Functions

func RunAddMcpServers added in v1.41.3

func RunAddMcpServers(configFlag string) error

RunAddMcpServers is exported for use in other packages

func RunInitGitHubRepo added in v1.41.3

func RunInitGitHubRepo(repoFullName, cloneDir string, ignoreMissingConfig bool) error

RunInitGitHubRepo is exported for use in other packages

func RunSetupClaudeCode added in v1.41.3

func RunSetupClaudeCode() error

RunSetupClaudeCode is exported for use in other packages

Types

type APIKeysFile added in v0.14.0

type APIKeysFile struct {
	APIKeys []config.APIKey `json:"api_keys"`
}

type GitHubAppConfig added in v0.5.0

type GitHubAppConfig struct {
	AppID          int64
	InstallationID int64
	PEMPath        string
	APIBase        string
}

type MCPServerConfig added in v1.9.1

type MCPServerConfig struct {
	ID        string            `json:"id"`
	Name      string            `json:"name"`
	Endpoint  string            `json:"endpoint"`
	Enabled   bool              `json:"enabled"`
	Transport string            `json:"transport"`
	Command   string            `json:"command,omitempty"`
	Args      []string          `json:"args,omitempty"`
	Env       map[string]string `json:"env,omitempty"`
	Timeout   int               `json:"timeout,omitempty"`
}

MCP Server configuration structure

Jump to

Keyboard shortcuts

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