NAME
Developer::Dashboard::CLI::Paths - lightweight path and paths helper dispatch
SYNOPSIS
use Developer::Dashboard::CLI::Paths qw(run_paths_command);
run_paths_command(command => 'paths', args => \@ARGV);
DESCRIPTION
Implements the lightweight dashboard path and dashboard paths commands so the public entrypoint can hand off path-related work to an extracted helper script under ~/.developer-dashboard/cli/. That includes the shared target-selection logic used by shell helpers such as cdr and which_dir.
FUNCTIONS
run_paths_command
Dispatch the path helper command.
PURPOSE
This module is the command runtime behind dashboard paths and dashboard path .... It prints the active runtime roots, resolves named aliases, persists alias add/delete operations, and computes the JSON payload used by shell helpers such as cdr and which_dir.
WHY IT EXISTS
It exists because path reporting and shell-navigation semantics should live in Perl, not in duplicated shell code. That keeps the layered runtime rules, alias loading, and regex-based directory narrowing consistent across bash, zsh, POSIX sh, and PowerShell.
WHEN TO USE
Use this file when changing the output of dashboard paths, the behavior of dashboard path resolve/add/del/list/project-root, or the cdr payload contract consumed by shell helpers.
HOW TO USE
Call run_paths_command with the public command name and argv list. The module builds a lightweight path registry, loads configured aliases on demand, and returns either JSON payloads or newline-delimited path output depending on the selected subcommand. For dashboard path cdr, the first argument is treated as a saved alias when one exists; otherwise it becomes the first search regex under the current directory. Any remaining narrowing terms are case-insensitive regexes and all of them must match a candidate path. A single match becomes the target directory; multiple matches are returned as a list while the target stays at the alias root or current directory.
WHAT USES IT
It is used by the staged path helpers, by the shell bootstrap generated from _dashboard-core, and by tests that cover alias resolution, regex narrowing, current-directory fallback, layered runtime lookup, and platform-portable shell output.
EXAMPLES
dashboard paths
dashboard path resolve bookmarks
dashboard path cdr project alpha ".*service"
dashboard path add work ~/projects/work
dashboard path list