cmd

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2026 License: MIT Imports: 33 Imported by: 0

Documentation

Overview

Package cmd holds the cobra command tree for the mio CLI. root.go defines the root command, the persistent global flags every subcommand inherits, and the shared per-invocation context (resolved config + client + output options) that resource commands pull via cmdContext.

Resource command files (products.go, contacts.go, …) self-register their command trees in their own init() via rootCmd.AddCommand, so adding a resource never requires editing this file. This is the property that lets 15 agents add resources in parallel without merge conflicts on a shared registry.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute() error

Execute runs the root command and returns the error (if any) for main.go to map onto a process exit code. It does not call os.Exit itself.

func RootCmd

func RootCmd() *cobra.Command

RootCmd exposes the root command for docs generation and tests. It attaches the group guards on first use so callers that drive the tree directly (docs generation, in-process tests) get the same unknown-subcommand behaviour as the production Execute() path.

Types

type AttrDefInput added in v0.10.0

type AttrDefInput struct {
	Name              *string
	Slug              *string
	FieldType         *string // → type (validated enum)
	Description       *string
	IsContactEditable *bool // → is_contact_editable
	Position          *int
}

AttrDefInput carries the resolved attribute-definition create attributes, decoupled from *cobra.Command so both `contact-attributes create` and the scaffold (MIO-2543) can build the same POST body. Each pointer is nil when the flag was unset. The required-flag ergonomics (name/slug/field-type must be set) stay with the command; this builder validates the field-type VALUE.

type HubConfigInput added in v0.10.0

type HubConfigInput struct {
	IsInProfile    *bool // → is_in_profile
	IsInOnboarding *bool // → is_in_onboarding
	IsRequired     *bool // → is_required
	IsReadOnly     *bool // → is_read_only
	IsSearchable   *bool // → is_searchable
}

HubConfigInput carries the hub-config boolean flags, decoupled from *cobra.Command. Each pointer is nil when the flag was unset (partial-update / upsert semantics preserved).

type PageInput added in v0.10.0

type PageInput struct {
	Title    *string
	Slug     *string
	Type     *string
	IsHome   *bool          // → is_homepage
	Position *int           // must be >= 0
	Privacy  *string        // validated enum
	Settings map[string]any // → settings (parsed JSON object)
	Meta     map[string]any // → meta (parsed JSON object)
}

PageInput carries the resolved create/update page attributes, decoupled from *cobra.Command so both the `pages` commands and the scaffold homepage step (MIO-2543) can build the same write body. Each scalar pointer is nil when the flag was unset; Settings/Meta are the already-parsed JSON objects (nil = unset).

type PlaylistInput added in v0.10.0

type PlaylistInput struct {
	Title       *string
	Description *string
	Visibility  *string
	HubID       *string // → hub_id
}

PlaylistInput carries the resolved playlist create attributes, decoupled from *cobra.Command so both `media playlists create` and the scaffold (MIO-2543) can build the same POST body. Each pointer is nil when the flag was unset. Playlists are create-only (no idempotency marker needed, per O1 decision c).

type SpaceInput added in v0.10.0

type SpaceInput struct {
	Name              *string
	Slug              *string
	Description       *string
	Icon              *string
	Color             *string
	SegmentID         *string // → segment_id
	IsDefault         *bool   // → is_default
	IsPinned          *bool   // → is_pinned
	AccessLevel       *string // → access_level (validated enum)
	PostingPermission *string // → posting_permission (validated enum)
	Position          *int    // must be >= 0
}

SpaceInput carries the resolved create/update space attributes, decoupled from *cobra.Command so both the `community spaces` commands and the scaffold (MIO-2543) can build the same write body. Each pointer is nil when the corresponding flag was unset (preserving partial-update semantics); a non-nil pointer carries the value to write.

Jump to

Keyboard shortcuts

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