cli

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

func Execute(ctx context.Context, store *config.ConfigStore, client meta.Client) error

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.

Jump to

Keyboard shortcuts

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