Documentation
¶
Overview ¶
Package create provides the root-level "create" command, which auto-detects its input mode using IOStreams TTY detection: when stdin is a pipe, it delegates to the JSON create path; when stdin is a TTY, it launches the interactive form. This is the convenience entry point — the explicit-mode commands "json create" and "form create" continue to exist independently.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCmd ¶
NewCmd constructs the root-level "create" command, which auto-detects its input mode: when stdin is a pipe, it reads a JSON object and creates the issue (matching "json create" behavior); when stdin is a TTY, it launches the interactive form (matching "form create" behavior).
The --author flag is required for pipe mode (JSON). In TTY mode, the author is collected by the interactive form.
Types ¶
type RunInput ¶
type RunInput struct {
Service driving.Service
Author string
IOStreams *iostreams.IOStreams
WriteTo io.Writer
// FormRunner presents the interactive form and populates data. In
// production this runs the huh TUI; in tests it is replaced with a
// function that sets fields directly. Only used in TTY mode.
FormRunner func(data *formcmd.CreateFormData) error
}
RunInput holds the parameters for the unified create command's core logic, decoupled from CLI flag parsing so it can be tested directly.