{"modulePath":"github.com/checkend/checkend-cli","version":"v1.0.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package cli\n\nPackage cli is \\`ce\\`, the command line client of Checkend. It reads stats and changes the setup of a remote Checkend server (cloud or self-hosted) with an API token, through the MCP tools (/mcp) and /api/v1/export: the same surface an agent uses, so no endpoint exists only for the CLI.\n\n## Constants\n\n```go\nconst DefaultURL = \"https://app.checkend.com\"\n```\nDefaultURL is the server of a new login without --url: the cloud edition.\n\n## Variables\n\n```go\nvar ErrLocked = errors.New(\"the organization is locked: open Checkend in the browser to see why\")\n```\nErrLocked means the org of the token is locked (cloud billing).\n\n```go\nvar ErrUnauthorized = errors.New(\"the server refused the token (check it in Settings › Agent, then run: ce login)\")\n```\nErrUnauthorized means the server refused the token.\n\n## Functions\n\n```go\nfunc Main(version string) int\n```\nMain runs ce with the process arguments and returns the exit code.\n\n## Types\n\n```go\ntype App struct {\n\tVersion string\n\tStdin   io.Reader\n\tStdout  io.Writer\n\tStderr  io.Writer\n\tEnv     func(string) string\n\tHTTP    *http.Client // nil: a default client\n\tNow     func() time.Time\n\t// contains filtered or unexported fields\n}\n```\nApp holds what one run of ce needs. Main builds it from the process; tests build their own.\n\n```go\nfunc (a *App) Run(ctx context.Context, args []string) int\n```\nRun runs one command and returns the exit code.\n\n```go\ntype Client struct {\n\tURL     string // base URL, no trailing slash\n\tToken   string\n\tVersion string\n\tHTTP    *http.Client\n\t// contains filtered or unexported fields\n}\n```\nClient talks to one Checkend server with an API token: the MCP tools at /mcp for stats and setup, and plain HTTP for the file export. It uses the same surface as an agent, so a token works in both.\n\n```go\nfunc (c *Client) Call(ctx context.Context, tool string, args any, out any) (raw json.RawMessage, err error)\n```\nCall runs one MCP tool and decodes its structured result into out (when out is not nil). raw is the result as JSON, for --json.\n\n```go\nfunc (c *Client) Close()\n```\nClose ends the MCP session.\n\n```go\nfunc (c *Client) Export(ctx context.Context, q url.Values, w func(name string) (io.WriteCloser, error)) (string, int64, error)\n```\nExport downloads one export file (GET /api/v1/export) into w and returns the file name the server proposes.\n\n```go\ntype Config struct {\n\tURL   string `json:\"url\"`\n\tToken string `json:\"token\"`\n\tSite  string `json:\"site,omitempty\"`\n}\n```\nConfig is what \\`ce login\\` stores: the server, the token and the default site.\n\n","path":"github.com/checkend/checkend-cli/internal/cli","name":"cli","synopsis":"Package cli is `ce`, the command line client of Checkend.","isRedistributable":true}
