output

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
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

func BulletList(items []string, indent int) []string

BulletList formats items as a bulleted list with optional indentation

func DependencyLine added in v0.4.6

func DependencyLine(issue *models.Issue, showResolved bool) string

DependencyLine formats a dependency with optional status mark e.g., " td-abc1: Title [status] ✓"

func Error

func Error(format string, args ...interface{})

Error prints an error message

func FormatGitState

func FormatGitState(sha, branch string, dirty int) string

FormatGitState formats git state for display

func FormatIssueDeleted

func FormatIssueDeleted(issue *models.Issue) string

FormatIssueDeleted formats a deleted issue showing [deleted] marker instead of status

func FormatIssueLong

func FormatIssueLong(issue *models.Issue, logs []models.Log, handoff *models.Handoff) string

FormatIssueLong formats an issue in long format

func FormatIssueShort

func FormatIssueShort(issue *models.Issue) string

FormatIssueShort formats an issue in short format

func FormatPoints

func FormatPoints(points int) string

FormatPoints returns empty string if points is 0, otherwise "Npts"

func FormatPointsSuffix

func FormatPointsSuffix(points int) string

FormatPointsSuffix returns " Npts" if points > 0, empty string otherwise Useful for appending to format strings

func FormatPriority

func FormatPriority(p models.Priority) string

FormatPriority formats a priority

func FormatStatus

func FormatStatus(s models.Status) string

FormatStatus formats a status with color

func FormatTimeAgo

func FormatTimeAgo(t time.Time) string

FormatTimeAgo formats a time as a human-readable "ago" string

func IndentLines added in v0.4.6

func IndentLines(lines []string, spaces int) []string

IndentLines indents each line by the specified number of spaces

func IndentString added in v0.4.6

func IndentString(s string, spaces int) string

IndentString indents each line in a string by the specified number of spaces

func Info

func Info(format string, args ...interface{})

Info prints an info message

func IssueOneLiner added in v0.4.6

func IssueOneLiner(issue *models.Issue) string

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

func IssueOneLinerPlain(issue *models.Issue) string

IssueOneLinerPlain returns issue one-liner without status styling (for text contexts)

func JSON

func JSON(v interface{}) error

JSON outputs data as JSON

func JSONError

func JSONError(code, message string)

JSONError outputs an error as JSON

func JSONErrorWithDetails

func JSONErrorWithDetails(code, message string, details map[string]interface{})

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

func RenderChildrenList(nodes []TreeNode) []string

RenderChildrenList renders children in a simple list format This matches the CHILDREN section output in show.go

func RenderMarkdown added in v0.19.0

func RenderMarkdown(text string) (string, error)

RenderMarkdown renders markdown using Glamour with terminal-aware wrapping.

func RenderMarkdownWithWidth added in v0.19.0

func RenderMarkdownWithWidth(text string, width int) (string, error)

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

func SectionHeader(title string) string

SectionHeader returns a formatted section header for CLI output e.g., "\nDEPENDENCIES:\n"

func ShortSHA

func ShortSHA(sha string) string

ShortSHA safely shortens a git SHA to 7 characters or returns as-is if shorter

func StatusBadge added in v0.4.6

func StatusBadge(status models.Status) string

StatusBadge returns a status indicator with symbol e.g., "○ open", "▶ in_progress", "✓ closed", "✗ blocked", "◎ in_review"

func Success

func Success(format string, args ...interface{})

Success prints a success message

func TerminalWidth added in v0.19.0

func TerminalWidth(fallback int) int

TerminalWidth returns the current terminal width or a fallback when unavailable.

func Warning

func Warning(format string, args ...interface{})

Warning prints a warning message

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

Jump to

Keyboard shortcuts

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