cmd

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(args []string, version string) int

Types

type AddCmd

type AddCmd struct {
	Title     []string `arg:"" help:"Task title"`
	Priority  string   `       help:"Priority (0-4, p0-p4, or none/urgent/high/medium/low)" short:"p"`
	Project   string   `       help:"Project prefix"                                        short:"P"`
	Desc      string   `       help:"Description"                                           short:"d"`
	Labels    []string `       help:"Labels (CSV)"                                          short:"l" sep:","`
	Assignees []string `       help:"Assignees (CSV, @me for git user)"                     short:"A" sep:","`
	Parent    string   `       help:"Parent task ID"`
	Estimate  *int     `       help:"Estimate (user-defined units)"`
	Due       string   `       help:"Due date (YYYY-MM-DD or relative +Nh/+Nd/+Nw/+Nm)"`
}

func (*AddCmd) Run

func (c *AddCmd) Run(cli *CLI) error

type BlockCmd

type BlockCmd struct {
	ID      string `arg:"" help:"Task ID or ref to block"`
	Blocker string `arg:"" help:"Blocking task ID or ref"`
}

func (*BlockCmd) Run

func (c *BlockCmd) Run(cli *CLI) error

type CLI

type CLI struct {
	// Global flags
	Version kong.VersionFlag `short:"V" name:"version" help:"Print version and exit"`
	JSON    bool             `short:"j"                help:"Output as JSON"`
	Dir     string           `short:"C"                help:"Run in directory"       default:""`

	// Commands
	Init        InitCmd        `cmd:"" help:"Initialize .tasks/ in current directory"`
	Add         AddCmd         `cmd:"" help:"Create a task"`
	List        LsCmd          `cmd:"" help:"List tasks"                                 aliases:"ls"`
	Ready       ReadyCmd       `cmd:"" help:"List active/open unblocked tasks"           aliases:"rdy"`
	Show        ShowCmd        `cmd:"" help:"Show task details"`
	Start       StartCmd       `cmd:"" help:"Start working on a task (open → active)"    aliases:"active"`
	Open        OpenCmd        `cmd:"" help:"Reset a task status to open"`
	Defer       DeferCmd       `cmd:"" help:"Defer a task"`
	Done        DoneCmd        `cmd:"" help:"Complete a task"`
	Close       CloseCmd       `cmd:"" help:"Close/cancel a task"`
	Edit        EditCmd        `cmd:"" help:"Edit a task"`
	Log         LogCmd         `cmd:"" help:"Add a log entry to a task"`
	Block       BlockCmd       `cmd:"" help:"Add a blocker dependency"`
	Unblock     UnblockCmd     `cmd:"" help:"Remove a blocker dependency"`
	Remove      RmCmd          `cmd:"" help:"Delete a task"                              aliases:"rm"`
	Clean       CleanCmd       `cmd:"" help:"Remove old completed tasks"`
	Check       CheckCmd       `cmd:"" help:"Check task integrity"`
	Config      ConfigCmd      `cmd:"" help:"Show or set configuration"`
	Completions CompletionsCmd `cmd:"" help:"Output shell completions (bash, zsh, fish)"`
	Mv          MvCmd          `cmd:"" help:"Move a task to a different project"`
}

CLI is the root Kong command struct.

func (*CLI) AfterApply

func (c *CLI) AfterApply() error

AfterApply sets the working directory if -C was provided.

type CheckCmd

type CheckCmd struct{}

func (*CheckCmd) Run

func (c *CheckCmd) Run(cli *CLI) error

type CleanCmd

type CleanCmd struct {
	OlderThan *int `help:"Remove tasks completed more than N days ago"`
	Force     bool `help:"Force clean even if disabled in config"`
}

func (*CleanCmd) Run

func (c *CleanCmd) Run(cli *CLI) error

type CloseCmd added in v0.1.5

type CloseCmd struct {
	ID string `arg:"" help:"Task ID or ref"`
}

func (*CloseCmd) Run added in v0.1.5

func (c *CloseCmd) Run(cli *CLI) error

type CompletionsCmd

type CompletionsCmd struct {
	Shell string `arg:"" optional:"" help:"Shell type: bash, zsh, fish" default:"fish"`
}

func (*CompletionsCmd) Run

func (c *CompletionsCmd) Run(cli *CLI) error

type ConfigAliasCmd

type ConfigAliasCmd struct {
	Name string `arg:"" optional:"" help:"Alias name"`
	Path string `arg:"" optional:"" help:"Directory path"`
	Rm   bool   `                   help:"Remove the alias" short:"r"`
}

func (*ConfigAliasCmd) Run

func (c *ConfigAliasCmd) Run(cli *CLI) error

