cmd

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2026 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Version   = "unknown"
	Build     = "unknown"
	BuildDate = "unknown"
)

Build number and versions injected at compile time

Functions

func ApplyPlan added in v0.1.2

func ApplyPlan(f *Filters, plan *Plan, cmd *cobra.Command)

func ConfigPath

func ConfigPath() string

func NewLogger

func NewLogger(c *Conf) *slog.Logger

func RegisterFleet

func RegisterFleet(conf *Conf, owner, dir string) error

RegisterFleet records an owner → directory mapping in conf.Fleets and persists config to disk. Idempotent: re-registering an existing mapping is a no-op.

func SaveConf

func SaveConf(conf *Conf) error

SaveConf persists conf to disk with 0600 perms, preserving all fields. The token is taken from the existing on-disk config (when present) rather than from conf.GitHub.Token, so a token sourced only from the GITHUB_TOKEN environment variable is never written to disk by a background save such as sync registering a fleet.

func Setup

func Setup(root *cobra.Command)

func SetupCommands

func SetupCommands(root *cobra.Command)

Types

type Conf

type Conf struct {
	Path        string            `mapstructure:"path"`
	Shallow     bool              `mapstructure:"shallow"`
	Concurrent  int               `mapstructure:"concurrent"`
	Interactive string            `mapstructure:"interactive"`
	Fleets      map[string]string `mapstructure:"fleets"`
	Log         LogConf           `mapstructure:"log"`
	GitHub      GitHubConf        `mapstructure:"github"`
	Console     *console.Console
}

func NewConf

func NewConf(cmd *cobra.Command) (*Conf, error)

func (*Conf) Print added in v0.1.4

func (c *Conf) Print(msg string)

func (*Conf) PrintDim added in v0.1.4

func (c *Conf) PrintDim(msg string)

func (*Conf) PrintInfo added in v0.1.4

func (c *Conf) PrintInfo(msg string)

type Filters

type Filters struct {
	IncludeRegex    string   `yaml:"include_regex,omitempty"`
	ExcludeRegex    string   `yaml:"exclude_regex,omitempty"`
	Include         []string `yaml:"include,omitempty"`
	Exclude         []string `yaml:"exclude,omitempty"`
	Topics          []string `yaml:"topics,omitempty"`
	IncludeArchived bool     `yaml:"include_archived,omitempty"`
	IncludeForks    bool     `yaml:"include_forks,omitempty"`
	Visibility      string   `yaml:"visibility,omitempty"`
	Language        string   `yaml:"language,omitempty"`
	Labels          []string `yaml:"labels,omitempty"`
	Group           string   `yaml:"group,omitempty"`
	HasFiles        []string `yaml:"has_files,omitempty"`
	IfCmd           string   `yaml:"if_cmd,omitempty"`
	Dirty           bool     `yaml:"dirty,omitempty"`
	Ahead           int      `yaml:"ahead,omitempty"`
	Behind          int      `yaml:"behind,omitempty"`
	Wip             bool     `yaml:"wip,omitempty"`
}

Filters is the unified filter set applied by every command that operates on repositories. Flags are bound by addFilterFlags; Apply runs them against a list of repos, optionally consulting the manifest for label/group filtering.

func (Filters) Apply

func (f Filters) Apply(repos []*provider.Repo, mf *manifest.FleetManifest) ([]*provider.Repo, error)

Apply filters a slice of repos. mf may be nil; manifest-based filters are skipped when it is. A name-filter regex compile error is returned as-is.

func (Filters) ApplyTasks

func (f Filters) ApplyTasks(ctx context.Context, tasks []taskWithName, mf *manifest.FleetManifest) ([]taskWithName, error)

ApplyTasks filters fleet.RepoTask-style entries (from the local scanner). Only name and manifest-based filters apply since task entries may not carry API metadata.

type GitHubConf

type GitHubConf struct {
	Token string `mapstructure:"token"`
	Host  string `mapstructure:"host"`
}

type LogConf

type LogConf struct {
	Level  string `mapstructure:"level"`
	Format string `mapstructure:"format"`
	Source bool   `mapstructure:"source"`
	Color  string `mapstructure:"color"`
}

type Plan added in v0.1.2

type Plan struct {
	Fleet       string   `yaml:"fleet,omitempty"`
	All         bool     `yaml:"all,omitempty"`
	JSON        bool     `yaml:"json,omitempty"`
	Shell       string   `yaml:"shell,omitempty"`
	Command     string   `yaml:"command,omitempty"`
	BlockLines  int      `yaml:"block_lines,omitempty"`
	DryRun      bool     `yaml:"dry_run,omitempty"`
	Interactive string   `yaml:"interactive,omitempty"`
	Filters     *Filters `yaml:"filters,omitempty"`
}

func LoadPlan added in v0.1.2

func LoadPlan(path string) (*Plan, error)

Jump to

Keyboard shortcuts

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