Documentation
¶
Index ¶
- Variables
- func AccountID(deps *Dependencies) string
- func Execute(ctx context.Context, store *config.ConfigStore, client meta.Client) error
- func HandleError(err error)
- func NewAccountsCommand(deps *Dependencies) *cobra.Command
- func NewAdSetsCommand(deps *Dependencies) *cobra.Command
- func NewAdsCommand(deps *Dependencies) *cobra.Command
- func NewAssetsCommand(deps *Dependencies) *cobra.Command
- func NewAuthCommand(deps *Dependencies) *cobra.Command
- func NewCampaignsCommand(deps *Dependencies) *cobra.Command
- func NewConfigCommand(deps *Dependencies) *cobra.Command
- func NewCreativesCommand(deps *Dependencies) *cobra.Command
- func NewPagesCommand(deps *Dependencies) *cobra.Command
- func NewServeCommand(deps *Dependencies) *cobra.Command
- func NewTargetingCommand(deps *Dependencies) *cobra.Command
- func NewUpdateCommand(deps *Dependencies) *cobra.Command
- type Dependencies
Constants ¶
This section is empty.
Variables ¶
var Version = "dev"
Version is set at build time via -ldflags.
Functions ¶
func AccountID ¶
func AccountID(deps *Dependencies) string
AccountID returns the effective account ID from deps.
func Execute ¶
Execute is the main entry point for the CLI. It loads config, wires subcommands, and runs. The client is provided from the composition root (cmd/meta/main.go).
func HandleError ¶
func HandleError(err error)
HandleError prints the error to stderr and exits with the appropriate code. This is the standard error handling pattern for all CLI commands.
func NewAccountsCommand ¶
func NewAccountsCommand(deps *Dependencies) *cobra.Command
NewAccountsCommand creates the "meta accounts list" command.
func NewAdSetsCommand ¶
func NewAdSetsCommand(deps *Dependencies) *cobra.Command
NewAdSetsCommand creates the "meta adsets create" command.
func NewAdsCommand ¶
func NewAdsCommand(deps *Dependencies) *cobra.Command
NewAdsCommand creates the "meta ads create" command.
func NewAssetsCommand ¶
func NewAssetsCommand(deps *Dependencies) *cobra.Command
NewAssetsCommand creates the "meta assets" command with subcommands.
func NewAuthCommand ¶
func NewAuthCommand(deps *Dependencies) *cobra.Command
NewAuthCommand creates the "meta auth" command.
func NewCampaignsCommand ¶
func NewCampaignsCommand(deps *Dependencies) *cobra.Command
NewCampaignsCommand creates the "meta campaigns create" command.
func NewConfigCommand ¶
func NewConfigCommand(deps *Dependencies) *cobra.Command
NewConfigCommand creates the "meta config" command with "set" and "get" subcommands.
func NewCreativesCommand ¶
func NewCreativesCommand(deps *Dependencies) *cobra.Command
NewCreativesCommand creates the "meta creatives create" command.
func NewPagesCommand ¶
func NewPagesCommand(deps *Dependencies) *cobra.Command
NewPagesCommand creates the "meta pages list" command.
All business logic (multi-source aggregation, pagination, deduplication, partial-failure handling) lives in meta.ListPages. This command is a thin shell: parse flags, call the domain, format output.
func NewServeCommand ¶
func NewServeCommand(deps *Dependencies) *cobra.Command
NewServeCommand creates the "meta serve" command that starts the MCP server.
func NewTargetingCommand ¶
func NewTargetingCommand(deps *Dependencies) *cobra.Command
NewTargetingCommand creates the "meta targeting search" command.
func NewUpdateCommand ¶ added in v0.3.0
func NewUpdateCommand(deps *Dependencies) *cobra.Command
NewUpdateCommand creates the "meta update" command.
The command deliberately does not reimplement any installer logic. It inspects how meta-cli was installed, queries GitHub for the latest release, and — for script-installed binaries — downloads and executes install.sh pinned to the target tag. install.sh is the single source of truth for downloading, checksum verification, extraction, and install location; the CLI never duplicates any of that.
Types ¶
type Dependencies ¶
type Dependencies struct {
Client meta.Client
Config *config.Config
Store *config.ConfigStore
Format string // resolved output format (--format or config)
Fields string // --fields value
DryRun bool
Verbose bool
}
Dependencies holds the shared state for all CLI subcommands. Constructed once in Execute() and passed to each subcommand factory.