{"modulePath":"github.com/CompassLabs/cli","version":"v0.1.81","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package client\n\n## Functions\n\n```go\nfunc IsDebug(cmd *cobra.Command) bool\n```\nIsDebug returns true when --debug is set and --dry-run is not. When both flags are set, dry-run takes precedence.\n\n```go\nfunc IsDryRun(cmd *cobra.Command) bool\n```\nIsDryRun returns true when --dry-run is set on the command.\n\n```go\nfunc IsJSONDryRun(cmd *cobra.Command) bool\n```\n\n```go\nfunc NewClient(cmd *cobra.Command, allowedSecurityFields ...string) (*sdk.CompassCLI, error)\n```\nNewClient creates a new SDK client configured from command flags and environment. It handles global security, server URL/selection override, global parameters, retry configuration, timeout, and test client injection. Empty allowedSecurityFields accepts every global security alternative.\n\n```go\nfunc NewDryRunBody(length int64) io.ReadCloser\n```\nNewDryRunBody returns an empty body that previews as \\\u003cbytes:length\u003e under --dry-run.\n\n## Types\n\n```go\ntype DebugClient struct {\n\tInner  HTTPClient\n\tStderr io.Writer\n}\n```\nDebugClient wraps an HTTP client and logs request/response diagnostics to stderr.\n\n```go\nfunc (c *DebugClient) Do(req *http.Request) (*http.Response, error)\n```\nDo executes the request, logging diagnostics before and after.\n\n```go\ntype DryRunClient struct {\n\tStderr io.Writer\n\tStdout io.Writer\n\tJSON   bool\n\tCmd    *cobra.Command\n}\n```\nDryRunClient intercepts HTTP requests and returns a synthetic response without making any network calls.\n\n```go\nfunc (c *DryRunClient) Do(req *http.Request) (*http.Response, error)\n```\n\n```go\ntype HTTPClient interface {\n\tDo(req *http.Request) (*http.Response, error)\n}\n```\nHTTPClient is the interface that SDK clients implement.\n\n```go\nfunc WrapClientForDiagnostics(cmd *cobra.Command, inner HTTPClient) HTTPClient\n```\nWrapClientForDiagnostics wraps an HTTP client based on diagnostics mode. Returns the original client if no diagnostics flags are set.\n\n","path":"github.com/CompassLabs/cli/internal/client","name":"client","synopsis":"","isRedistributable":true}