type ConfigCleanAfterCmd

type ConfigCleanAfterCmd struct {
	Show    ConfigCleanAfterShowCmd    `cmd:"" help:"Show clean-after config" default:"1"`
	Enable  ConfigCleanAfterEnableCmd  `cmd:"" help:"Enable auto-clean"`
	Disable ConfigCleanAfterDisableCmd `cmd:"" help:"Disable auto-clean"`
	Days    ConfigCleanAfterDaysCmd    `cmd:"" help:"Set clean-after days"`
}

type ConfigCleanAfterDaysCmd

type ConfigCleanAfterDaysCmd struct {
	Days int `arg:"" help:"Days after which to clean completed tasks"`
}

func (*ConfigCleanAfterDaysCmd) Run

func (c *ConfigCleanAfterDaysCmd) Run(cli *CLI) error

type ConfigCleanAfterDisableCmd

type ConfigCleanAfterDisableCmd struct{}

func (*ConfigCleanAfterDisableCmd) Run

func (c *ConfigCleanAfterDisableCmd) Run(cli *CLI) error

type ConfigCleanAfterEnableCmd

type ConfigCleanAfterEnableCmd struct{}

func (*ConfigCleanAfterEnableCmd) Run

func (c *ConfigCleanAfterEnableCmd) Run(cli *CLI) error

type ConfigCleanAfterShowCmd

type ConfigCleanAfterShowCmd struct{}

func (*ConfigCleanAfterShowCmd) Run

func (c *ConfigCleanAfterShowCmd) Run(cli *CLI) error

type ConfigCmd

type ConfigCmd struct {
	Show     ConfigShowCmd       `cmd:"" help:"Show configuration"              default:"1"`
	Project  ConfigProjectCmd    `cmd:"" help:"Get or set the default project"`
	Alias    ConfigAliasCmd      `cmd:"" help:"Manage directory aliases for -C"`
	Defaults ConfigDefaultsCmd   `cmd:"" help:"Show or set default values"`
	Clean    ConfigCleanAfterCmd `cmd:"" help:"Configure auto-cleanup"                      name:"clean-after"`
}

type ConfigDefaultsAssigneesCmd

type ConfigDefaultsAssigneesCmd struct {
	Assignees []string `arg:"" help:"Default assignees (CSV)" sep:","`
}

func (*ConfigDefaultsAssigneesCmd) Run

func (c *ConfigDefaultsAssigneesCmd) Run(cli *CLI) error

type ConfigDefaultsCmd

type ConfigDefaultsCmd struct {
	Show      ConfigDefaultsShowCmd      `cmd:"" help:"Show default values"   default:"1"`
	Priority  ConfigDefaultsPriorityCmd  `cmd:"" help:"Set default priority"`
	Labels    ConfigDefaultsLabelsCmd    `cmd:"" help:"Set default labels"`
	Assignees ConfigDefaultsAssigneesCmd `cmd:"" help:"Set default assignees"`
}

type ConfigDefaultsLabelsCmd

type ConfigDefaultsLabelsCmd struct {
	Labels []string `arg:"" help:"Default labels (CSV)" sep:","`
}

func (*ConfigDefaultsLabelsCmd) Run

func (c *ConfigDefaultsLabelsCmd) Run(cli *CLI) error

type ConfigDefaultsPriorityCmd

type ConfigDefaultsPriorityCmd struct {
	Level int `arg:"" help:"Default priority level (0-4)"`
}

func (*ConfigDefaultsPriorityCmd) Run

func (c *ConfigDefaultsPriorityCmd) Run(cli *CLI) error

type ConfigDefaultsShowCmd

type ConfigDefaultsShowCmd struct{}

func (*ConfigDefaultsShowCmd) Run

func (c *ConfigDefaultsShowCmd) Run(cli *CLI) error

type ConfigProjectCmd

type ConfigProjectCmd struct {
	Show   ConfigProjectShowCmd   `cmd:"" help:"Show default project"             default:"1"`
	Set    ConfigProjectSetCmd    `cmd:"" help:"Set default project"`
	Rename ConfigProjectRenameCmd `cmd:"" help:"Rename project and all its tasks"`
}

type ConfigProjectRenameCmd

type ConfigProjectRenameCmd struct {
	Old string `arg:"" help:"Old project name"`
	New string `arg:"" help:"New project name"`
}

func (*ConfigProjectRenameCmd) Run

func (c *ConfigProjectRenameCmd) Run(cli *CLI) error

type ConfigProjectSetCmd

type ConfigProjectSetCmd struct {
	Name string `arg:"" help:"Project name to set"`
}

func (*ConfigProjectSetCmd) Run

