NAME

Developer::Dashboard::CLI::Ticket - private tmux ticket helper for Developer Dashboard

SYNOPSIS

use Developer::Dashboard::CLI::Ticket qw(run_ticket_command);
run_ticket_command( args => \@ARGV );

DESCRIPTION

Provides the shared implementation behind the private ticket helper staged under ~/.developer-dashboard/cli/dd/ so dashboard ticket can stay part of the dashboard toolchain without installing a public top-level executable.

PURPOSE

This module owns the ticket-session runtime behind dashboard ticket. It resolves the requested ticket reference, builds the tmux environment for that ticket, decides whether the session already exists, creates the session when needed, and attaches the terminal to the chosen ticket session.

WHY IT EXISTS

It exists because ticket-session behavior needs to stay deterministic and testable. Keeping session naming, environment variables, create-vs-attach decisions, and tmux error handling in one module prevents wrappers and prompt helpers from inventing different rules.

WHEN TO USE

Use this file when changing how dashboard ticket chooses the ticket name, what tmux environment variables it seeds, or how create/attach failures are reported back to the user.

HOW TO USE

Call run_ticket_command from the staged helper, passing the raw argv list. With an explicit ticket argument, that becomes both the tmux session name and the seeded TICKET_REF/B/OB environment set. Without an explicit argument, the module falls back to $ENV{TICKET_REF} when present. If the session does not exist it creates a detached Code1 window in the current working directory before attaching; if the session already exists it skips creation and attaches directly.

WHAT USES IT

It is used by the dashboard ticket helper, by prompt/bootstrap flows that want consistent ticket-session environment variables, and by regression tests that verify explicit ticket selection, environment fallback, and tmux create/attach error handling.

EXAMPLES

dashboard ticket DD-123
dashboard ticket
TICKET_REF=DD-123 dashboard ticket
dashboard ticket feature-branch-42