Private/Dispatch/Get-AvmVerbRegistry.ps1
|
function Get-AvmVerbRegistry { <# .SYNOPSIS Returns the verb -> cmdlet routing table for the avm CLI. .DESCRIPTION Single source of truth for which CLI verbs the dispatcher knows about. Each entry has: - Path: array of lowercase verb tokens, e.g. @('tool', 'install'). - Cmdlet: the approved-verb cmdlet name to invoke. - Summary: one-line help string used by 'avm' with no arguments. Tokens are matched case-sensitively to keep the CLI surface predictable across case-sensitive (Linux) and case-preserving (Windows / macOS) filesystems and shells. #> [CmdletBinding()] [OutputType([pscustomobject[]])] param() [pscustomobject[]]@( [pscustomobject]@{ Path = [string[]]@('version') Cmdlet = 'Get-AvmVersion' Summary = 'Print module, runtime and OS version info.' } [pscustomobject]@{ Path = [string[]]@('doctor') Cmdlet = 'Invoke-AvmDoctor' Summary = 'Diagnose the local environment.' } [pscustomobject]@{ Path = [string[]]@('tool', 'list') Cmdlet = 'Get-AvmTool' Summary = 'List managed tools and their install status.' } [pscustomobject]@{ Path = [string[]]@('tool', 'which') Cmdlet = 'Get-AvmTool' Summary = 'Show the cached path for a managed tool.' } [pscustomobject]@{ Path = [string[]]@('tool', 'install') Cmdlet = 'Install-AvmTool' Summary = 'Download and verify a managed tool into the cache.' } [pscustomobject]@{ Path = [string[]]@('context') Cmdlet = 'Get-AvmModuleContext' Summary = 'Classify the current directory as a Bicep or Terraform module.' } [pscustomobject]@{ Path = [string[]]@('format') Cmdlet = 'Invoke-AvmFormat' Summary = 'Format the current module via the resolved engine.' } [pscustomobject]@{ Path = [string[]]@('lint') Cmdlet = 'Invoke-AvmLint' Summary = 'Lint the current module via the resolved engine.' } [pscustomobject]@{ Path = [string[]]@('test') Cmdlet = 'Invoke-AvmTest' Summary = 'Build/validate the current module via the resolved engine.' } [pscustomobject]@{ Path = [string[]]@('test', 'unit') Cmdlet = 'Invoke-AvmTestUnit' Summary = 'Run the terraform unit test tier (tests/unit).' } [pscustomobject]@{ Path = [string[]]@('test', 'integration') Cmdlet = 'Invoke-AvmTestIntegration' Summary = 'Run the terraform integration test tier (tests/integration).' } [pscustomobject]@{ Path = [string[]]@('test', 'e2e') Cmdlet = 'Invoke-AvmTestE2e' Summary = 'Run the terraform e2e test tier (deploy/idempotency/destroy per example).' } [pscustomobject]@{ Path = [string[]]@('docs') Cmdlet = 'Invoke-AvmDocs' Summary = 'Generate or refresh README docs via the resolved engine.' } [pscustomobject]@{ Path = [string[]]@('sync') Cmdlet = 'Invoke-AvmSync' Summary = 'Sync managed files from the AVM governance source (terraform).' } [pscustomobject]@{ Path = [string[]]@('transform') Cmdlet = 'Invoke-AvmTransform' Summary = 'Apply the mapotf pre-commit transforms to the current module.' } [pscustomobject]@{ Path = [string[]]@('check', 'policy') Cmdlet = 'Invoke-AvmCheckPolicy' Summary = 'Run the pinned AVM policy bundles (APRL, AVMSEC) with conftest.' } [pscustomobject]@{ Path = [string[]]@('check', 'convention') Cmdlet = 'Invoke-AvmCheckConvention' Summary = 'Run the built-in AVM convention rules against the current module.' } [pscustomobject]@{ Path = [string[]]@('pre-commit') Cmdlet = 'Invoke-AvmPreCommit' Summary = 'Run the fast pre-commit gauntlet (terraform: sync, check convention, transform, format, docs; bicep: format, lint, test, docs).' } [pscustomobject]@{ Path = [string[]]@('pr-check') Cmdlet = 'Invoke-AvmPrCheck' Summary = 'Run the full PR gauntlet (sync, format, transform, lint, check policy, check convention, test, docs).' } ) } |