func (c *ConfigProjectSetCmd) Run(cli *CLI) error

type ConfigProjectShowCmd

type ConfigProjectShowCmd struct{}

func (*ConfigProjectShowCmd) Run

func (c *ConfigProjectShowCmd) Run(cli *CLI) error

type ConfigShowCmd

type ConfigShowCmd struct{}

func (*ConfigShowCmd) Run

func (c *ConfigShowCmd) Run(cli *CLI) error

type DeferCmd added in v0.1.5

type DeferCmd struct {
	ID string `arg:"" help:"Task ID or ref"`
}

func (*DeferCmd) Run added in v0.1.5

func (c *DeferCmd) Run(cli *CLI) error

type DoneCmd

type DoneCmd struct {
	ID string `arg:"" help:"Task ID or ref"`
}

func (*DoneCmd) Run

func (c *DoneCmd) Run(cli *CLI) error

type EditCmd

type EditCmd struct {
	ID        string   `arg:"" help:"Task ID or ref"`
	Title     string   `       help:"New title"                                      short:"t"`
	Priority  string   `       help:"New priority"                                   short:"p"`
	Labels    []string `       help:"Labels (+add, -remove, or replace)"             short:"l" sep:","`
	Assignees []string `       help:"Assignees"                                      short:"A" sep:","`
	Due       string   `       help:"Due date (YYYY-MM-DD, relative, or - to clear)"`
	Parent    string   `       help:"Parent task (or - to clear)"`
	Desc      string   `       help:"Description"                                    short:"d"`
	Estimate  *int     `       help:"Estimate (or 0 to clear)"`
}

func (*EditCmd) Run

func (c *EditCmd) Run(cli *CLI) error

type InitCmd

type InitCmd struct {
	Project string `short:"P" help:"Project name (default: directory name)"`
}

func (*InitCmd) Run

func (c *InitCmd) Run(cli *CLI) error

type LogCmd

type LogCmd struct {
	ID  string   `arg:"" help:"Task ID or ref"`
	Msg []string `arg:"" help:"Log message"`
}

func (*LogCmd) Run

func (c *LogCmd) Run(cli *CLI) error

type LsCmd

type LsCmd struct {
	Search   []string `arg:"" optional:"" help:"Search title/description"`
	All      bool     `                   help:"Show all (including done, no limit)" short:"a"`
	Status   string   `                   help:"Filter by status (open/active/done)" short:"s"`
	Priority string   `                   help:"Filter by priority"                  short:"p"`
	Project  string   `                   help:"Filter by project"                   short:"P"`
	Label    string   `                   help:"Filter by label"                     short:"l"`
	Assignee string   `                   help:"Filter by assignee"`
	Parent   string   `                   help:"Filter by parent task"`
	Roots    bool     `                   help:"Top-level tasks only"`
	Overdue  bool     `                   help:"Overdue tasks only"`
	Limit    int      `                   help:"Limit results"                       short:"n" default:"20"`
}

func (*LsCmd) Run

func (c *LsCmd) Run(cli *CLI) error

type MvCmd

type MvCmd struct {
	Source  string `arg:"" help:"Task ID or Project name"`
	Project string `arg:"" help:"Target project name"`
}

func (*MvCmd) Run

func (c *MvCmd) Run(cli *CLI) error

type OpenCmd added in v0.1.5

type OpenCmd struct {
	ID string `arg:"" help:"Task ID or ref"`
}

func (*OpenCmd) Run added in v0.1.5

func (c *OpenCmd) Run(cli *CLI) error

type ReadyCmd

type ReadyCmd struct{}

func (*ReadyCmd) Run

func (c *ReadyCmd) Run(cli *CLI) error

type RmCmd

type RmCmd struct {
	ID    string `arg:"" help:"Task ID or ref"`
	Force bool   `       help:"Skip confirmation" short:"f"`
}

func (*RmCmd) Run

func (c *RmCmd) Run(cli *CLI) error

type ShowCmd

type ShowCmd struct {
	ID string `arg:"" help:"Task ID or ref"`
}

func (*ShowCmd) Run

func (c *ShowCmd) Run(cli *CLI) error

type StartCmd

type StartCmd struct {
	ID string `arg:"" help:"Task ID or ref"`
}

func (*StartCmd) Run

func (c *StartCmd) Run(cli *CLI) error

type UnblockCmd

type UnblockCmd struct {
	ID      string `arg:"" help:"Task ID or ref"`
	Blocker string `arg:"" help:"Blocking task ID or ref to remove"`
}

func (*UnblockCmd) Run

func (c *UnblockCmd) Run(cli *CLI) error

Jump to

Keyboard shortcuts

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