Skip to main content

Module format

Module format 

Source
Expand description

Output formatting for beads_rust.

Supports human-readable text output, machine-parseable JSON, and CSV export. Robot mode sends clean JSON to stdout with diagnostics to stderr.

§Output Types

These types match the classic bd JSON schemas for CLI compatibility:

§CSV Output

The csv module provides CSV formatting with:

  • Configurable field selection via --fields
  • Proper escaping of commas, quotes, and newlines

§Rich Output

The rich module provides enhanced terminal output using rich_rust:

  • Tables with styled columns for issue lists
  • Panels for detailed issue views
  • Trees for dependency visualization
  • Consistent theming via Theme

Output mode is determined by OutputContext:

  • Rich: TTY with colors enabled
  • Plain: TTY with --no-color or not a TTY
  • JSON: --json flag
  • Quiet: --quiet flag

Re-exports§

pub use crate::output::OutputContext;
pub use crate::output::OutputMode;
pub use theme::Theme;
pub use syntax::available_themes;
pub use syntax::detect_language_from_filename;
pub use syntax::highlight_code;
pub use syntax::parse_code_fence;
pub use syntax::supported_languages;
pub use markdown::contains_markdown;
pub use markdown::escape_markdown;
pub use markdown::render_markdown;

Modules§

csv
CSV formatting for beads_rust.
markdown
Markdown rendering for descriptions and comments.
rich
Rich terminal output components using rich_rust.
syntax
Syntax highlighting for code blocks.
theme
Theme and color definitions for rich output.

Structs§

BlockedIssue
Blocked issue for blocked view.
BlockedIssueOutput
Minimal issue output for blocked command (bd parity).
Breakdown
Breakdown statistics by a dimension.
BreakdownEntry
A single entry in a breakdown.
IssueDetails
Issue details with full relations for show view.
IssueWithCounts
Issue with counts for list/search views.
IssueWithDependencyMetadata
ListPage
Paginated list response envelope for br list --json.
ReadyIssue
Minimal issue output for ready command (bd parity).
RecentActivity
Recent activity statistics from git history.
StaleIssue
Minimal issue output for stale command (bd parity). Contains only the fields that bd’s stale command outputs.
Statistics
Aggregate statistics output.
StatsSummary
Summary statistics for the project.
TextFormatOptions
Formatting options for text output.
TreeNode
Tree node for dependency tree view.

Functions§

format_issue_line
Format a single-line issue summary.
format_issue_line_with
Format a single-line issue summary with options.
format_issue_long_with
Format an issue as a multi-line long text block.
format_issue_pretty_with
Format an issue as a tree-style pretty text block.
format_priority
Format priority as “P0”, “P1”, etc.
format_priority_badge
Format priority badge with optional color.
format_priority_label
Format priority label with optional color.
format_status_icon
Return the icon character for a status.
format_status_icon_colored
Format status icon with optional color.
format_status_label
Format status label with optional color.
format_type_badge
Format issue type as a bracketed badge.
format_type_badge_colored
Format issue type badge with optional color.
sanitize_terminal_inline
Escape terminal control characters before rendering untrusted text.
sanitize_terminal_text
Escape terminal control characters before rendering trusted line structure.
terminal_width
Determine terminal width from environment (falls back to 80).
truncate_title
Truncate a title to fit within max_len visible columns.