NAME
api - private built-in command wrapper for Developer Dashboard
SYNOPSIS
d2 api ...
DESCRIPTION
This private helper is staged under ~/.developer-dashboard/cli/dd/ so the public d2 entrypoint can stay a thin switchboard.
PURPOSE
This staged helper exposes d2 api management commands for layered config/api.json files, including API-key secret hashing and saved Ajax route allowlists.
WHY IT EXISTS
It exists because machine-auth API configuration is part of the built-in CLI surface, but the public switchboard should only dispatch to a staged helper instead of embedding config-mutation logic directly in bin/d2.
WHEN TO USE
Use this file when changing the d2 api command surface or when fixing how API-key administration is routed into the private runtime.
HOW TO USE
Users run d2 api, d2 api add, or d2 api rm. The staged helper forwards the raw argv list into the private built-in runtime, which loads the API CLI module and updates the deepest writable OOP config layer.
WHAT USES IT
It is used by operators managing machine-auth API groups, by CLI smoke tests, and by staged-helper coverage tests.
EXAMPLES
Example 1:
d2 api
List the effective API registry through the public built-in command path.
Example 2:
d2 api add --key bot --secret raw-secret --route /ajax/health
Create or update one API group from the staged helper path.
Example 3:
prove -lv t/05-cli-smoke.t t/30-dashboard-loader.t
Rerun the focused staged-helper and thin-loader tests after changing helper dispatch behavior.
Example 4:
prove -lr t
Verify that the helper still behaves correctly inside the complete repository suite.