Documentation
¶
Index ¶
- Constants
- func BulletList(items []string, indent int) []string
- func DependencyLine(issue *models.Issue, showResolved bool) string
- func Error(format string, args ...interface{})
- func FormatGitState(sha, branch string, dirty int) string
- func FormatIssueDeleted(issue *models.Issue) string
- func FormatIssueLong(issue *models.Issue, logs []models.Log, handoff *models.Handoff) string
- func FormatIssueShort(issue *models.Issue) string
- func FormatPoints(points int) string
- func FormatPointsSuffix(points int) string
- func FormatPriority(p models.Priority) string
- func FormatStatus(s models.Status) string
- func FormatTimeAgo(t time.Time) string
- func IndentLines(lines []string, spaces int) []string
- func IndentString(s string, spaces int) string
- func Info(format string, args ...interface{})
- func IssueOneLiner(issue *models.Issue) string
- func IssueOneLinerPlain(issue *models.Issue) string
- func JSON(v interface{}) error
- func JSONError(code, message string)
- func JSONErrorWithDetails(code, message string, details map[string]interface{})
- func RenderBlockedTree(nodes []TreeNode, opts TreeRenderOptions, directOnly bool) string
- func RenderChildrenList(nodes []TreeNode) []string
- func RenderMarkdown(text string) (string, error)
- func RenderMarkdownWithWidth(text string, width int) (string, error)
- func RenderTree(root TreeNode, opts TreeRenderOptions) string
- func RenderTreeLines(roots []TreeNode, opts TreeRenderOptions) []string
- func SectionHeader(title string) string
- func ShortSHA(sha string) string
- func StatusBadge(status models.Status) string
- func Success(format string, args ...interface{})
- func TerminalWidth(fallback int) int
- func Warning(format string, args ...interface{})
- type OutputMode
- type TreeNode
- type TreeRenderOptions
Constants ¶
const ( ErrCodeNotFound = "not_found" ErrCodeInvalidInput = "invalid_input" ErrCodeConflict = "conflict" ErrCodeCannotSelfApprove = "cannot_self_approve" ErrCodeHandoffRequired = "handoff_required" ErrCodeDatabaseError = "database_error" ErrCodeGitError = "git_error" ErrCodeNoActiveSession = "no_active_session" )
Error codes for structured JSON output
Variables ¶
This section is empty.
Functions ¶
func BulletList ¶ added in v0.4.6
BulletList formats items as a bulleted list with optional indentation
func DependencyLine ¶ added in v0.4.6
DependencyLine formats a dependency with optional status mark e.g., " td-abc1: Title [status] ✓"
func FormatGitState ¶
FormatGitState formats git state for display
func FormatIssueDeleted ¶
FormatIssueDeleted formats a deleted issue showing [deleted] marker instead of status
func FormatIssueLong ¶
FormatIssueLong formats an issue in long format
func FormatIssueShort ¶
FormatIssueShort formats an issue in short format
func FormatPoints ¶
FormatPoints returns empty string if points is 0, otherwise "Npts"
func FormatPointsSuffix ¶
FormatPointsSuffix returns " Npts" if points > 0, empty string otherwise Useful for appending to format strings
func FormatPriority ¶
FormatPriority formats a priority
func FormatStatus ¶
FormatStatus formats a status with color
func FormatTimeAgo ¶
FormatTimeAgo formats a time as a human-readable "ago" string
func IndentLines ¶ added in v0.4.6
IndentLines indents each line by the specified number of spaces
func IndentString ¶ added in v0.4.6
IndentString indents each line in a string by the specified number of spaces
func IssueOneLiner ¶ added in v0.4.6
IssueOneLiner returns a concise single-line issue representation Format: "td-abc1: Title [status]" or "td-abc1 \"Title\" [status]" with quotes
func IssueOneLinerPlain ¶ added in v0.4.6
IssueOneLinerPlain returns issue one-liner without status styling (for text contexts)
func JSONErrorWithDetails ¶
JSONErrorWithDetails outputs an error as JSON with additional context
func RenderBlockedTree ¶ added in v0.4.2
func RenderBlockedTree(nodes []TreeNode, opts TreeRenderOptions, directOnly bool) string
RenderBlockedTree renders a blocked-by tree with "blocks:" header This matches the output format of printBlockedTree in dependencies.go
func RenderChildrenList ¶ added in v0.4.2
RenderChildrenList renders children in a simple list format This matches the CHILDREN section output in show.go
func RenderMarkdown ¶ added in v0.19.0
RenderMarkdown renders markdown using Glamour with terminal-aware wrapping.
func RenderMarkdownWithWidth ¶ added in v0.19.0
RenderMarkdownWithWidth renders markdown using Glamour with explicit wrapping.
func RenderTree ¶ added in v0.4.2
func RenderTree(root TreeNode, opts TreeRenderOptions) string
RenderTree renders a tree starting from a single root node Returns the complete tree as a string (without the root - just children)
func RenderTreeLines ¶ added in v0.4.2
func RenderTreeLines(roots []TreeNode, opts TreeRenderOptions) []string
RenderTreeLines renders multiple root nodes and returns individual lines Useful for embedding trees in other output
func SectionHeader ¶ added in v0.4.6
SectionHeader returns a formatted section header for CLI output e.g., "\nDEPENDENCIES:\n"
func StatusBadge ¶ added in v0.4.6
StatusBadge returns a status indicator with symbol e.g., "○ open", "▶ in_progress", "✓ closed", "✗ blocked", "◎ in_review"
func TerminalWidth ¶ added in v0.19.0
TerminalWidth returns the current terminal width or a fallback when unavailable.
Types ¶
type OutputMode ¶
type OutputMode int
OutputMode determines output format
const ( ModeShort OutputMode = iota ModeLong ModeJSON )
type TreeNode ¶ added in v0.4.2
type TreeNode struct {
ID string
Title string
Type models.Type
Status models.Status
Children []TreeNode
}
TreeNode represents a node in a tree structure for rendering
type TreeRenderOptions ¶ added in v0.4.2
type TreeRenderOptions struct {
MaxDepth int // 0 = unlimited
ShowStatus bool // Whether to show status indicator
ShowType bool // Whether to show issue type
Indentation int // Base indentation level (for nested contexts)
}
TreeRenderOptions configures tree rendering behavior