cli

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Version = "dev"

Functions

func Execute

func Execute(args []string, stdout, stderr io.Writer) error

func ExitCode

func ExitCode(err error) int

Types

type CLI

type CLI struct {
	Config  string `name:"config" help:"Config path" env:"CLAWDEX_CONFIG"`
	Repo    string `name:"repo" help:"Contacts data repo path" env:"CLAWDEX_REPO"`
	JSON    bool   `name:"json" help:"Write JSON to stdout"`
	Plain   bool   `name:"plain" help:"Write stable plain text to stdout"`
	DryRun  bool   `name:"dry-run" short:"n" help:"Preview changes without writing"`
	NoInput bool   `name:"no-input" help:"Never prompt"`
	Verbose bool   `name:"verbose" short:"v" help:"Verbose diagnostics"`

	Version kong.VersionFlag `name:"version" help:"Print version and exit"`

	Init     InitCmd     `cmd:"" help:"Initialize a contacts data repo"`
	ConfigC  ConfigCmd   `cmd:"" name:"config" help:"Show or edit clawdex config"`
	Person   PersonCmd   `cmd:"" help:"Manage people"`
	Note     NoteCmd     `cmd:"" help:"Manage notes"`
	Timeline TimelineCmd `cmd:"" help:"Show person timeline"`
	Search   SearchCmd   `cmd:"" help:"Search people and notes"`
	Import   ImportCmd   `cmd:"" help:"Import contacts into local markdown"`
	Sync     SyncCmd     `cmd:"" help:"Preview sync with address books"`
	Export   ExportCmd   `cmd:"" help:"Export contacts"`
	Git      GitCmd      `cmd:"" help:"Run data repo git helpers"`
	Doctor   DoctorCmd   `cmd:"" help:"Check repo health"`
}

type ConfigCmd

type ConfigCmd struct {
	Show ConfigShowCmd `cmd:"" default:"1" help:"Show config"`
	Set  ConfigSetCmd  `cmd:"" help:"Set config value"`
}

type ConfigSetCmd

type ConfigSetCmd struct {
	Key   string `arg:"" help:"Config key"`
	Value string `arg:"" help:"Config value"`
}

func (*ConfigSetCmd) Run

func (c *ConfigSetCmd) Run(r *Runtime) error

type ConfigShowCmd

type ConfigShowCmd struct{}

func (*ConfigShowCmd) Run

func (c *ConfigShowCmd) Run(r *Runtime) error

type DoctorCmd

type DoctorCmd struct {
	Repair bool `name:"repair" help:"Repair damaged markdown frontmatter"`
}

func (*DoctorCmd) Run

func (c *DoctorCmd) Run(r *Runtime) error

type ExportCmd

type ExportCmd struct {
	VCard ExportVCardCmd `cmd:"" name:"vcard" help:"Export vCard"`
}

type ExportVCardCmd

type ExportVCardCmd struct {
	Person         string `name:"person" help:"Person query"`
	All            bool   `name:"all" help:"Export all people"`
	IncludeAvatars bool   `name:"include-avatars" help:"Include avatar PHOTO fields"`
	Out            string `name:"out" short:"o" required:"" help:"Output .vcf path, or - for stdout"`
}

func (*ExportVCardCmd) Run

func (c *ExportVCardCmd) Run(r *Runtime) error

type GitCmd

type GitCmd struct {
	Status GitStatusCmd `cmd:"" default:"1" help:"Show git status"`
	Pull   GitPullCmd   `cmd:"" help:"Pull data repo"`
	Push   GitPushCmd   `cmd:"" help:"Push data repo"`
	Commit GitCommitCmd `cmd:"" help:"Commit data repo changes"`
}

type GitCommitCmd

type GitCommitCmd struct {
	Message string `name:"message" short:"m" help:"Commit message" default:"sync: update clawdex contacts"`
}

func (*GitCommitCmd) Run

