NAME

path - private path helper for Developer Dashboard

SYNOPSIS

d2 path <resolve|locate|add|del|rm|project-root|list> ...

DESCRIPTION

This private helper is staged under ~/.developer-dashboard/cli/dd/ so the main d2 command can keep path registry operations available without loading the full runtime first.

PURPOSE

This staged helper exposes the d2 path ... subcommand family: resolve, locate, cdr, complete-cdr, add, del, rm, project-root, and list. It is the public CLI front end for saved path aliases, layered runtime path discovery, and the payload generation used by shell navigation helpers.

WHY IT EXISTS

It exists because path alias and navigation commands are built-ins, but the actual lookup and regex narrowing rules need to live in Perl so bash, zsh, POSIX sh, and PowerShell all use the same behavior.

WHEN TO USE

Use this file when changing d2 path verbs, staged-helper argv handling, or the examples that describe alias resolution and cdr-style regex narrowing.

HOW TO USE

Users run d2 path <verb> .... The staged helper loads the path command runtime and prints either JSON or line-oriented output. For d2 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 arguments are case-insensitive regexes and all of them must match a candidate directory path. d2 path complete-cdr takes a shell completion index plus raw shell words and prints newline-delimited alias or directory-basename candidates for the generated cdr, dd_cdr, and which_dir shell helpers.

WHAT USES IT

It is used by the public path command family, by shell bootstraps that depend on d2 path cdr, and by path/cdr regression tests that verify alias lookup, current-directory fallback, and multiple-match behavior.

EXAMPLES

d2 path resolve dashboards
d2 path add work ~/projects/work
d2 path add .
d2 path cdr work alpha red
d2 path complete-cdr 2 cdr work alp
d2 path rm work
d2 path list
d2 path project-root