Public/Show-DevGrammar.ps1

function Show-DevGrammar {
    <#
    .SYNOPSIS
    Shows the full DevXToolkit command grammar registry.

    .DESCRIPTION
    Returns the versioned command grammar: semantic ID, canonical function,
    human alias, verb/object/domain, parameters, output type, side effects,
    and status for every registered command. This is the machine-readable
    surface external tooling (including a future eLan binding) can consume.

    .PARAMETER Json
    Emits the registry as a single JSON string instead of objects.

    .EXAMPLE
    Show-DevGrammar

    .EXAMPLE
    Show-DevGrammar -Json
    #>

    [CmdletBinding()]
    [OutputType([PSCustomObject], [string])]
    param(
        [switch]$Json
    )

    $grammar = [PSCustomObject]@{
        GrammarVersion = Get-DevXToolkitGrammarVersion
        Commands       = Get-DevXToolkitGrammar
    }

    if ($Json) {
        $grammar | ConvertTo-Json -Depth 6
    }
    else {
        $grammar
    }
}