func (c *GitCommitCmd) Run(r *Runtime) error

type GitPullCmd

type GitPullCmd struct{}

func (*GitPullCmd) Run

func (c *GitPullCmd) Run(r *Runtime) error

type GitPushCmd

type GitPushCmd struct{}

func (*GitPushCmd) Run

func (c *GitPushCmd) Run(r *Runtime) error

type GitStatusCmd

type GitStatusCmd struct{}

func (*GitStatusCmd) Run

func (c *GitStatusCmd) Run(r *Runtime) error

type ImportAppleCmd

type ImportAppleCmd struct {
	Input   string `name:"input" help:"JSON/NDJSON contact file instead of macOS Contacts"`
	Avatars bool   `name:"avatars" help:"Import local avatar thumbnails"`
}

func (*ImportAppleCmd) Run

func (c *ImportAppleCmd) Run(r *Runtime) error

type ImportBirdclawCmd

type ImportBirdclawCmd struct {
	DBPath      string `name:"db" help:"birdclaw SQLite database path" default:"~/.birdclaw/birdclaw.sqlite"`
	MinMessages int    `name:"min-messages" help:"Import DMs with more than this many messages" default:"4"`
}

func (*ImportBirdclawCmd) Run

func (c *ImportBirdclawCmd) Run(r *Runtime) error

type ImportCmd

type ImportCmd struct {
	Apple    ImportAppleCmd    `cmd:"" help:"Import Apple Contacts into local markdown"`
	Birdclaw ImportBirdclawCmd `cmd:"" help:"Import X/Twitter DM contacts from local birdclaw archive"`
	Google   ImportGoogleCmd   `cmd:"" help:"Import Google Contacts into local markdown"`
	Discrawl ImportDiscrawlCmd `cmd:"" help:"Import Discord DM contacts from local discrawl archive"`
}

type ImportDiscrawlCmd

type ImportDiscrawlCmd struct {
	DBPath      string `name:"db" help:"discrawl SQLite database path" default:"~/.discrawl/discrawl.db"`
	MinMessages int    `name:"min-messages" help:"Import DMs with more than this many messages" default:"4"`
}

func (*ImportDiscrawlCmd) Run

func (c *ImportDiscrawlCmd) Run(r *Runtime) error

type ImportGoogleCmd

type ImportGoogleCmd struct {
	Account string `name:"account" help:"Google account email"`
	Avatars bool   `name:"avatars" help:"Fetch Google contact avatar bytes through gog raw photo URLs"`
}

func (*ImportGoogleCmd) Run

func (c *ImportGoogleCmd) Run(r *Runtime) error

type InitCmd

type InitCmd struct {
	Dir      string `arg:"" optional:"" help:"Contacts data repo directory"`
	Remote   string `name:"remote" help:"Git remote for contacts backup"`
	NoConfig bool   `name:"no-config" help:"Do not write app config"`
}

func (*InitCmd) Run

func (c *InitCmd) Run(r *Runtime) error

type NoteAddCmd

type NoteAddCmd struct {
	Person     string   `arg:"" help:"Person query"`
	Kind       string   `name:"kind" required:"" help:"Note kind"`
	Source     string   `name:"source" required:"" help:"Note source"`
	Text       string   `name:"text" help:"Note body"`
	OccurredAt string   `name:"occurred-at" help:"Occurrence time"`
	Topic      []string `name:"topic" help:"Topic"`
}

func (*NoteAddCmd) Run

func (c *NoteAddCmd) Run(r *Runtime) error

type NoteCmd

type NoteCmd struct {
	Add  NoteAddCmd  `cmd:"" help:"Add a note"`
	List NoteListCmd `cmd:"" help:"List notes"`
}

type NoteListCmd

type NoteListCmd struct {
	Person string `arg:"" help:"Person query"`
}

func (*NoteListCmd) Run

func (c *NoteListCmd) Run(r *Runtime) error

type PersonAddCmd

