Documentation
¶
Overview ¶
Package cmd implements CLI commands for the dark-factory tool.
Index ¶
- func FindPromptFile(ctx context.Context, dir, id string) (string, error)
- func FindPromptFileInDirs(ctx context.Context, id string, dirs ...string) (string, error)
- func FindSpecFile(ctx context.Context, specsDir, id string) (string, error)
- func FindSpecFileInDirs(ctx context.Context, id string, dirs ...string) (string, error)
- type ApproveCommand
- type CancelCommand
- type CombinedListCommand
- type CombinedStatusCommand
- type KillCommand
- type ListCommand
- type PromptCompleteCommand
- type PromptEntry
- type PromptManager
- type PromptShowCommand
- type PromptShowOutput
- type RejectCommand
- type RequeueCommand
- type ScenarioEntry
- type ScenarioListCommand
- type ScenarioShowCommand
- type ScenarioStatusCommand
- type SpecApproveCommand
- type SpecCompleteCommand
- type SpecEntry
- type SpecListCommand
- type SpecRejectCommand
- type SpecShowCommand
- type SpecShowOutput
- type SpecStatusCommand
- type SpecUnapproveCommand
- type StatusCommand
- type UnapproveCommand
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindPromptFile ¶ added in v0.22.0
FindPromptFile finds a prompt file by id in dir, supporting: - absolute or relative path with directory component (checked directly) - exact filename with .md extension - filename without .md extension - numeric prefix match (e.g. "122" matches "122-some-name.md")
func FindPromptFileInDirs ¶ added in v0.134.0
FindPromptFileInDirs searches dirs in order and returns the first match.
func FindSpecFile ¶ added in v0.20.0
FindSpecFile finds a spec by absolute/relative path, exact filename, or numeric prefix match within specsDir.
Types ¶
type ApproveCommand ¶ added in v0.17.15
ApproveCommand executes the approve subcommand.
func NewApproveCommand ¶ added in v0.17.15
func NewApproveCommand( inboxDir string, queueDir string, promptManager PromptManager, ) ApproveCommand
NewApproveCommand creates a new ApproveCommand.
type CancelCommand ¶ added in v0.62.0
CancelCommand executes the cancel subcommand.
func NewCancelCommand ¶ added in v0.62.0
func NewCancelCommand( queueDir string, promptManager PromptManager, ) CancelCommand
NewCancelCommand creates a new CancelCommand.
type CombinedListCommand ¶ added in v0.17.25
CombinedListCommand shows combined prompt and spec list.
func NewCombinedListCommand ¶ added in v0.17.25
func NewCombinedListCommand( inboxDir string, queueDir string, completedDir string, rejectedDir string, lister spec.Lister, counter prompt.Counter, promptManager PromptManager, ) CombinedListCommand
NewCombinedListCommand creates a new CombinedListCommand.
type CombinedStatusCommand ¶ added in v0.17.25
CombinedStatusCommand shows combined prompt and spec status.
type KillCommand ¶ added in v0.84.0
KillCommand executes the kill subcommand.
func NewKillCommand ¶ added in v0.84.0
func NewKillCommand( lockFilePath string, signalFunc func(pid int, sig syscall.Signal) error, sleepFunc func(d time.Duration), ) KillCommand
NewKillCommand creates a new KillCommand. signalFunc and sleepFunc may be nil; defaults are used in that case.
type ListCommand ¶ added in v0.17.15
ListCommand executes the list subcommand.
func NewListCommand ¶ added in v0.17.15
func NewListCommand( inboxDir string, queueDir string, completedDir string, rejectedDir string, promptManager PromptManager, ) ListCommand
NewListCommand creates a new ListCommand.
type PromptCompleteCommand ¶ added in v0.69.0
PromptCompleteCommand executes the prompt complete subcommand.
func NewPromptCompleteCommand ¶ added in v0.69.0
func NewPromptCompleteCommand( queueDir string, completedDir string, promptManager PromptManager, releaser git.Releaser, pr bool, brancher git.Brancher, prCreator git.PRCreator, ) PromptCompleteCommand
NewPromptCompleteCommand creates a new PromptCompleteCommand.
type PromptEntry ¶ added in v0.17.15
PromptEntry represents a single prompt entry in the list output.
type PromptManager ¶ added in v0.119.2
type PromptManager interface {
Load(ctx context.Context, path string) (*prompt.PromptFile, error)
NormalizeFilenames(ctx context.Context, dir string) ([]prompt.Rename, error)
MoveToCompleted(ctx context.Context, path string) error
}
PromptManager is the subset of prompt.Manager that the cmd package uses.
type PromptShowCommand ¶ added in v0.25.0
PromptShowCommand executes the prompt show subcommand.
func NewPromptShowCommand ¶ added in v0.25.0
func NewPromptShowCommand( inboxDir, inProgressDir, completedDir, logDir string, promptManager PromptManager, ) PromptShowCommand
NewPromptShowCommand creates a new PromptShowCommand.
type PromptShowOutput ¶ added in v0.25.0
type PromptShowOutput struct {
File string `json:"file"`
Status string `json:"status"`
Specs []string `json:"specs,omitempty"`
Summary string `json:"summary,omitempty"`
Created string `json:"created,omitempty"`
Queued string `json:"queued,omitempty"`
Started string `json:"started,omitempty"`
Completed string `json:"completed,omitempty"`
LogPath string `json:"log_path,omitempty"`
}
PromptShowOutput holds all fields for JSON output.
type RejectCommand ¶ added in v0.134.0
RejectCommand executes the prompt reject subcommand.
func NewRejectCommand ¶ added in v0.134.0
func NewRejectCommand( inboxDir string, inProgressDir string, rejectedDir string, promptManager PromptManager, ) RejectCommand
NewRejectCommand creates a new RejectCommand.
type RequeueCommand ¶ added in v0.17.15
RequeueCommand executes the requeue subcommand.
func NewRequeueCommand ¶ added in v0.17.15
func NewRequeueCommand( queueDir string, promptManager PromptManager, ) RequeueCommand
NewRequeueCommand creates a new RequeueCommand.
type ScenarioEntry ¶ added in v0.131.0
type ScenarioEntry struct {
Number int `json:"number"`
Status string `json:"status"`
Title string `json:"title"`
File string `json:"file"`
}
ScenarioEntry represents a single scenario in the list output.
type ScenarioListCommand ¶ added in v0.131.0
ScenarioListCommand executes the scenario list subcommand.
func NewScenarioListCommand ¶ added in v0.131.0
func NewScenarioListCommand(lister scenario.Lister) ScenarioListCommand
NewScenarioListCommand creates a new ScenarioListCommand.
type ScenarioShowCommand ¶ added in v0.131.0
ScenarioShowCommand executes the scenario show subcommand.
func NewScenarioShowCommand ¶ added in v0.131.0
func NewScenarioShowCommand(lister scenario.Lister) ScenarioShowCommand
NewScenarioShowCommand creates a new ScenarioShowCommand.
type ScenarioStatusCommand ¶ added in v0.131.0
ScenarioStatusCommand executes the scenario status subcommand.
func NewScenarioStatusCommand ¶ added in v0.131.0
func NewScenarioStatusCommand(lister scenario.Lister) ScenarioStatusCommand
NewScenarioStatusCommand creates a new ScenarioStatusCommand.
type SpecApproveCommand ¶ added in v0.17.23
SpecApproveCommand executes the spec approve subcommand.
func NewSpecApproveCommand ¶ added in v0.17.23
func NewSpecApproveCommand( inboxDir string, inProgressDir string, completedDir string, currentDateTimeGetter libtime.CurrentDateTimeGetter, ) SpecApproveCommand
NewSpecApproveCommand creates a new SpecApproveCommand.
type SpecCompleteCommand ¶ added in v0.23.2
SpecCompleteCommand executes the spec complete subcommand.
func NewSpecCompleteCommand ¶ added in v0.23.2
func NewSpecCompleteCommand( inboxDir string, inProgressDir string, completedDir string, currentDateTimeGetter libtime.CurrentDateTimeGetter, ) SpecCompleteCommand
NewSpecCompleteCommand creates a new SpecCompleteCommand.
type SpecEntry ¶ added in v0.17.23
type SpecEntry struct {
Status string `json:"status"`
File string `json:"file"`
PromptsCompleted int `json:"prompts_completed"`
PromptsTotal int `json:"prompts_total"`
}
SpecEntry represents a single spec entry in the list output.
type SpecListCommand ¶ added in v0.17.23
SpecListCommand executes the spec list subcommand.
func NewSpecListCommand ¶ added in v0.17.23
func NewSpecListCommand(lister specpkg.Lister, counter prompt.Counter) SpecListCommand
NewSpecListCommand creates a new SpecListCommand.
type SpecRejectCommand ¶ added in v0.134.0
SpecRejectCommand executes the spec reject subcommand.
func NewSpecRejectCommand ¶ added in v0.134.0
func NewSpecRejectCommand( specsInboxDir string, specsInProgressDir string, specsRejectedDir string, promptsInboxDir string, promptsInProgressDir string, promptsCompletedDir string, promptsRejectedDir string, promptManager PromptManager, currentDateTimeGetter libtime.CurrentDateTimeGetter, ) SpecRejectCommand
NewSpecRejectCommand creates a new SpecRejectCommand.
type SpecShowCommand ¶ added in v0.25.0
SpecShowCommand executes the spec show subcommand.
func NewSpecShowCommand ¶ added in v0.25.0
func NewSpecShowCommand( inboxDir, inProgressDir, completedDir string, counter prompt.Counter, currentDateTimeGetter libtime.CurrentDateTimeGetter, ) SpecShowCommand
NewSpecShowCommand creates a new SpecShowCommand.
type SpecShowOutput ¶ added in v0.25.0
type SpecShowOutput struct {
File string `json:"file"`
Status string `json:"status"`
Approved string `json:"approved,omitempty"`
Prompted string `json:"prompted,omitempty"`
Verifying string `json:"verifying,omitempty"`
Completed string `json:"completed,omitempty"`
PromptsCompleted int `json:"prompts_completed"`
PromptsTotal int `json:"prompts_total"`
}
SpecShowOutput holds all fields for JSON output.
type SpecStatusCommand ¶ added in v0.17.23
SpecStatusCommand executes the spec status subcommand.
func NewSpecStatusCommand ¶ added in v0.17.23
func NewSpecStatusCommand(lister spec.Lister, counter prompt.Counter) SpecStatusCommand
NewSpecStatusCommand creates a new SpecStatusCommand.
type SpecUnapproveCommand ¶ added in v0.78.0
SpecUnapproveCommand executes the spec unapprove subcommand.
func NewSpecUnapproveCommand ¶ added in v0.78.0
func NewSpecUnapproveCommand( inboxDir string, inProgressDir string, promptsInboxDir string, promptsInProgressDir string, promptManager PromptManager, currentDateTimeGetter libtime.CurrentDateTimeGetter, ) SpecUnapproveCommand
NewSpecUnapproveCommand creates a new SpecUnapproveCommand.
type StatusCommand ¶
StatusCommand executes the status subcommand.
func NewStatusCommand ¶
func NewStatusCommand(checker status.Checker, formatter status.Formatter) StatusCommand
NewStatusCommand creates a new StatusCommand.
type UnapproveCommand ¶ added in v0.77.0
UnapproveCommand executes the unapprove subcommand.
func NewUnapproveCommand ¶ added in v0.77.0
func NewUnapproveCommand( inboxDir string, queueDir string, promptManager PromptManager, ) UnapproveCommand
NewUnapproveCommand creates a new UnapproveCommand.
Source Files
¶
- approve.go
- cancel.go
- combined_list.go
- combined_status.go
- doc.go
- kill.go
- list.go
- prompt_complete.go
- prompt_finder.go
- prompt_manager.go
- prompt_show.go
- reject.go
- requeue.go
- scenario_list.go
- scenario_show.go
- scenario_status.go
- spec_approve.go
- spec_complete.go
- spec_finder.go
- spec_list.go
- spec_reject.go
- spec_show.go
- spec_status.go
- spec_unapprove.go
- status.go
- unapprove.go