Documentation
¶
Index ¶
- Variables
- func ExitCodeFor(err error) int
- func NewRootCmd(version string) *cobra.Command
- func Run(version string) int
- func WithHint(err error, hint string) error
- func WithRuntime(ctx context.Context, r *Runtime) context.Context
- type Choice
- type Globals
- type PickerItem
- type Runtime
- type SilentExitError
Constants ¶
This section is empty.
Variables ¶
var ErrNotAuthenticated = errors.New("not authenticated: run `rc login` or pass --api-key / set RC_API_KEY")
Functions ¶
func ExitCodeFor ¶
func NewRootCmd ¶
func Run ¶
Run is the entrypoint used by cmd/rc/main.go. Wraps cobra.Execute() so we can format final errors based on --json — emitting a structured envelope for agents and a friendly stderr message (with actionable hint) for humans.
Keeping this here (rather than in main.go) means the JSON error contract lives next to the JSON success contract in output.go.
Types ¶
type Choice ¶
type Choice[T comparable] struct { Value T // returned when this branch is chosen Label string // shown in the interactive picker Flag string // the flag that selects this branch under --no-input (e.g. "--standalone") }
Choice is one branch of a decision: what the human picks, and the flag a non-interactive caller passes to select it without the prompt.
type Globals ¶
type Globals struct {
JSON bool
NoInput bool
Quiet bool
Verbose bool
ShowAll bool
Profile string
APIKey string
ProjectID string
Format string // jq/gojq expression, applied to --json output
NoColor bool
AssumeYes bool
Version string
// CommandPath is the dotted path of the command being run (e.g.
// "paywalls.generate"), set once in PersistentPreRunE. Used only for the
// usage-analytics request header.
CommandPath string
}
Globals bound to root persistent flags. Every subcommand reads these via context.
type PickerItem ¶
type PickerItem struct {
ID string
Label string // shown in the huh.Select; should be human-readable
}
PickerItem is a selectable entry in an interactive ID picker.
type Runtime ¶
type Runtime struct {
Globals *Globals
Config *config.Config
Out *output.Renderer
Ctx context.Context
// contains filtered or unexported fields
}
func RuntimeFrom ¶
type SilentExitError ¶
type SilentExitError struct{ Code int }
SilentExitError signals a specific exit code when the command has already written its own complete output. run.go skips the error envelope for this type so there is no duplicate output.
func (*SilentExitError) Error ¶
func (e *SilentExitError) Error() string
Source Files
¶
- analytics.go
- api.go
- apps.go
- apps_apple.go
- audit.go
- auth.go
- auth_keychain_unsupported.go
- auth_mcp_import.go
- browse.go
- capital.go
- charts.go
- confirm.go
- customers.go
- dashboard_url.go
- decide.go
- duration.go
- entitlements.go
- env.go
- fonts.go
- help.go
- home.go
- invoices.go
- media_assets.go
- metrics.go
- offerings.go
- open.go
- packages.go
- pagination.go
- paywalls.go
- paywalls_ai.go
- products.go
- products_store.go
- products_store_csv.go
- products_store_input.go
- products_store_readiness.go
- products_store_screenshot.go
- profiles.go
- projects.go
- purchases.go
- resolve.go
- rico.go
- root.go
- run.go
- runtime.go
- schema.go
- setup.go
- setup_google.go
- setup_oneshot.go
- skills.go
- subscriptions.go
- surface.go
- webhooks.go