type PersonAddCmd struct {
	Name  string   `arg:"" help:"Person name"`
	Email []string `name:"email" short:"e" help:"Email address"`
	Phone []string `name:"phone" short:"p" help:"Phone number"`
	Tag   []string `name:"tag" short:"t" help:"Tag"`
}

func (*PersonAddCmd) Run

func (c *PersonAddCmd) Run(r *Runtime) error

type PersonAvatarClearCmd

type PersonAvatarClearCmd struct {
	Person string `arg:"" help:"Person query"`
}

func (*PersonAvatarClearCmd) Run

func (c *PersonAvatarClearCmd) Run(r *Runtime) error

type PersonAvatarCmd

type PersonAvatarCmd struct {
	Set   PersonAvatarSetCmd   `cmd:"" help:"Set a local avatar image"`
	Show  PersonAvatarShowCmd  `cmd:"" help:"Show avatar metadata"`
	Clear PersonAvatarClearCmd `cmd:"" help:"Clear avatar metadata"`
}

type PersonAvatarSetCmd

type PersonAvatarSetCmd struct {
	Person string `arg:"" help:"Person query"`
	File   string `arg:"" help:"Image file"`
}

func (*PersonAvatarSetCmd) Run

func (c *PersonAvatarSetCmd) Run(r *Runtime) error

type PersonAvatarShowCmd

type PersonAvatarShowCmd struct {
	Person string `arg:"" help:"Person query"`
	Path   bool   `name:"path" help:"Print absolute avatar path only"`
}

func (*PersonAvatarShowCmd) Run

func (c *PersonAvatarShowCmd) Run(r *Runtime) error

type PersonCmd

type PersonCmd struct {
	Add    PersonAddCmd    `cmd:"" help:"Add a person"`
	List   PersonListCmd   `cmd:"" help:"List people"`
	Show   PersonShowCmd   `cmd:"" help:"Show a person"`
	Edit   PersonEditCmd   `cmd:"" help:"Edit a person markdown file"`
	Avatar PersonAvatarCmd `cmd:"" help:"Manage person avatars"`
}

type PersonEditCmd

type PersonEditCmd struct {
	Query string `arg:"" help:"ID, name, email, or phone"`
}

func (*PersonEditCmd) Run

func (c *PersonEditCmd) Run(r *Runtime) error

type PersonListCmd

type PersonListCmd struct {
	Query string `name:"query" short:"q" help:"Filter query"`
}

func (*PersonListCmd) Run

func (c *PersonListCmd) Run(r *Runtime) error

type PersonShowCmd

type PersonShowCmd struct {
	Query string `arg:"" help:"ID, name, email, or phone"`
}

func (*PersonShowCmd) Run

func (c *PersonShowCmd) Run(r *Runtime) error

type Runtime

type Runtime struct {
	// contains filtered or unexported fields
}

type SearchCmd

type SearchCmd struct {
	Query string `arg:"" help:"Search query"`
}

func (*SearchCmd) Run

func (c *SearchCmd) Run(r *Runtime) error

type SyncAppleCmd

type SyncAppleCmd struct{}

func (*SyncAppleCmd) Run

func (c *SyncAppleCmd) Run(r *Runtime) error

type SyncCmd

type SyncCmd struct {
	Apple  SyncAppleCmd  `cmd:"" help:"Preview Apple Contacts sync"`
	Google SyncGoogleCmd `cmd:"" help:"Preview Google Contacts sync"`
}

type SyncGoogleCmd

type SyncGoogleCmd struct {
	Account string `name:"account" help:"Google account email"`
}

func (*SyncGoogleCmd) Run

func (c *SyncGoogleCmd) Run(r *Runtime) error

type TimelineCmd

type TimelineCmd struct {
	Person string `arg:"" help:"Person query"`
}

func (*TimelineCmd) Run

func (c *TimelineCmd) Run(r *Runtime) error

Jump to

Keyboard shortcuts

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