diff --git a/RackPeek.Domain/UseCases/Mermaid/MermaidDiagramExportUseCase.cs b/RackPeek.Domain/UseCases/Mermaid/MermaidDiagramExportUseCase.cs new file mode 100644 index 00000000..56c7836f --- /dev/null +++ b/RackPeek.Domain/UseCases/Mermaid/MermaidDiagramExportUseCase.cs @@ -0,0 +1,19 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using RackPeek.Domain.Resources; +using RackPeek.Domain.Persistence; + +namespace RackPeek.Domain.UseCases.Mermaid { + public class MermaidDiagramExportUseCase : IUseCase { + private readonly IResourceCollection _repository; + + public MermaidDiagramExportUseCase(IResourceCollection repository) { + _repository = repository; + } + + public async Task ExecuteAsync(MermaidExportOptions options) { + IReadOnlyList resources = await _repository.GetAllOfTypeAsync(); + return resources.ToMermaidDiagram(options); + } + } +} diff --git a/RackPeek.Domain/UseCases/Mermaid/MermaidDiagramGenerator.cs b/RackPeek.Domain/UseCases/Mermaid/MermaidDiagramGenerator.cs new file mode 100644 index 00000000..e9f21d48 --- /dev/null +++ b/RackPeek.Domain/UseCases/Mermaid/MermaidDiagramGenerator.cs @@ -0,0 +1,84 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using RackPeek.Domain.Resources; + +namespace RackPeek.Domain.UseCases.Mermaid { + public static class MermaidDiagramGenerator { + public static MermaidExportResult ToMermaidDiagram( + this IReadOnlyList resources, + MermaidExportOptions? options = null) { + MermaidExportOptions resolvedOptions = options ?? new MermaidExportOptions(); + var sb = new StringBuilder(); + var warnings = new List(); + + sb.AppendLine(resolvedOptions.DiagramType); + + // Group resources by Kind + IOrderedEnumerable> grouped = resources + .Where(r => resolvedOptions.IncludeTags.Count == 0 + || (r.Tags != null && r.Tags.Any(t => resolvedOptions.IncludeTags.Contains(t, StringComparer.OrdinalIgnoreCase)))) + .GroupBy(r => Resource.KindToPlural(r.Kind)) + .OrderBy(g => g.Key); + + foreach (IGrouping group in grouped) { + sb.AppendLine($" subgraph {SanitizeId(group.Key)}"); + foreach (Resource r in group.OrderBy(x => x.Name)) { + var nodeId = SanitizeId(r.Name); + var label = BuildNodeLabel(r, resolvedOptions); + sb.AppendLine($" {nodeId}[\"{label}\"]"); + } + sb.AppendLine(" end"); + } + + // Map RunsOn relationships if requested + if (resolvedOptions.IncludeEdges) { + + var resourceLookup = resources.ToDictionary(r => r.Name, r => SanitizeId(r.Name), StringComparer.OrdinalIgnoreCase); + + foreach (Resource r in resources) { + var nodeId = SanitizeId(r.Name); + foreach (var depName in r.RunsOn) { + if (resourceLookup.TryGetValue(depName, out var depId)) + { + sb.AppendLine($" {nodeId} --> {depId}"); + } + else + { + warnings.Add($"RunsOn reference '{depName}' for '{r.Name}' not found in resources"); + } + } + } + } + + if (sb.Length == 0) + warnings.Add("No Mermaid diagram entries generated."); + + return new MermaidExportResult(sb.ToString().TrimEnd(), warnings); + } + + private static string BuildNodeLabel(Resource r, MermaidExportOptions options) { + if (!options.IncludeLabels) + return r.Name; + + IEnumerable> filtered = options.LabelWhitelist is null + ? r.Labels + : r.Labels.Where(kvp => options.LabelWhitelist.Contains(kvp.Key, StringComparer.OrdinalIgnoreCase)); + + var labelParts = filtered.Select(kvp => $"{kvp.Key}: {kvp.Value}").ToList(); + return labelParts.Count == 0 ? r.Name : $"{r.Name}\\n{string.Join("\\n", labelParts)}"; + } + + private static string SanitizeId(string name) { + var sb = new StringBuilder(); + foreach (var ch in name.Trim().ToLowerInvariant()) { + if (char.IsLetterOrDigit(ch) || ch == '_') + sb.Append(ch); + else if (ch == '-' || ch == '.' || ch == ' ') + sb.Append('_'); + } + return sb.Length == 0 ? "node" : sb.ToString(); + } + } +} diff --git a/RackPeek.Domain/UseCases/Mermaid/MermaidExportOptions.cs b/RackPeek.Domain/UseCases/Mermaid/MermaidExportOptions.cs new file mode 100644 index 00000000..a221a76c --- /dev/null +++ b/RackPeek.Domain/UseCases/Mermaid/MermaidExportOptions.cs @@ -0,0 +1,35 @@ +using System.Collections.Generic; + +namespace RackPeek.Domain.UseCases.Mermaid { + public sealed record MermaidExportOptions { + /// + /// Only include resources with these tags (optional) + /// + public IReadOnlyList IncludeTags { get; init; } = new List(); + + /// + /// Diagram type: "flowchart", "sequence", "class", "er", etc. + /// Default: flowchart TD + /// + public string DiagramType { get; init; } = "flowchart TD"; + + /// + /// Whether to include resource labels as annotations + /// + public bool IncludeLabels { get; init; } = true; + + /// + /// Whether to include relationships (edges) + /// + public bool IncludeEdges { get; init; } = true; + + /// + /// Optional label keys to include (null = include all) + /// + public IReadOnlyList? LabelWhitelist { get; init; } + } + + public sealed record MermaidExportResult( + string DiagramText, + IReadOnlyList Warnings); +} diff --git a/Shared.Rcl/CliBootstrap.cs b/Shared.Rcl/CliBootstrap.cs index 5f4e8de5..aa9b43d3 100644 --- a/Shared.Rcl/CliBootstrap.cs +++ b/Shared.Rcl/CliBootstrap.cs @@ -6,9 +6,9 @@ using RackPeek.Domain.Persistence; using RackPeek.Domain.Persistence.Yaml; using Shared.Rcl.Commands; +using Shared.Rcl.Commands.Connections; using Shared.Rcl.Commands.AccessPoints; using Shared.Rcl.Commands.AccessPoints.Labels; -using Shared.Rcl.Commands.Connections; using Shared.Rcl.Commands.Desktops; using Shared.Rcl.Commands.Desktops.Cpus; using Shared.Rcl.Commands.Desktops.Drive; @@ -578,7 +578,7 @@ public static void BuildApp(CommandApp app) { hosts.AddCommand("export") .WithDescription("Generate a /etc/hosts compatible file."); }); - + config.AddBranch("connections", connections => { connections.SetDescription("Manage physical or logical port connections."); @@ -588,6 +588,13 @@ public static void BuildApp(CommandApp app) { connections.AddCommand("remove") .WithDescription("Remove the connection from a specific port."); }); + + config.AddBranch("mermaid", mermaid => { + mermaid.SetDescription("Generate Mermaid diagrams from infrastructure."); + + mermaid.AddCommand("export") + .WithDescription("Generate a Mermaid infrastructure diagram."); + }); }); } diff --git a/Shared.Rcl/Commands/Exporters/GenerateMermaidDiagramCommand.cs b/Shared.Rcl/Commands/Exporters/GenerateMermaidDiagramCommand.cs new file mode 100644 index 00000000..ad3df298 --- /dev/null +++ b/Shared.Rcl/Commands/Exporters/GenerateMermaidDiagramCommand.cs @@ -0,0 +1,68 @@ +using Microsoft.Extensions.DependencyInjection; +using RackPeek.Domain.UseCases.Mermaid; +using Spectre.Console; +using Spectre.Console.Cli; + +namespace Shared.Rcl.Commands.Exporters; + +public sealed class GenerateMermaidDiagramCommand(IServiceProvider provider) + : AsyncCommand { + public override async Task ExecuteAsync( + CommandContext context, + GenerateMermaidDiagramSettings settings, + CancellationToken cancellationToken) { + using IServiceScope scope = provider.CreateScope(); + + MermaidDiagramExportUseCase useCase = scope.ServiceProvider + .GetRequiredService(); + + var options = new MermaidExportOptions { + IncludeTags = ParseCsv(settings.IncludeTags), + DiagramType = settings.DiagramType ?? "flowchart TD", + IncludeLabels = !settings.NoLabels, + IncludeEdges = !settings.NoEdges, + LabelWhitelist = ParseCsv(settings.LabelWhitelist) + }; + + MermaidExportResult? result = await useCase.ExecuteAsync(options); + + if (result is null) { + AnsiConsole.MarkupLine("[red]Mermaid export returned null.[/]"); + return -1; + } + + if (result.Warnings.Any()) { + AnsiConsole.MarkupLine("[yellow]Warnings:[/]"); + foreach (var warning in result.Warnings) + AnsiConsole.MarkupLine($"[yellow]- {Markup.Escape(warning)}[/]"); + AnsiConsole.WriteLine(); + } + + if (!string.IsNullOrWhiteSpace(settings.OutputPath)) { + await File.WriteAllTextAsync( + settings.OutputPath, + result.DiagramText, + cancellationToken); + + AnsiConsole.MarkupLine( + $"[green]Mermaid diagram written to:[/] {Markup.Escape(settings.OutputPath)}"); + } + else { + AnsiConsole.MarkupLine("[green]Generated Mermaid Diagram:[/]"); + AnsiConsole.WriteLine(); + AnsiConsole.Write(result.DiagramText); + } + + return 0; + } + + private static IReadOnlyList ParseCsv(string? raw) { + if (string.IsNullOrWhiteSpace(raw)) + return Array.Empty(); + + return raw.Split(',', StringSplitOptions.RemoveEmptyEntries) + .Select(x => x.Trim()) + .Where(x => !string.IsNullOrWhiteSpace(x)) + .ToArray(); + } +} diff --git a/Shared.Rcl/Commands/Exporters/GenerateMermaidDiagramSettings.cs b/Shared.Rcl/Commands/Exporters/GenerateMermaidDiagramSettings.cs new file mode 100644 index 00000000..0ee2a0a9 --- /dev/null +++ b/Shared.Rcl/Commands/Exporters/GenerateMermaidDiagramSettings.cs @@ -0,0 +1,30 @@ +using System.ComponentModel; +using Spectre.Console.Cli; + +namespace Shared.Rcl.Commands.Exporters; + +public sealed class GenerateMermaidDiagramSettings : CommandSettings { + [CommandOption("--include-tags")] + [Description("Comma-separated list of tags to include (e.g. prod,linux)")] + public string? IncludeTags { get; init; } + + [CommandOption("--diagram-type")] + [Description("Mermaid diagram type (default: \"flowchart TD\")")] + public string? DiagramType { get; init; } + + [CommandOption("--no-labels")] + [Description("Disable resource label annotations")] + public bool NoLabels { get; init; } + + [CommandOption("--no-edges")] + [Description("Disable relationship edges")] + public bool NoEdges { get; init; } + + [CommandOption("--label-whitelist")] + [Description("Comma-separated list of label keys to include")] + public string? LabelWhitelist { get; init; } + + [CommandOption("-o|--output")] + [Description("Write Mermaid diagram to file instead of stdout")] + public string? OutputPath { get; init; } +} diff --git a/Shared.Rcl/wwwroot/raw_docs/cli-commands-index.md b/Shared.Rcl/wwwroot/raw_docs/cli-commands-index.md index 5009613b..e5f735f9 100644 --- a/Shared.Rcl/wwwroot/raw_docs/cli-commands-index.md +++ b/Shared.Rcl/wwwroot/raw_docs/cli-commands-index.md @@ -1,142 +1,322 @@ + - [rpk](docs/Commands.md#rpk) - - [summary](docs/Commands.md#rpk-summary) - Show a summarized report of all resources in the system - - [servers](docs/Commands.md#rpk-servers) - Manage servers and their components - - [summary](docs/Commands.md#rpk-servers-summary) - Show a summarized hardware report for all servers - - [add](docs/Commands.md#rpk-servers-add) - Add a new server to the inventory - - [get](docs/Commands.md#rpk-servers-get) - List all servers or retrieve a specific server by name - - [describe](docs/Commands.md#rpk-servers-describe) - Display detailed information about a specific server - - [set](docs/Commands.md#rpk-servers-set) - Update properties of an existing server - - [del](docs/Commands.md#rpk-servers-del) - Delete a server from the inventory - - [tree](docs/Commands.md#rpk-servers-tree) - Display the dependency tree of a server - - [cpu](docs/Commands.md#rpk-servers-cpu) - Manage CPUs attached to a server - - [add](docs/Commands.md#rpk-servers-cpu-add) - Add a CPU to a specific server - - [set](docs/Commands.md#rpk-servers-cpu-set) - Update configuration of a server CPU - - [del](docs/Commands.md#rpk-servers-cpu-del) - Remove a CPU from a server - - [drive](docs/Commands.md#rpk-servers-drive) - Manage drives attached to a server - - [add](docs/Commands.md#rpk-servers-drive-add) - Add a storage drive to a server - - [set](docs/Commands.md#rpk-servers-drive-set) - Update properties of a server drive - - [del](docs/Commands.md#rpk-servers-drive-del) - Remove a drive from a server - - [gpu](docs/Commands.md#rpk-servers-gpu) - Manage GPUs attached to a server - - [add](docs/Commands.md#rpk-servers-gpu-add) - Add a GPU to a server - - [set](docs/Commands.md#rpk-servers-gpu-set) - Update properties of a server GPU - - [del](docs/Commands.md#rpk-servers-gpu-del) - Remove a GPU from a server - - [nic](docs/Commands.md#rpk-servers-nic) - Manage network interface cards (NICs) for a server - - [add](docs/Commands.md#rpk-servers-nic-add) - Add a NIC to a server - - [set](docs/Commands.md#rpk-servers-nic-set) - Update properties of a server NIC - - [del](docs/Commands.md#rpk-servers-nic-del) - Remove a NIC from a server - - [switches](docs/Commands.md#rpk-switches) - Manage network switches - - [summary](docs/Commands.md#rpk-switches-summary) - Show a hardware report for all switches - - [add](docs/Commands.md#rpk-switches-add) - Add a new network switch to the inventory - - [list](docs/Commands.md#rpk-switches-list) - List all switches in the system - - [get](docs/Commands.md#rpk-switches-get) - Retrieve details of a specific switch by name - - [describe](docs/Commands.md#rpk-switches-describe) - Show detailed information about a switch - - [set](docs/Commands.md#rpk-switches-set) - Update properties of a switch - - [del](docs/Commands.md#rpk-switches-del) - Delete a switch from the inventory - - [port](docs/Commands.md#rpk-switches-port) - Manage ports on a network switch - - [add](docs/Commands.md#rpk-switches-port-add) - Add a port to a switch - - [set](docs/Commands.md#rpk-switches-port-set) - Update a switch port - - [del](docs/Commands.md#rpk-switches-port-del) - Remove a port from a switch - - [routers](docs/Commands.md#rpk-routers) - Manage network routers - - [summary](docs/Commands.md#rpk-routers-summary) - Show a hardware report for all routers - - [add](docs/Commands.md#rpk-routers-add) - Add a new network router to the inventory - - [list](docs/Commands.md#rpk-routers-list) - List all routers in the system - - [get](docs/Commands.md#rpk-routers-get) - Retrieve details of a specific router by name - - [describe](docs/Commands.md#rpk-routers-describe) - Show detailed information about a router - - [set](docs/Commands.md#rpk-routers-set) - Update properties of a router - - [del](docs/Commands.md#rpk-routers-del) - Delete a router from the inventory - - [port](docs/Commands.md#rpk-routers-port) - Manage ports on a router - - [add](docs/Commands.md#rpk-routers-port-add) - Add a port to a router - - [set](docs/Commands.md#rpk-routers-port-set) - Update a router port - - [del](docs/Commands.md#rpk-routers-port-del) - Remove a port from a router - - [firewalls](docs/Commands.md#rpk-firewalls) - Manage firewalls - - [summary](docs/Commands.md#rpk-firewalls-summary) - Show a hardware report for all firewalls - - [add](docs/Commands.md#rpk-firewalls-add) - Add a new firewall to the inventory - - [list](docs/Commands.md#rpk-firewalls-list) - List all firewalls in the system - - [get](docs/Commands.md#rpk-firewalls-get) - Retrieve details of a specific firewall by name - - [describe](docs/Commands.md#rpk-firewalls-describe) - Show detailed information about a firewall - - [set](docs/Commands.md#rpk-firewalls-set) - Update properties of a firewall - - [del](docs/Commands.md#rpk-firewalls-del) - Delete a firewall from the inventory - - [port](docs/Commands.md#rpk-firewalls-port) - Manage ports on a firewall - - [add](docs/Commands.md#rpk-firewalls-port-add) - Add a port to a firewall - - [set](docs/Commands.md#rpk-firewalls-port-set) - Update a firewall port - - [del](docs/Commands.md#rpk-firewalls-port-del) - Remove a port from a firewall - - [systems](docs/Commands.md#rpk-systems) - Manage systems and their dependencies - - [summary](docs/Commands.md#rpk-systems-summary) - Show a summary report for all systems - - [add](docs/Commands.md#rpk-systems-add) - Add a new system to the inventory - - [list](docs/Commands.md#rpk-systems-list) - List all systems - - [get](docs/Commands.md#rpk-systems-get) - Retrieve a system by name - - [describe](docs/Commands.md#rpk-systems-describe) - Display detailed information about a system - - [set](docs/Commands.md#rpk-systems-set) - Update properties of a system - - [del](docs/Commands.md#rpk-systems-del) - Delete a system from the inventory - - [tree](docs/Commands.md#rpk-systems-tree) - Display the dependency tree for a system - [accesspoints](docs/Commands.md#rpk-accesspoints) - Manage access points - - [summary](docs/Commands.md#rpk-accesspoints-summary) - Show a hardware report for all access points - [add](docs/Commands.md#rpk-accesspoints-add) - Add a new access point - - [list](docs/Commands.md#rpk-accesspoints-list) - List all access points - - [get](docs/Commands.md#rpk-accesspoints-get) - Retrieve an access point by name + - [add](docs/Commands.md#rpk-accesspoints-add) - Add a new access point + - [del](docs/Commands.md#rpk-accesspoints-del) - Delete an access point + - [del](docs/Commands.md#rpk-accesspoints-del) - Delete an access point - [describe](docs/Commands.md#rpk-accesspoints-describe) - Show detailed information about an access point + - [describe](docs/Commands.md#rpk-accesspoints-describe) - Show detailed information about an access point + - [get](docs/Commands.md#rpk-accesspoints-get) - Retrieve an access point by name + - [get](docs/Commands.md#rpk-accesspoints-get) - Retrieve an access point by name + - [label](docs/Commands.md#rpk-accesspoints-label) - Manage labels on an access point + - [add](docs/Commands.md#rpk-accesspoints-label-add) - Add a label to an access point + - [add](docs/Commands.md#rpk-accesspoints-label-add) - Add a label to an access point + - [remove](docs/Commands.md#rpk-accesspoints-label-remove) - Remove a label from an access point + - [remove](docs/Commands.md#rpk-accesspoints-label-remove) - Remove a label from an access point + - [list](docs/Commands.md#rpk-accesspoints-list) - List all access points + - [list](docs/Commands.md#rpk-accesspoints-list) - List all access points - [set](docs/Commands.md#rpk-accesspoints-set) - Update properties of an access point - - [del](docs/Commands.md#rpk-accesspoints-del) - Delete an access point - - [ups](docs/Commands.md#rpk-ups) - Manage UPS units - - [summary](docs/Commands.md#rpk-ups-summary) - Show a hardware report for all UPS units - - [add](docs/Commands.md#rpk-ups-add) - Add a new UPS unit - - [list](docs/Commands.md#rpk-ups-list) - List all UPS units - - [get](docs/Commands.md#rpk-ups-get) - Retrieve a UPS unit by name - - [describe](docs/Commands.md#rpk-ups-describe) - Show detailed information about a UPS unit - - [set](docs/Commands.md#rpk-ups-set) - Update properties of a UPS unit - - [del](docs/Commands.md#rpk-ups-del) - Delete a UPS unit + - [set](docs/Commands.md#rpk-accesspoints-set) - Update properties of an access point + - [summary](docs/Commands.md#rpk-accesspoints-summary) - Show a hardware report for all access points + - [summary](docs/Commands.md#rpk-accesspoints-summary) - Show a hardware report for all access points + - [ansible](docs/Commands.md#rpk-ansible) - Generate and manage Ansible inventory + - [inventory](docs/Commands.md#rpk-ansible-inventory) - Generate an Ansible inventory + - [inventory](docs/Commands.md#rpk-ansible-inventory) - Generate an Ansible inventory - [desktops](docs/Commands.md#rpk-desktops) - Manage desktop computers and their components - [add](docs/Commands.md#rpk-desktops-add) - Add a new desktop - - [list](docs/Commands.md#rpk-desktops-list) - List all desktops - - [get](docs/Commands.md#rpk-desktops-get) - Retrieve a desktop by name - - [describe](docs/Commands.md#rpk-desktops-describe) - Show detailed information about a desktop - - [set](docs/Commands.md#rpk-desktops-set) - Update properties of a desktop - - [del](docs/Commands.md#rpk-desktops-del) - Delete a desktop from the inventory - - [summary](docs/Commands.md#rpk-desktops-summary) - Show a summarized hardware report for all desktops - - [tree](docs/Commands.md#rpk-desktops-tree) - Display the dependency tree for a desktop + - [add](docs/Commands.md#rpk-desktops-add) - Add a new desktop - [cpu](docs/Commands.md#rpk-desktops-cpu) - Manage CPUs attached to desktops - [add](docs/Commands.md#rpk-desktops-cpu-add) - Add a CPU to a desktop - - [set](docs/Commands.md#rpk-desktops-cpu-set) - Update a desktop CPU + - [add](docs/Commands.md#rpk-desktops-cpu-add) - Add a CPU to a desktop + - [del](docs/Commands.md#rpk-desktops-cpu-del) - Remove a CPU from a desktop - [del](docs/Commands.md#rpk-desktops-cpu-del) - Remove a CPU from a desktop + - [set](docs/Commands.md#rpk-desktops-cpu-set) - Update a desktop CPU + - [set](docs/Commands.md#rpk-desktops-cpu-set) - Update a desktop CPU + - [del](docs/Commands.md#rpk-desktops-del) - Delete a desktop from the inventory + - [del](docs/Commands.md#rpk-desktops-del) - Delete a desktop from the inventory + - [describe](docs/Commands.md#rpk-desktops-describe) - Show detailed information about a desktop + - [describe](docs/Commands.md#rpk-desktops-describe) - Show detailed information about a desktop - [drive](docs/Commands.md#rpk-desktops-drive) - Manage storage drives attached to desktops - [add](docs/Commands.md#rpk-desktops-drive-add) - Add a drive to a desktop - - [set](docs/Commands.md#rpk-desktops-drive-set) - Update a desktop drive + - [add](docs/Commands.md#rpk-desktops-drive-add) - Add a drive to a desktop + - [del](docs/Commands.md#rpk-desktops-drive-del) - Remove a drive from a desktop - [del](docs/Commands.md#rpk-desktops-drive-del) - Remove a drive from a desktop + - [set](docs/Commands.md#rpk-desktops-drive-set) - Update a desktop drive + - [set](docs/Commands.md#rpk-desktops-drive-set) - Update a desktop drive + - [get](docs/Commands.md#rpk-desktops-get) - Retrieve a desktop by name + - [get](docs/Commands.md#rpk-desktops-get) - Retrieve a desktop by name - [gpu](docs/Commands.md#rpk-desktops-gpu) - Manage GPUs attached to desktops - [add](docs/Commands.md#rpk-desktops-gpu-add) - Add a GPU to a desktop - - [set](docs/Commands.md#rpk-desktops-gpu-set) - Update a desktop GPU + - [add](docs/Commands.md#rpk-desktops-gpu-add) - Add a GPU to a desktop - [del](docs/Commands.md#rpk-desktops-gpu-del) - Remove a GPU from a desktop + - [del](docs/Commands.md#rpk-desktops-gpu-del) - Remove a GPU from a desktop + - [set](docs/Commands.md#rpk-desktops-gpu-set) - Update a desktop GPU + - [set](docs/Commands.md#rpk-desktops-gpu-set) - Update a desktop GPU + - [label](docs/Commands.md#rpk-desktops-label) - Manage labels on a desktop + - [add](docs/Commands.md#rpk-desktops-label-add) - Add a label to a desktop + - [add](docs/Commands.md#rpk-desktops-label-add) - Add a label to a desktop + - [remove](docs/Commands.md#rpk-desktops-label-remove) - Remove a label from a desktop + - [remove](docs/Commands.md#rpk-desktops-label-remove) - Remove a label from a desktop + - [list](docs/Commands.md#rpk-desktops-list) - List all desktops + - [list](docs/Commands.md#rpk-desktops-list) - List all desktops - [nic](docs/Commands.md#rpk-desktops-nic) - Manage network interface cards (NICs) for desktops - [add](docs/Commands.md#rpk-desktops-nic-add) - Add a NIC to a desktop - - [set](docs/Commands.md#rpk-desktops-nic-set) - Update a desktop NIC + - [add](docs/Commands.md#rpk-desktops-nic-add) - Add a NIC to a desktop - [del](docs/Commands.md#rpk-desktops-nic-del) - Remove a NIC from a desktop - - [Laptops](docs/Commands.md#rpk-laptops) - Manage Laptop computers and their components + - [del](docs/Commands.md#rpk-desktops-nic-del) - Remove a NIC from a desktop + - [set](docs/Commands.md#rpk-desktops-nic-set) - Update a desktop NIC + - [set](docs/Commands.md#rpk-desktops-nic-set) - Update a desktop NIC + - [set](docs/Commands.md#rpk-desktops-set) - Update properties of a desktop + - [set](docs/Commands.md#rpk-desktops-set) - Update properties of a desktop + - [summary](docs/Commands.md#rpk-desktops-summary) - Show a summarized hardware report for all desktops + - [summary](docs/Commands.md#rpk-desktops-summary) - Show a summarized hardware report for all desktops + - [tree](docs/Commands.md#rpk-desktops-tree) - Display the dependency tree for a desktop + - [tree](docs/Commands.md#rpk-desktops-tree) - Display the dependency tree for a desktop + - [firewalls](docs/Commands.md#rpk-firewalls) - Manage firewalls + - [add](docs/Commands.md#rpk-firewalls-add) - Add a new firewall to the inventory + - [add](docs/Commands.md#rpk-firewalls-add) - Add a new firewall to the inventory + - [del](docs/Commands.md#rpk-firewalls-del) - Delete a firewall from the inventory + - [del](docs/Commands.md#rpk-firewalls-del) - Delete a firewall from the inventory + - [describe](docs/Commands.md#rpk-firewalls-describe) - Show detailed information about a firewall + - [describe](docs/Commands.md#rpk-firewalls-describe) - Show detailed information about a firewall + - [get](docs/Commands.md#rpk-firewalls-get) - Retrieve details of a specific firewall by name + - [get](docs/Commands.md#rpk-firewalls-get) - Retrieve details of a specific firewall by name + - [label](docs/Commands.md#rpk-firewalls-label) - Manage labels on a firewall + - [add](docs/Commands.md#rpk-firewalls-label-add) - Add a label to a firewall + - [add](docs/Commands.md#rpk-firewalls-label-add) - Add a label to a firewall + - [remove](docs/Commands.md#rpk-firewalls-label-remove) - Remove a label from a firewall + - [remove](docs/Commands.md#rpk-firewalls-label-remove) - Remove a label from a firewall + - [list](docs/Commands.md#rpk-firewalls-list) - List all firewalls in the system + - [list](docs/Commands.md#rpk-firewalls-list) - List all firewalls in the system + - [port](docs/Commands.md#rpk-firewalls-port) - Manage ports on a firewall + - [add](docs/Commands.md#rpk-firewalls-port-add) - Add a port to a firewall + - [add](docs/Commands.md#rpk-firewalls-port-add) - Add a port to a firewall + - [del](docs/Commands.md#rpk-firewalls-port-del) - Remove a port from a firewall + - [del](docs/Commands.md#rpk-firewalls-port-del) - Remove a port from a firewall + - [set](docs/Commands.md#rpk-firewalls-port-set) - Update a firewall port + - [set](docs/Commands.md#rpk-firewalls-port-set) - Update a firewall port + - [set](docs/Commands.md#rpk-firewalls-set) - Update properties of a firewall + - [set](docs/Commands.md#rpk-firewalls-set) - Update properties of a firewall + - [summary](docs/Commands.md#rpk-firewalls-summary) - Show a hardware report for all firewalls + - [summary](docs/Commands.md#rpk-firewalls-summary) - Show a hardware report for all firewalls + - [hosts](docs/Commands.md#rpk-hosts) - Generate a hosts file from infrastructure + - [export](docs/Commands.md#rpk-hosts-export) - Generate a /etc/hosts compatible file + - [export](docs/Commands.md#rpk-hosts-export) - Generate a /etc/hosts compatible file + - [laptops](docs/Commands.md#rpk-laptops) - Manage Laptop computers and their components + - [add](docs/Commands.md#rpk-laptops-add) - Add a new Laptop - [add](docs/Commands.md#rpk-laptops-add) - Add a new Laptop - - [list](docs/Commands.md#rpk-laptops-list) - List all Laptops - - [get](docs/Commands.md#rpk-laptops-get) - Retrieve a Laptop by name - - [describe](docs/Commands.md#rpk-laptops-describe) - Show detailed information about a Laptop - - [del](docs/Commands.md#rpk-laptops-del) - Delete a Laptop from the inventory - - [summary](docs/Commands.md#rpk-laptops-summary) - Show a summarized hardware report for all Laptops - - [tree](docs/Commands.md#rpk-laptops-tree) - Display the dependency tree for a Laptop - [cpu](docs/Commands.md#rpk-laptops-cpu) - Manage CPUs attached to Laptops - [add](docs/Commands.md#rpk-laptops-cpu-add) - Add a CPU to a Laptop - - [set](docs/Commands.md#rpk-laptops-cpu-set) - Update a Laptop CPU + - [add](docs/Commands.md#rpk-laptops-cpu-add) - Add a CPU to a Laptop + - [del](docs/Commands.md#rpk-laptops-cpu-del) - Remove a CPU from a Laptop - [del](docs/Commands.md#rpk-laptops-cpu-del) - Remove a CPU from a Laptop - - [drive](docs/Commands.md#rpk-laptops-drive) - Manage storage drives attached to Laptops - - [add](docs/Commands.md#rpk-laptops-drive-add) - Add a drive to a Laptop - - [set](docs/Commands.md#rpk-laptops-drive-set) - Update a Laptop drive - - [del](docs/Commands.md#rpk-laptops-drive-del) - Remove a drive from a Laptop + - [set](docs/Commands.md#rpk-laptops-cpu-set) - Update a Laptop CPU + - [set](docs/Commands.md#rpk-laptops-cpu-set) - Update a Laptop CPU + - [del](docs/Commands.md#rpk-laptops-del) - Delete a Laptop from the inventory + - [del](docs/Commands.md#rpk-laptops-del) - Delete a Laptop from the inventory + - [describe](docs/Commands.md#rpk-laptops-describe) - Show detailed information about a Laptop + - [describe](docs/Commands.md#rpk-laptops-describe) - Show detailed information about a Laptop + - [drives](docs/Commands.md#rpk-laptops-drives) - Manage storage drives attached to Laptops + - [add](docs/Commands.md#rpk-laptops-drives-add) - Add a drive to a Laptop + - [add](docs/Commands.md#rpk-laptops-drives-add) - Add a drive to a Laptop + - [del](docs/Commands.md#rpk-laptops-drives-del) - Remove a drive from a Laptop + - [del](docs/Commands.md#rpk-laptops-drives-del) - Remove a drive from a Laptop + - [set](docs/Commands.md#rpk-laptops-drives-set) - Update a Laptop drive + - [set](docs/Commands.md#rpk-laptops-drives-set) - Update a Laptop drive + - [get](docs/Commands.md#rpk-laptops-get) - Retrieve a Laptop by name + - [get](docs/Commands.md#rpk-laptops-get) - Retrieve a Laptop by name - [gpu](docs/Commands.md#rpk-laptops-gpu) - Manage GPUs attached to Laptops - [add](docs/Commands.md#rpk-laptops-gpu-add) - Add a GPU to a Laptop - - [set](docs/Commands.md#rpk-laptops-gpu-set) - Update a Laptop GPU + - [add](docs/Commands.md#rpk-laptops-gpu-add) - Add a GPU to a Laptop - [del](docs/Commands.md#rpk-laptops-gpu-del) - Remove a GPU from a Laptop + - [del](docs/Commands.md#rpk-laptops-gpu-del) - Remove a GPU from a Laptop + - [set](docs/Commands.md#rpk-laptops-gpu-set) - Update a Laptop GPU + - [set](docs/Commands.md#rpk-laptops-gpu-set) - Update a Laptop GPU + - [label](docs/Commands.md#rpk-laptops-label) - Manage labels on a laptop + - [add](docs/Commands.md#rpk-laptops-label-add) - Add a label to a laptop + - [add](docs/Commands.md#rpk-laptops-label-add) - Add a label to a laptop + - [remove](docs/Commands.md#rpk-laptops-label-remove) - Remove a label from a laptop + - [remove](docs/Commands.md#rpk-laptops-label-remove) - Remove a label from a laptop + - [list](docs/Commands.md#rpk-laptops-list) - List all Laptops + - [list](docs/Commands.md#rpk-laptops-list) - List all Laptops + - [set](docs/Commands.md#rpk-laptops-set) - Update properties of a laptop + - [set](docs/Commands.md#rpk-laptops-set) - Update properties of a laptop + - [summary](docs/Commands.md#rpk-laptops-summary) - Show a summarized hardware report for all Laptops + - [summary](docs/Commands.md#rpk-laptops-summary) - Show a summarized hardware report for all Laptops + - [tree](docs/Commands.md#rpk-laptops-tree) - Display the dependency tree for a Laptop + - [tree](docs/Commands.md#rpk-laptops-tree) - Display the dependency tree for a Laptop + - [mermaid](docs/Commands.md#rpk-mermaid) - Generate Mermaid diagrams from infrastructure + - [export](docs/Commands.md#rpk-mermaid-export) - Generate a Mermaid infrastructure diagram + - [export](docs/Commands.md#rpk-mermaid-export) - Generate a Mermaid infrastructure diagram + - [routers](docs/Commands.md#rpk-routers) - Manage network routers + - [add](docs/Commands.md#rpk-routers-add) - Add a new network router to the inventory + - [add](docs/Commands.md#rpk-routers-add) - Add a new network router to the inventory + - [del](docs/Commands.md#rpk-routers-del) - Delete a router from the inventory + - [del](docs/Commands.md#rpk-routers-del) - Delete a router from the inventory + - [describe](docs/Commands.md#rpk-routers-describe) - Show detailed information about a router + - [describe](docs/Commands.md#rpk-routers-describe) - Show detailed information about a router + - [get](docs/Commands.md#rpk-routers-get) - Retrieve details of a specific router by name + - [get](docs/Commands.md#rpk-routers-get) - Retrieve details of a specific router by name + - [label](docs/Commands.md#rpk-routers-label) - Manage labels on a router + - [add](docs/Commands.md#rpk-routers-label-add) - Add a label to a router + - [add](docs/Commands.md#rpk-routers-label-add) - Add a label to a router + - [remove](docs/Commands.md#rpk-routers-label-remove) - Remove a label from a router + - [remove](docs/Commands.md#rpk-routers-label-remove) - Remove a label from a router + - [list](docs/Commands.md#rpk-routers-list) - List all routers in the system + - [list](docs/Commands.md#rpk-routers-list) - List all routers in the system + - [port](docs/Commands.md#rpk-routers-port) - Manage ports on a router + - [add](docs/Commands.md#rpk-routers-port-add) - Add a port to a router + - [add](docs/Commands.md#rpk-routers-port-add) - Add a port to a router + - [del](docs/Commands.md#rpk-routers-port-del) - Remove a port from a router + - [del](docs/Commands.md#rpk-routers-port-del) - Remove a port from a router + - [set](docs/Commands.md#rpk-routers-port-set) - Update a router port + - [set](docs/Commands.md#rpk-routers-port-set) - Update a router port + - [set](docs/Commands.md#rpk-routers-set) - Update properties of a router + - [set](docs/Commands.md#rpk-routers-set) - Update properties of a router + - [summary](docs/Commands.md#rpk-routers-summary) - Show a hardware report for all routers + - [summary](docs/Commands.md#rpk-routers-summary) - Show a hardware report for all routers + - [servers](docs/Commands.md#rpk-servers) - Manage servers and their components + - [add](docs/Commands.md#rpk-servers-add) - Add a new server to the inventory + - [add](docs/Commands.md#rpk-servers-add) - Add a new server to the inventory + - [cpu](docs/Commands.md#rpk-servers-cpu) - Manage CPUs attached to a server + - [add](docs/Commands.md#rpk-servers-cpu-add) - Add a CPU to a specific server + - [add](docs/Commands.md#rpk-servers-cpu-add) - Add a CPU to a specific server + - [del](docs/Commands.md#rpk-servers-cpu-del) - Remove a CPU from a server + - [del](docs/Commands.md#rpk-servers-cpu-del) - Remove a CPU from a server + - [set](docs/Commands.md#rpk-servers-cpu-set) - Update configuration of a server CPU + - [set](docs/Commands.md#rpk-servers-cpu-set) - Update configuration of a server CPU + - [del](docs/Commands.md#rpk-servers-del) - Delete a server from the inventory + - [del](docs/Commands.md#rpk-servers-del) - Delete a server from the inventory + - [describe](docs/Commands.md#rpk-servers-describe) - Display detailed information about a specific server + - [describe](docs/Commands.md#rpk-servers-describe) - Display detailed information about a specific server + - [drive](docs/Commands.md#rpk-servers-drive) - Manage drives attached to a server + - [add](docs/Commands.md#rpk-servers-drive-add) - Add a storage drive to a server + - [add](docs/Commands.md#rpk-servers-drive-add) - Add a storage drive to a server + - [del](docs/Commands.md#rpk-servers-drive-del) - Remove a drive from a server + - [del](docs/Commands.md#rpk-servers-drive-del) - Remove a drive from a server + - [set](docs/Commands.md#rpk-servers-drive-set) - Update properties of a server drive + - [set](docs/Commands.md#rpk-servers-drive-set) - Update properties of a server drive + - [get](docs/Commands.md#rpk-servers-get) - List all servers or retrieve a specific server by name + - [get](docs/Commands.md#rpk-servers-get) - List all servers or retrieve a specific server by name + - [gpu](docs/Commands.md#rpk-servers-gpu) - Manage GPUs attached to a server + - [add](docs/Commands.md#rpk-servers-gpu-add) - Add a GPU to a server + - [add](docs/Commands.md#rpk-servers-gpu-add) - Add a GPU to a server + - [del](docs/Commands.md#rpk-servers-gpu-del) - Remove a GPU from a server + - [del](docs/Commands.md#rpk-servers-gpu-del) - Remove a GPU from a server + - [set](docs/Commands.md#rpk-servers-gpu-set) - Update properties of a server GPU + - [set](docs/Commands.md#rpk-servers-gpu-set) - Update properties of a server GPU + - [label](docs/Commands.md#rpk-servers-label) - Manage labels on a server + - [add](docs/Commands.md#rpk-servers-label-add) - Add a label to a server + - [add](docs/Commands.md#rpk-servers-label-add) - Add a label to a server + - [remove](docs/Commands.md#rpk-servers-label-remove) - Remove a label from a server + - [remove](docs/Commands.md#rpk-servers-label-remove) - Remove a label from a server + - [nic](docs/Commands.md#rpk-servers-nic) - Manage network interface cards (NICs) for a server + - [add](docs/Commands.md#rpk-servers-nic-add) - Add a NIC to a server + - [add](docs/Commands.md#rpk-servers-nic-add) - Add a NIC to a server + - [del](docs/Commands.md#rpk-servers-nic-del) - Remove a NIC from a server + - [del](docs/Commands.md#rpk-servers-nic-del) - Remove a NIC from a server + - [set](docs/Commands.md#rpk-servers-nic-set) - Update properties of a server NIC + - [set](docs/Commands.md#rpk-servers-nic-set) - Update properties of a server NIC + - [set](docs/Commands.md#rpk-servers-set) - Update properties of an existing server + - [set](docs/Commands.md#rpk-servers-set) - Update properties of an existing server + - [summary](docs/Commands.md#rpk-servers-summary) - Show a summarized hardware report for all servers + - [summary](docs/Commands.md#rpk-servers-summary) - Show a summarized hardware report for all servers + - [tree](docs/Commands.md#rpk-servers-tree) - Display the dependency tree of a server + - [tree](docs/Commands.md#rpk-servers-tree) - Display the dependency tree of a server - [services](docs/Commands.md#rpk-services) - Manage services and their configurations - - [summary](docs/Commands.md#rpk-services-summary) - Show a summary report for all services - [add](docs/Commands.md#rpk-services-add) - Add a new service - - [list](docs/Commands.md#rpk-services-list) - List all services - - [get](docs/Commands.md#rpk-services-get) - Retrieve a service by name + - [add](docs/Commands.md#rpk-services-add) - Add a new service + - [del](docs/Commands.md#rpk-services-del) - Delete a service + - [del](docs/Commands.md#rpk-services-del) - Delete a service - [describe](docs/Commands.md#rpk-services-describe) - Show detailed information about a service + - [describe](docs/Commands.md#rpk-services-describe) - Show detailed information about a service + - [get](docs/Commands.md#rpk-services-get) - Retrieve a service by name + - [get](docs/Commands.md#rpk-services-get) - Retrieve a service by name + - [label](docs/Commands.md#rpk-services-label) - Manage labels on a service + - [add](docs/Commands.md#rpk-services-label-add) - Add a label to a service + - [add](docs/Commands.md#rpk-services-label-add) - Add a label to a service + - [remove](docs/Commands.md#rpk-services-label-remove) - Remove a label from a service + - [remove](docs/Commands.md#rpk-services-label-remove) - Remove a label from a service + - [list](docs/Commands.md#rpk-services-list) - List all services + - [list](docs/Commands.md#rpk-services-list) - List all services - [set](docs/Commands.md#rpk-services-set) - Update properties of a service - - [del](docs/Commands.md#rpk-services-del) - Delete a service - - [subnets](docs/Commands.md#rpk-services-subnets) - List subnets associated with a service, optionally filtered - by CIDR + - [set](docs/Commands.md#rpk-services-set) - Update properties of a service + - [subnets](docs/Commands.md#rpk-services-subnets) - List subnets associated with a service, optionally filtered by CIDR + - [subnets](docs/Commands.md#rpk-services-subnets) - List subnets associated with a service, optionally filtered by CIDR + - [summary](docs/Commands.md#rpk-services-summary) - Show a summary report for all services + - [summary](docs/Commands.md#rpk-services-summary) - Show a summary report for all services + - [ssh](docs/Commands.md#rpk-ssh) - Generate SSH configuration from infrastructure + - [export](docs/Commands.md#rpk-ssh-export) - Generate an SSH config file + - [export](docs/Commands.md#rpk-ssh-export) - Generate an SSH config file + - [summary](docs/Commands.md#rpk-summary) - Show a summarized report of all resources in the system + - [summary](docs/Commands.md#rpk-summary) - Show a summarized report of all resources in the system + - [switches](docs/Commands.md#rpk-switches) - Manage network switches + - [add](docs/Commands.md#rpk-switches-add) - Add a new network switch to the inventory + - [add](docs/Commands.md#rpk-switches-add) - Add a new network switch to the inventory + - [del](docs/Commands.md#rpk-switches-del) - Delete a switch from the inventory + - [del](docs/Commands.md#rpk-switches-del) - Delete a switch from the inventory + - [describe](docs/Commands.md#rpk-switches-describe) - Show detailed information about a switch + - [describe](docs/Commands.md#rpk-switches-describe) - Show detailed information about a switch + - [get](docs/Commands.md#rpk-switches-get) - Retrieve details of a specific switch by name + - [get](docs/Commands.md#rpk-switches-get) - Retrieve details of a specific switch by name + - [label](docs/Commands.md#rpk-switches-label) - Manage labels on a switch + - [add](docs/Commands.md#rpk-switches-label-add) - Add a label to a switch + - [add](docs/Commands.md#rpk-switches-label-add) - Add a label to a switch + - [remove](docs/Commands.md#rpk-switches-label-remove) - Remove a label from a switch + - [remove](docs/Commands.md#rpk-switches-label-remove) - Remove a label from a switch + - [list](docs/Commands.md#rpk-switches-list) - List all switches in the system + - [list](docs/Commands.md#rpk-switches-list) - List all switches in the system + - [port](docs/Commands.md#rpk-switches-port) - Manage ports on a network switch + - [add](docs/Commands.md#rpk-switches-port-add) - Add a port to a switch + - [add](docs/Commands.md#rpk-switches-port-add) - Add a port to a switch + - [del](docs/Commands.md#rpk-switches-port-del) - Remove a port from a switch + - [del](docs/Commands.md#rpk-switches-port-del) - Remove a port from a switch + - [set](docs/Commands.md#rpk-switches-port-set) - Update a switch port + - [set](docs/Commands.md#rpk-switches-port-set) - Update a switch port + - [set](docs/Commands.md#rpk-switches-set) - Update properties of a switch + - [set](docs/Commands.md#rpk-switches-set) - Update properties of a switch + - [summary](docs/Commands.md#rpk-switches-summary) - Show a hardware report for all switches + - [summary](docs/Commands.md#rpk-switches-summary) - Show a hardware report for all switches + - [systems](docs/Commands.md#rpk-systems) - Manage systems and their dependencies + - [add](docs/Commands.md#rpk-systems-add) - Add a new system to the inventory + - [add](docs/Commands.md#rpk-systems-add) - Add a new system to the inventory + - [del](docs/Commands.md#rpk-systems-del) - Delete a system from the inventory + - [del](docs/Commands.md#rpk-systems-del) - Delete a system from the inventory + - [describe](docs/Commands.md#rpk-systems-describe) - Display detailed information about a system + - [describe](docs/Commands.md#rpk-systems-describe) - Display detailed information about a system + - [get](docs/Commands.md#rpk-systems-get) - Retrieve a system by name + - [get](docs/Commands.md#rpk-systems-get) - Retrieve a system by name + - [label](docs/Commands.md#rpk-systems-label) - Manage labels on a system + - [add](docs/Commands.md#rpk-systems-label-add) - Add a label to a system + - [add](docs/Commands.md#rpk-systems-label-add) - Add a label to a system + - [remove](docs/Commands.md#rpk-systems-label-remove) - Remove a label from a system + - [remove](docs/Commands.md#rpk-systems-label-remove) - Remove a label from a system + - [list](docs/Commands.md#rpk-systems-list) - List all systems + - [list](docs/Commands.md#rpk-systems-list) - List all systems + - [set](docs/Commands.md#rpk-systems-set) - Update properties of a system + - [set](docs/Commands.md#rpk-systems-set) - Update properties of a system + - [summary](docs/Commands.md#rpk-systems-summary) - Show a summary report for all systems + - [summary](docs/Commands.md#rpk-systems-summary) - Show a summary report for all systems + - [tree](docs/Commands.md#rpk-systems-tree) - Display the dependency tree for a system + - [tree](docs/Commands.md#rpk-systems-tree) - Display the dependency tree for a system + - [ups](docs/Commands.md#rpk-ups) - Manage UPS units + - [add](docs/Commands.md#rpk-ups-add) - Add a new UPS unit + - [add](docs/Commands.md#rpk-ups-add) - Add a new UPS unit + - [del](docs/Commands.md#rpk-ups-del) - Delete a UPS unit + - [del](docs/Commands.md#rpk-ups-del) - Delete a UPS unit + - [describe](docs/Commands.md#rpk-ups-describe) - Show detailed information about a UPS unit + - [describe](docs/Commands.md#rpk-ups-describe) - Show detailed information about a UPS unit + - [get](docs/Commands.md#rpk-ups-get) - Retrieve a UPS unit by name + - [get](docs/Commands.md#rpk-ups-get) - Retrieve a UPS unit by name + - [label](docs/Commands.md#rpk-ups-label) - Manage labels on a UPS unit + - [add](docs/Commands.md#rpk-ups-label-add) - Add a label to a UPS unit + - [add](docs/Commands.md#rpk-ups-label-add) - Add a label to a UPS unit + - [remove](docs/Commands.md#rpk-ups-label-remove) - Remove a label from a UPS unit + - [remove](docs/Commands.md#rpk-ups-label-remove) - Remove a label from a UPS unit + - [list](docs/Commands.md#rpk-ups-list) - List all UPS units + - [list](docs/Commands.md#rpk-ups-list) - List all UPS units + - [set](docs/Commands.md#rpk-ups-set) - Update properties of a UPS unit + - [set](docs/Commands.md#rpk-ups-set) - Update properties of a UPS unit + - [summary](docs/Commands.md#rpk-ups-summary) - Show a hardware report for all UPS units + - [summary](docs/Commands.md#rpk-ups-summary) - Show a hardware report for all UPS units diff --git a/Shared.Rcl/wwwroot/raw_docs/cli-commands.md b/Shared.Rcl/wwwroot/raw_docs/cli-commands.md index a5a98315..f0d87ef4 100644 --- a/Shared.Rcl/wwwroot/raw_docs/cli-commands.md +++ b/Shared.Rcl/wwwroot/raw_docs/cli-commands.md @@ -1,7 +1,6 @@ # CLI Commands ## `rpk` - ``` USAGE: rpk [OPTIONS] @@ -20,424 +19,872 @@ COMMANDS: accesspoints Manage access points ups Manage UPS units desktops Manage desktop computers and their components - Laptops Manage Laptop computers and their components + laptops Manage Laptop computers and their components services Manage services and their configurations + ansible Generate and manage Ansible inventory + ssh Generate SSH configuration from infrastructure + hosts Generate a hosts file from infrastructure + mermaid Generate Mermaid diagrams from infrastructure ``` -## `rpk summary` - +## `rpk accesspoints` ``` DESCRIPTION: -Show a summarized report of all resources in the system +Manage access points USAGE: - rpk summary [OPTIONS] + rpk accesspoints [OPTIONS] OPTIONS: -h, --help Prints help information -``` -## `rpk servers` +COMMANDS: + summary Show a hardware report for all access points + add Add a new access point + list List all access points + get Retrieve an access point by name + describe Show detailed information about an access point + set Update properties of an access point + del Delete an access point + label Manage labels on an access point +``` +## `rpk accesspoints add` ``` DESCRIPTION: -Manage servers and their components +Add a new access point USAGE: - rpk servers [OPTIONS] + rpk accesspoints add [OPTIONS] + +ARGUMENTS: + The access point name OPTIONS: -h, --help Prints help information - -COMMANDS: - summary Show a summarized hardware report for all servers - add Add a new server to the inventory - get List all servers or retrieve a specific server by name - describe Display detailed information about a specific server - set Update properties of an existing server - del Delete a server from the inventory - tree Display the dependency tree of a server - cpu Manage CPUs attached to a server - drive Manage drives attached to a server - gpu Manage GPUs attached to a server - nic Manage network interface cards (NICs) for a server ``` -## `rpk servers summary` - +## `rpk accesspoints del` ``` DESCRIPTION: -Show a summarized hardware report for all servers +Delete an access point USAGE: - rpk servers summary [OPTIONS] + rpk accesspoints del [OPTIONS] + +ARGUMENTS: + The access point name OPTIONS: -h, --help Prints help information ``` -## `rpk servers add` - +## `rpk accesspoints describe` ``` DESCRIPTION: -Add a new server to the inventory +Show detailed information about an access point USAGE: - rpk servers add [OPTIONS] + rpk accesspoints describe [OPTIONS] ARGUMENTS: - + The access point name OPTIONS: -h, --help Prints help information ``` -## `rpk servers get` - +## `rpk accesspoints get` ``` DESCRIPTION: -List all servers or retrieve a specific server by name +Retrieve an access point by name USAGE: - rpk servers get [OPTIONS] + rpk accesspoints get [OPTIONS] ARGUMENTS: - + The access point name OPTIONS: -h, --help Prints help information ``` -## `rpk servers describe` - +## `rpk accesspoints label` ``` DESCRIPTION: -Display detailed information about a specific server +Manage labels on an access point USAGE: - rpk servers describe [OPTIONS] - -ARGUMENTS: - + rpk accesspoints label [OPTIONS] OPTIONS: -h, --help Prints help information -``` -## `rpk servers set` +COMMANDS: + add Add a label to an access point + remove Remove a label from an access point +``` +## `rpk accesspoints label add` ``` DESCRIPTION: -Update properties of an existing server +Add a label to an access point USAGE: - rpk servers set [OPTIONS] + rpk accesspoints label add [OPTIONS] ARGUMENTS: - + The access point name OPTIONS: -h, --help Prints help information - --ram - --ram_mts - --ipmi + --key + --value ``` -## `rpk servers del` - +## `rpk accesspoints label remove` ``` DESCRIPTION: -Delete a server from the inventory +Remove a label from an access point USAGE: - rpk servers del [OPTIONS] + rpk accesspoints label remove [OPTIONS] ARGUMENTS: - + The access point name OPTIONS: - -h, --help Prints help information + -h, --help Prints help information + --key ``` -## `rpk servers tree` +## `rpk accesspoints list` +``` +DESCRIPTION: +List all access points + +USAGE: + rpk accesspoints list [OPTIONS] + +OPTIONS: + -h, --help Prints help information +``` +## `rpk accesspoints set` ``` DESCRIPTION: -Display the dependency tree of a server +Update properties of an access point USAGE: - rpk servers tree [OPTIONS] + rpk accesspoints set [OPTIONS] ARGUMENTS: OPTIONS: - -h, --help Prints help information + -h, --help Prints help information + --model The access point model name + --speed The speed of the access point in Gb ``` -## `rpk servers cpu` +## `rpk accesspoints summary` +``` +DESCRIPTION: +Show a hardware report for all access points + +USAGE: + rpk accesspoints summary [OPTIONS] + +OPTIONS: + -h, --help Prints help information +``` +## `rpk ansible` ``` DESCRIPTION: -Manage CPUs attached to a server +Generate and manage Ansible inventory USAGE: - rpk servers cpu [OPTIONS] + rpk ansible [OPTIONS] OPTIONS: -h, --help Prints help information COMMANDS: - add Add a CPU to a specific server - set Update configuration of a server CPU - del Remove a CPU from a server + inventory Generate an Ansible inventory ``` -## `rpk servers cpu add` - +## `rpk ansible inventory` ``` DESCRIPTION: -Add a CPU to a specific server +Generate an Ansible inventory USAGE: - rpk servers cpu add [OPTIONS] - -ARGUMENTS: - + rpk ansible inventory [OPTIONS] OPTIONS: - -h, --help Prints help information - --model - --cores - --threads + DEFAULT + -h, --help Prints help information + --group-tags Comma-separated list of tags to group by (e.g. prod,staging) + --group-labels Comma-separated list of label keys to group by (e.g. env,site) + --global-var Global variable (repeatable). Format: key=value + --format ini Inventory format: ini (default) or yaml + -o, --output Write inventory to file instead of stdout ``` -## `rpk servers cpu set` - +## `rpk desktops` ``` DESCRIPTION: -Update configuration of a server CPU +Manage desktop computers and their components USAGE: - rpk servers cpu set [OPTIONS] - -ARGUMENTS: - + rpk desktops [OPTIONS] OPTIONS: - -h, --help Prints help information - --index - --model - --cores - --threads -``` + -h, --help Prints help information -## `rpk servers cpu del` +COMMANDS: + add Add a new desktop + list List all desktops + get Retrieve a desktop by name + describe Show detailed information about a desktop + set Update properties of a desktop + del Delete a desktop from the inventory + summary Show a summarized hardware report for all desktops + tree Display the dependency tree for a desktop + cpu Manage CPUs attached to desktops + drive Manage storage drives attached to desktops + gpu Manage GPUs attached to desktops + nic Manage network interface cards (NICs) for desktops + label Manage labels on a desktop +``` +## `rpk desktops add` ``` DESCRIPTION: -Remove a CPU from a server +Add a new desktop USAGE: - rpk servers cpu del [OPTIONS] + rpk desktops add [OPTIONS] ARGUMENTS: OPTIONS: - -h, --help Prints help information - --index + -h, --help Prints help information ``` -## `rpk servers drive` - +## `rpk desktops cpu` ``` DESCRIPTION: -Manage drives attached to a server +Manage CPUs attached to desktops USAGE: - rpk servers drive [OPTIONS] + rpk desktops cpu [OPTIONS] OPTIONS: -h, --help Prints help information COMMANDS: - add Add a storage drive to a server - set Update properties of a server drive - del Remove a drive from a server + add Add a CPU to a desktop + set Update a desktop CPU + del Remove a CPU from a desktop ``` -## `rpk servers drive add` - +## `rpk desktops cpu add` ``` DESCRIPTION: -Add a storage drive to a server +Add a CPU to a desktop USAGE: - rpk servers drive add [OPTIONS] + rpk desktops cpu add [OPTIONS] ARGUMENTS: - + The desktop name OPTIONS: - -h, --help Prints help information - --type - --size + -h, --help Prints help information + --model The model name + --cores The number of cpu cores + --threads The number of cpu threads ``` -## `rpk servers drive set` - +## `rpk desktops cpu del` ``` DESCRIPTION: -Update properties of a server drive +Remove a CPU from a desktop USAGE: - rpk servers drive set [OPTIONS] + rpk desktops cpu del [OPTIONS] ARGUMENTS: - + The name of the desktop + The index of the desktop cpu to remove OPTIONS: - -h, --help Prints help information - --index - --type - --size + -h, --help Prints help information ``` -## `rpk servers drive del` - +## `rpk desktops cpu set` ``` DESCRIPTION: -Remove a drive from a server +Update a desktop CPU USAGE: - rpk servers drive del [OPTIONS] + rpk desktops cpu set [OPTIONS] ARGUMENTS: - + The desktop name + The index of the desktop cpu OPTIONS: - -h, --help Prints help information - --index + -h, --help Prints help information + --model The cpu model + --cores The number of cpu cores + --threads The number of cpu threads ``` -## `rpk servers gpu` - +## `rpk desktops del` ``` DESCRIPTION: -Manage GPUs attached to a server +Delete a desktop from the inventory USAGE: - rpk servers gpu [OPTIONS] + rpk desktops del [OPTIONS] + +ARGUMENTS: + OPTIONS: -h, --help Prints help information - -COMMANDS: - add Add a GPU to a server - set Update properties of a server GPU - del Remove a GPU from a server ``` -## `rpk servers gpu add` - +## `rpk desktops describe` +``` +DESCRIPTION: +Show detailed information about a desktop + +USAGE: + rpk desktops describe [OPTIONS] + +ARGUMENTS: + + +OPTIONS: + -h, --help Prints help information +``` + +## `rpk desktops drive` +``` +DESCRIPTION: +Manage storage drives attached to desktops + +USAGE: + rpk desktops drive [OPTIONS] + +OPTIONS: + -h, --help Prints help information + +COMMANDS: + add Add a drive to a desktop + set Update a desktop drive + del Remove a drive from a desktop +``` + +## `rpk desktops drive add` +``` +DESCRIPTION: +Add a drive to a desktop + +USAGE: + rpk desktops drive add [OPTIONS] + +ARGUMENTS: + The name of the desktop + +OPTIONS: + -h, --help Prints help information + --type The drive type e.g hdd / ssd + --size The drive capacity in GB +``` + +## `rpk desktops drive del` +``` +DESCRIPTION: +Remove a drive from a desktop + +USAGE: + rpk desktops drive del [OPTIONS] + +ARGUMENTS: + The name of the desktop + The index of the drive to remove + +OPTIONS: + -h, --help Prints help information +``` + +## `rpk desktops drive set` +``` +DESCRIPTION: +Update a desktop drive + +USAGE: + rpk desktops drive set [OPTIONS] + +ARGUMENTS: + The desktop name + The drive index to update + +OPTIONS: + -h, --help Prints help information + --type The drive type e.g hdd / ssd + --size The drive capacity in Gb +``` + +## `rpk desktops get` +``` +DESCRIPTION: +Retrieve a desktop by name + +USAGE: + rpk desktops get [OPTIONS] + +ARGUMENTS: + + +OPTIONS: + -h, --help Prints help information +``` + +## `rpk desktops gpu` +``` +DESCRIPTION: +Manage GPUs attached to desktops + +USAGE: + rpk desktops gpu [OPTIONS] + +OPTIONS: + -h, --help Prints help information + +COMMANDS: + add Add a GPU to a desktop + set Update a desktop GPU + del Remove a GPU from a desktop +``` + +## `rpk desktops gpu add` +``` +DESCRIPTION: +Add a GPU to a desktop + +USAGE: + rpk desktops gpu add [OPTIONS] + +ARGUMENTS: + The name of the desktop + +OPTIONS: + -h, --help Prints help information + --model The Gpu model + --vram The amount of gpu vram in Gb +``` + +## `rpk desktops gpu del` +``` +DESCRIPTION: +Remove a GPU from a desktop + +USAGE: + rpk desktops gpu del [OPTIONS] + +ARGUMENTS: + The desktop name + The index of the Gpu to remove + +OPTIONS: + -h, --help Prints help information +``` + +## `rpk desktops gpu set` +``` +DESCRIPTION: +Update a desktop GPU + +USAGE: + rpk desktops gpu set [OPTIONS] + +ARGUMENTS: + The desktop name + The index of the gpu to update + +OPTIONS: + -h, --help Prints help information + --model The gpu model name + --vram The amount of gpu vram in Gb +``` + +## `rpk desktops label` +``` +DESCRIPTION: +Manage labels on a desktop + +USAGE: + rpk desktops label [OPTIONS] + +OPTIONS: + -h, --help Prints help information + +COMMANDS: + add Add a label to a desktop + remove Remove a label from a desktop +``` + +## `rpk desktops label add` +``` +DESCRIPTION: +Add a label to a desktop + +USAGE: + rpk desktops label add [OPTIONS] + +ARGUMENTS: + + +OPTIONS: + -h, --help Prints help information + --key + --value +``` + +## `rpk desktops label remove` +``` +DESCRIPTION: +Remove a label from a desktop + +USAGE: + rpk desktops label remove [OPTIONS] + +ARGUMENTS: + + +OPTIONS: + -h, --help Prints help information + --key +``` + +## `rpk desktops list` +``` +DESCRIPTION: +List all desktops + +USAGE: + rpk desktops list [OPTIONS] + +OPTIONS: + -h, --help Prints help information +``` + +## `rpk desktops nic` +``` +DESCRIPTION: +Manage network interface cards (NICs) for desktops + +USAGE: + rpk desktops nic [OPTIONS] + +OPTIONS: + -h, --help Prints help information + +COMMANDS: + add Add a NIC to a desktop + set Update a desktop NIC + del Remove a NIC from a desktop +``` + +## `rpk desktops nic add` +``` +DESCRIPTION: +Add a NIC to a desktop + +USAGE: + rpk desktops nic add [OPTIONS] + +ARGUMENTS: + The desktop name + +OPTIONS: + -h, --help Prints help information + --type The nic port type e.g rj45 / sfp+ + --speed The port speed + --ports The number of ports +``` + +## `rpk desktops nic del` +``` +DESCRIPTION: +Remove a NIC from a desktop + +USAGE: + rpk desktops nic del [OPTIONS] + +ARGUMENTS: + The desktop name + The index of the nic to remove + +OPTIONS: + -h, --help Prints help information +``` + +## `rpk desktops nic set` +``` +DESCRIPTION: +Update a desktop NIC + +USAGE: + rpk desktops nic set [OPTIONS] + +ARGUMENTS: + The desktop name + The index of the nic to remove + +OPTIONS: + -h, --help Prints help information + --type The nic port type e.g rj45 / sfp+ + --speed The speed of the nic in Gb/s + --ports The number of ports +``` + +## `rpk desktops set` +``` +DESCRIPTION: +Update properties of a desktop + +USAGE: + rpk desktops set [OPTIONS] + +ARGUMENTS: + + +OPTIONS: + -h, --help Prints help information + --model +``` + +## `rpk desktops summary` +``` +DESCRIPTION: +Show a summarized hardware report for all desktops + +USAGE: + rpk desktops summary [OPTIONS] + +OPTIONS: + -h, --help Prints help information +``` + +## `rpk desktops tree` +``` +DESCRIPTION: +Display the dependency tree for a desktop + +USAGE: + rpk desktops tree [OPTIONS] + +ARGUMENTS: + + +OPTIONS: + -h, --help Prints help information +``` + +## `rpk firewalls` +``` +DESCRIPTION: +Manage firewalls + +USAGE: + rpk firewalls [OPTIONS] + +OPTIONS: + -h, --help Prints help information + +COMMANDS: + summary Show a hardware report for all firewalls + add Add a new firewall to the inventory + list List all firewalls in the system + get Retrieve details of a specific firewall by name + describe Show detailed information about a firewall + set Update properties of a firewall + del Delete a firewall from the inventory + port Manage ports on a firewall + label Manage labels on a firewall +``` + +## `rpk firewalls add` +``` +DESCRIPTION: +Add a new firewall to the inventory + +USAGE: + rpk firewalls add [OPTIONS] + +ARGUMENTS: + + +OPTIONS: + -h, --help Prints help information +``` + +## `rpk firewalls del` ``` DESCRIPTION: -Add a GPU to a server +Delete a firewall from the inventory USAGE: - rpk servers gpu add [OPTIONS] + rpk firewalls del [OPTIONS] ARGUMENTS: OPTIONS: - -h, --help Prints help information - --model - --vram + -h, --help Prints help information ``` -## `rpk servers gpu set` +## `rpk firewalls describe` +``` +DESCRIPTION: +Show detailed information about a firewall + +USAGE: + rpk firewalls describe [OPTIONS] + +ARGUMENTS: + + +OPTIONS: + -h, --help Prints help information +``` +## `rpk firewalls get` ``` DESCRIPTION: -Update properties of a server GPU +Retrieve details of a specific firewall by name USAGE: - rpk servers gpu set [OPTIONS] + rpk firewalls get [OPTIONS] ARGUMENTS: OPTIONS: - -h, --help Prints help information - --index - --model - --vram + -h, --help Prints help information ``` -## `rpk servers gpu del` +## `rpk firewalls label` +``` +DESCRIPTION: +Manage labels on a firewall + +USAGE: + rpk firewalls label [OPTIONS] + +OPTIONS: + -h, --help Prints help information + +COMMANDS: + add Add a label to a firewall + remove Remove a label from a firewall +``` +## `rpk firewalls label add` ``` DESCRIPTION: -Remove a GPU from a server +Add a label to a firewall USAGE: - rpk servers gpu del [OPTIONS] + rpk firewalls label add [OPTIONS] ARGUMENTS: OPTIONS: -h, --help Prints help information - --index + --key + --value ``` -## `rpk servers nic` +## `rpk firewalls label remove` +``` +DESCRIPTION: +Remove a label from a firewall +USAGE: + rpk firewalls label remove [OPTIONS] + +ARGUMENTS: + + +OPTIONS: + -h, --help Prints help information + --key +``` + +## `rpk firewalls list` ``` DESCRIPTION: -Manage network interface cards (NICs) for a server +List all firewalls in the system USAGE: - rpk servers nic [OPTIONS] + rpk firewalls list [OPTIONS] OPTIONS: -h, --help Prints help information +``` -COMMANDS: - add Add a NIC to a server - set Update properties of a server NIC - del Remove a NIC from a server +## `rpk firewalls port` ``` +DESCRIPTION: +Manage ports on a firewall -## `rpk servers nic add` +USAGE: + rpk firewalls port [OPTIONS] + +OPTIONS: + -h, --help Prints help information + +COMMANDS: + add Add a port to a firewall + set Update a firewall port + del Remove a port from a firewall +``` +## `rpk firewalls port add` ``` DESCRIPTION: -Add a NIC to a server +Add a port to a firewall USAGE: - rpk servers nic add [OPTIONS] + rpk firewalls port add [OPTIONS] ARGUMENTS: OPTIONS: - -h, --help Prints help information - --type - --speed - --ports + -h, --help Prints help information + --type + --speed + --count ``` -## `rpk servers nic set` - +## `rpk firewalls port del` ``` DESCRIPTION: -Update properties of a server NIC +Remove a port from a firewall USAGE: - rpk servers nic set [OPTIONS] + rpk firewalls port del [OPTIONS] ARGUMENTS: @@ -445,19 +892,15 @@ ARGUMENTS: OPTIONS: -h, --help Prints help information --index - --type - --speed - --ports ``` -## `rpk servers nic del` - +## `rpk firewalls port set` ``` DESCRIPTION: -Remove a NIC from a server +Update a firewall port USAGE: - rpk servers nic del [OPTIONS] + rpk firewalls port set [OPTIONS] ARGUMENTS: @@ -465,52 +908,105 @@ ARGUMENTS: OPTIONS: -h, --help Prints help information --index + --type + --speed + --count ``` -## `rpk switches` +## `rpk firewalls set` +``` +DESCRIPTION: +Update properties of a firewall + +USAGE: + rpk firewalls set [OPTIONS] + +ARGUMENTS: + + +OPTIONS: + -h, --help Prints help information + --Model + --managed + --poe +``` +## `rpk firewalls summary` ``` DESCRIPTION: -Manage network switches +Show a hardware report for all firewalls USAGE: - rpk switches [OPTIONS] + rpk firewalls summary [OPTIONS] + +OPTIONS: + -h, --help Prints help information +``` + +## `rpk hosts` +``` +DESCRIPTION: +Generate a hosts file from infrastructure + +USAGE: + rpk hosts [OPTIONS] OPTIONS: -h, --help Prints help information COMMANDS: - summary Show a hardware report for all switches - add Add a new network switch to the inventory - list List all switches in the system - get Retrieve details of a specific switch by name - describe Show detailed information about a switch - set Update properties of a switch - del Delete a switch from the inventory - port Manage ports on a network switch + export Generate a /etc/hosts compatible file ``` -## `rpk switches summary` +## `rpk hosts export` +``` +DESCRIPTION: +Generate a /etc/hosts compatible file + +USAGE: + rpk hosts export [OPTIONS] + +OPTIONS: + -h, --help Prints help information + --include-tags Comma-separated list of tags to include (e.g. prod,staging) + --domain-suffix Optional domain suffix to append (e.g. home.local) + --no-localhost Do not include localhost defaults + -o, --output Write hosts file to file instead of stdout +``` +## `rpk laptops` ``` DESCRIPTION: -Show a hardware report for all switches +Manage Laptop computers and their components USAGE: - rpk switches summary [OPTIONS] + rpk laptops [OPTIONS] OPTIONS: -h, --help Prints help information -``` -## `rpk switches add` +COMMANDS: + add Add a new Laptop + list List all Laptops + get Retrieve a Laptop by name + describe Show detailed information about a Laptop + set Update properties of a laptop + del Delete a Laptop from the inventory + summary Show a summarized hardware report for all Laptops + tree Display the dependency tree for a Laptop + cpu Manage CPUs attached to Laptops + drives Manage storage drives attached to Laptops + gpu Manage GPUs attached to Laptops + label Manage labels on a laptop +``` +## `rpk laptops add` ``` DESCRIPTION: -Add a new network switch to the inventory +Add a new Laptop USAGE: - rpk switches add [OPTIONS] + rpk laptops add [OPTIONS] ARGUMENTS: @@ -519,78 +1015,98 @@ OPTIONS: -h, --help Prints help information ``` -## `rpk switches list` - +## `rpk laptops cpu` ``` DESCRIPTION: -List all switches in the system +Manage CPUs attached to Laptops USAGE: - rpk switches list [OPTIONS] + rpk laptops cpu [OPTIONS] OPTIONS: -h, --help Prints help information -``` -## `rpk switches get` +COMMANDS: + add Add a CPU to a Laptop + set Update a Laptop CPU + del Remove a CPU from a Laptop +``` +## `rpk laptops cpu add` ``` DESCRIPTION: -Retrieve details of a specific switch by name +Add a CPU to a Laptop USAGE: - rpk switches get [OPTIONS] + rpk laptops cpu add [OPTIONS] ARGUMENTS: - + The Laptop name OPTIONS: - -h, --help Prints help information + -h, --help Prints help information + --model The model name + --cores The number of cpu cores + --threads The number of cpu threads ``` -## `rpk switches describe` - +## `rpk laptops cpu del` ``` DESCRIPTION: -Show detailed information about a switch +Remove a CPU from a Laptop USAGE: - rpk switches describe [OPTIONS] + rpk laptops cpu del [OPTIONS] ARGUMENTS: - + The name of the Laptop + The index of the Laptop cpu to remove OPTIONS: -h, --help Prints help information ``` -## `rpk switches set` +## `rpk laptops cpu set` +``` +DESCRIPTION: +Update a Laptop CPU + +USAGE: + rpk laptops cpu set [OPTIONS] + +ARGUMENTS: + The Laptop name + The index of the Laptop cpu + +OPTIONS: + -h, --help Prints help information + --model The cpu model + --cores The number of cpu cores + --threads The number of cpu threads +``` +## `rpk laptops del` ``` DESCRIPTION: -Update properties of a switch +Delete a Laptop from the inventory USAGE: - rpk switches set [OPTIONS] + rpk laptops del [OPTIONS] ARGUMENTS: OPTIONS: - -h, --help Prints help information - --Model - --managed - --poe + -h, --help Prints help information ``` -## `rpk switches del` - +## `rpk laptops describe` ``` DESCRIPTION: -Delete a switch from the inventory +Show detailed information about a Laptop USAGE: - rpk switches del [OPTIONS] + rpk laptops describe [OPTIONS] ARGUMENTS: @@ -599,330 +1115,324 @@ OPTIONS: -h, --help Prints help information ``` -## `rpk switches port` - +## `rpk laptops drives` ``` DESCRIPTION: -Manage ports on a network switch +Manage storage drives attached to Laptops USAGE: - rpk switches port [OPTIONS] + rpk laptops drives [OPTIONS] OPTIONS: -h, --help Prints help information COMMANDS: - add Add a port to a switch - set Update a switch port - del Remove a port from a switch + add Add a drive to a Laptop + set Update a Laptop drive + del Remove a drive from a Laptop ``` -## `rpk switches port add` - +## `rpk laptops drives add` ``` DESCRIPTION: -Add a port to a switch +Add a drive to a Laptop USAGE: - rpk switches port add [OPTIONS] + rpk laptops drives add [OPTIONS] ARGUMENTS: - + The name of the Laptop OPTIONS: - -h, --help Prints help information - --type The port type (e.g., rj45, sfp+) - --speed The port speed (e.g., 1, 2.5, 10) - --count Number of ports of this type + -h, --help Prints help information + --type The drive type e.g hdd / ssd + --size The drive capacity in GB: ``` -## `rpk switches port set` - +## `rpk laptops drives del` ``` DESCRIPTION: -Update a switch port +Remove a drive from a Laptop USAGE: - rpk switches port set [OPTIONS] + rpk laptops drives del [OPTIONS] ARGUMENTS: - + The name of the Laptop + The index of the drive to remove OPTIONS: - -h, --help Prints help information - --index - --type - --speed - --count + -h, --help Prints help information ``` -## `rpk switches port del` - +## `rpk laptops drives set` ``` DESCRIPTION: -Remove a port from a switch +Update a Laptop drive USAGE: - rpk switches port del [OPTIONS] + rpk laptops drives set [OPTIONS] ARGUMENTS: - + The Laptop name + The drive index to update OPTIONS: - -h, --help Prints help information - --index + -h, --help Prints help information + --type The drive type e.g hdd / ssd + --size The drive capacity in Gb ``` -## `rpk routers` - +## `rpk laptops get` ``` DESCRIPTION: -Manage network routers +Retrieve a Laptop by name USAGE: - rpk routers [OPTIONS] + rpk laptops get [OPTIONS] + +ARGUMENTS: + OPTIONS: -h, --help Prints help information - -COMMANDS: - summary Show a hardware report for all routers - add Add a new network router to the inventory - list List all routers in the system - get Retrieve details of a specific router by name - describe Show detailed information about a router - set Update properties of a router - del Delete a router from the inventory - port Manage ports on a router ``` -## `rpk routers summary` - +## `rpk laptops gpu` ``` DESCRIPTION: -Show a hardware report for all routers +Manage GPUs attached to Laptops USAGE: - rpk routers summary [OPTIONS] + rpk laptops gpu [OPTIONS] OPTIONS: -h, --help Prints help information -``` -## `rpk routers add` +COMMANDS: + add Add a GPU to a Laptop + set Update a Laptop GPU + del Remove a GPU from a Laptop +``` +## `rpk laptops gpu add` ``` DESCRIPTION: -Add a new network router to the inventory +Add a GPU to a Laptop USAGE: - rpk routers add [OPTIONS] + rpk laptops gpu add [OPTIONS] ARGUMENTS: - + The name of the Laptop OPTIONS: - -h, --help Prints help information + -h, --help Prints help information + --model The Gpu model + --vram The amount of gpu vram in Gb ``` -## `rpk routers list` - +## `rpk laptops gpu del` ``` DESCRIPTION: -List all routers in the system +Remove a GPU from a Laptop USAGE: - rpk routers list [OPTIONS] + rpk laptops gpu del [OPTIONS] + +ARGUMENTS: + The Laptop name + The index of the Gpu to remove OPTIONS: -h, --help Prints help information ``` -## `rpk routers get` - +## `rpk laptops gpu set` ``` DESCRIPTION: -Retrieve details of a specific router by name +Update a Laptop GPU USAGE: - rpk routers get [OPTIONS] + rpk laptops gpu set [OPTIONS] ARGUMENTS: - + The Laptop name + The index of the gpu to update OPTIONS: - -h, --help Prints help information + -h, --help Prints help information + --model The gpu model name + --vram The amount of gpu vram in Gb ``` -## `rpk routers describe` - +## `rpk laptops label` ``` DESCRIPTION: -Show detailed information about a router +Manage labels on a laptop USAGE: - rpk routers describe [OPTIONS] - -ARGUMENTS: - + rpk laptops label [OPTIONS] OPTIONS: -h, --help Prints help information -``` -## `rpk routers set` +COMMANDS: + add Add a label to a laptop + remove Remove a label from a laptop +``` +## `rpk laptops label add` ``` DESCRIPTION: -Update properties of a router +Add a label to a laptop USAGE: - rpk routers set [OPTIONS] + rpk laptops label add [OPTIONS] ARGUMENTS: OPTIONS: - -h, --help Prints help information - --Model - --managed - --poe + -h, --help Prints help information + --key + --value ``` -## `rpk routers del` - +## `rpk laptops label remove` ``` DESCRIPTION: -Delete a router from the inventory +Remove a label from a laptop USAGE: - rpk routers del [OPTIONS] + rpk laptops label remove [OPTIONS] ARGUMENTS: OPTIONS: - -h, --help Prints help information + -h, --help Prints help information + --key ``` -## `rpk routers port` - +## `rpk laptops list` ``` DESCRIPTION: -Manage ports on a router +List all Laptops USAGE: - rpk routers port [OPTIONS] + rpk laptops list [OPTIONS] OPTIONS: -h, --help Prints help information - -COMMANDS: - add Add a port to a router - set Update a router port - del Remove a port from a router ``` -## `rpk routers port add` - +## `rpk laptops set` ``` DESCRIPTION: -Add a port to a router +Update properties of a laptop USAGE: - rpk routers port add [OPTIONS] + rpk laptops set [OPTIONS] ARGUMENTS: OPTIONS: -h, --help Prints help information - --type - --speed - --count + --model ``` -## `rpk routers port set` - +## `rpk laptops summary` ``` DESCRIPTION: -Update a router port +Show a summarized hardware report for all Laptops USAGE: - rpk routers port set [OPTIONS] - -ARGUMENTS: - + rpk laptops summary [OPTIONS] OPTIONS: - -h, --help Prints help information - --index - --type - --speed - --count + -h, --help Prints help information ``` -## `rpk routers port del` - +## `rpk laptops tree` ``` DESCRIPTION: -Remove a port from a router +Display the dependency tree for a Laptop USAGE: - rpk routers port del [OPTIONS] + rpk laptops tree [OPTIONS] ARGUMENTS: OPTIONS: - -h, --help Prints help information - --index + -h, --help Prints help information ``` -## `rpk firewalls` - +## `rpk mermaid` ``` DESCRIPTION: -Manage firewalls +Generate Mermaid diagrams from infrastructure USAGE: - rpk firewalls [OPTIONS] + rpk mermaid [OPTIONS] OPTIONS: -h, --help Prints help information COMMANDS: - summary Show a hardware report for all firewalls - add Add a new firewall to the inventory - list List all firewalls in the system - get Retrieve details of a specific firewall by name - describe Show detailed information about a firewall - set Update properties of a firewall - del Delete a firewall from the inventory - port Manage ports on a firewall + export Generate a Mermaid infrastructure diagram ``` -## `rpk firewalls summary` +## `rpk mermaid export` +``` +DESCRIPTION: +Generate a Mermaid infrastructure diagram + +USAGE: + rpk mermaid export [OPTIONS] + +OPTIONS: + -h, --help Prints help information + --include-tags Comma-separated list of tags to include (e.g. prod,linux) + --diagram-type Mermaid diagram type (default: "flowchart TD") + --no-labels Disable resource label annotations + --no-edges Disable relationship edges + --label-whitelist Comma-separated list of label keys to include + -o, --output Write Mermaid diagram to file instead of stdout +``` +## `rpk routers` ``` DESCRIPTION: -Show a hardware report for all firewalls +Manage network routers USAGE: - rpk firewalls summary [OPTIONS] + rpk routers [OPTIONS] OPTIONS: -h, --help Prints help information -``` -## `rpk firewalls add` +COMMANDS: + summary Show a hardware report for all routers + add Add a new network router to the inventory + list List all routers in the system + get Retrieve details of a specific router by name + describe Show detailed information about a router + set Update properties of a router + del Delete a router from the inventory + port Manage ports on a router + label Manage labels on a router +``` +## `rpk routers add` ``` DESCRIPTION: -Add a new firewall to the inventory +Add a new network router to the inventory USAGE: - rpk firewalls add [OPTIONS] + rpk routers add [OPTIONS] ARGUMENTS: @@ -931,27 +1441,43 @@ OPTIONS: -h, --help Prints help information ``` -## `rpk firewalls list` - +## `rpk routers del` ``` DESCRIPTION: -List all firewalls in the system +Delete a router from the inventory USAGE: - rpk firewalls list [OPTIONS] + rpk routers del [OPTIONS] + +ARGUMENTS: + OPTIONS: -h, --help Prints help information ``` -## `rpk firewalls get` +## `rpk routers describe` +``` +DESCRIPTION: +Show detailed information about a router + +USAGE: + rpk routers describe [OPTIONS] + +ARGUMENTS: + + +OPTIONS: + -h, --help Prints help information +``` +## `rpk routers get` ``` DESCRIPTION: -Retrieve details of a specific firewall by name +Retrieve details of a specific router by name USAGE: - rpk firewalls get [OPTIONS] + rpk routers get [OPTIONS] ARGUMENTS: @@ -960,83 +1486,91 @@ OPTIONS: -h, --help Prints help information ``` -## `rpk firewalls describe` - +## `rpk routers label` +``` +DESCRIPTION: +Manage labels on a router + +USAGE: + rpk routers label [OPTIONS] + +OPTIONS: + -h, --help Prints help information + +COMMANDS: + add Add a label to a router + remove Remove a label from a router +``` + +## `rpk routers label add` ``` DESCRIPTION: -Show detailed information about a firewall +Add a label to a router USAGE: - rpk firewalls describe [OPTIONS] + rpk routers label add [OPTIONS] ARGUMENTS: OPTIONS: - -h, --help Prints help information + -h, --help Prints help information + --key + --value ``` -## `rpk firewalls set` - +## `rpk routers label remove` ``` DESCRIPTION: -Update properties of a firewall +Remove a label from a router USAGE: - rpk firewalls set [OPTIONS] + rpk routers label remove [OPTIONS] ARGUMENTS: OPTIONS: - -h, --help Prints help information - --Model - --managed - --poe + -h, --help Prints help information + --key ``` -## `rpk firewalls del` - +## `rpk routers list` ``` DESCRIPTION: -Delete a firewall from the inventory +List all routers in the system USAGE: - rpk firewalls del [OPTIONS] - -ARGUMENTS: - + rpk routers list [OPTIONS] OPTIONS: -h, --help Prints help information ``` -## `rpk firewalls port` - +## `rpk routers port` ``` DESCRIPTION: -Manage ports on a firewall +Manage ports on a router USAGE: - rpk firewalls port [OPTIONS] + rpk routers port [OPTIONS] OPTIONS: -h, --help Prints help information COMMANDS: - add Add a port to a firewall - set Update a firewall port - del Remove a port from a firewall + add Add a port to a router + set Update a router port + del Remove a port from a router ``` -## `rpk firewalls port add` - +## `rpk routers port add` ``` DESCRIPTION: -Add a port to a firewall +Add a port to a router USAGE: - rpk firewalls port add [OPTIONS] + rpk routers port add [OPTIONS] ARGUMENTS: @@ -1048,14 +1582,29 @@ OPTIONS: --count ``` -## `rpk firewalls port set` +## `rpk routers port del` +``` +DESCRIPTION: +Remove a port from a router + +USAGE: + rpk routers port del [OPTIONS] + +ARGUMENTS: + + +OPTIONS: + -h, --help Prints help information + --index +``` +## `rpk routers port set` ``` DESCRIPTION: -Update a firewall port +Update a router port USAGE: - rpk firewalls port set [OPTIONS] + rpk routers port set [OPTIONS] ARGUMENTS: @@ -1068,67 +1617,69 @@ OPTIONS: --count ``` -## `rpk firewalls port del` - +## `rpk routers set` ``` DESCRIPTION: -Remove a port from a firewall +Update properties of a router USAGE: - rpk firewalls port del [OPTIONS] + rpk routers set [OPTIONS] ARGUMENTS: OPTIONS: - -h, --help Prints help information - --index + -h, --help Prints help information + --Model + --managed + --poe ``` -## `rpk systems` - +## `rpk routers summary` ``` DESCRIPTION: -Manage systems and their dependencies +Show a hardware report for all routers USAGE: - rpk systems [OPTIONS] + rpk routers summary [OPTIONS] OPTIONS: -h, --help Prints help information - -COMMANDS: - summary Show a summary report for all systems - add Add a new system to the inventory - list List all systems - get Retrieve a system by name - describe Display detailed information about a system - set Update properties of a system - del Delete a system from the inventory - tree Display the dependency tree for a system ``` -## `rpk systems summary` - +## `rpk servers` ``` DESCRIPTION: -Show a summary report for all systems +Manage servers and their components USAGE: - rpk systems summary [OPTIONS] + rpk servers [OPTIONS] OPTIONS: -h, --help Prints help information -``` -## `rpk systems add` +COMMANDS: + summary Show a summarized hardware report for all servers + add Add a new server to the inventory + get List all servers or retrieve a specific server by name + describe Display detailed information about a specific server + set Update properties of an existing server + del Delete a server from the inventory + tree Display the dependency tree of a server + cpu Manage CPUs attached to a server + drive Manage drives attached to a server + gpu Manage GPUs attached to a server + nic Manage network interface cards (NICs) for a server + label Manage labels on a server +``` +## `rpk servers add` ``` DESCRIPTION: -Add a new system to the inventory +Add a new server to the inventory USAGE: - rpk systems add [OPTIONS] + rpk servers add [OPTIONS] ARGUMENTS: @@ -1137,399 +1688,413 @@ OPTIONS: -h, --help Prints help information ``` -## `rpk systems list` - +## `rpk servers cpu` ``` DESCRIPTION: -List all systems +Manage CPUs attached to a server USAGE: - rpk systems list [OPTIONS] + rpk servers cpu [OPTIONS] OPTIONS: -h, --help Prints help information -``` -## `rpk systems get` +COMMANDS: + add Add a CPU to a specific server + set Update configuration of a server CPU + del Remove a CPU from a server +``` +## `rpk servers cpu add` ``` DESCRIPTION: -Retrieve a system by name +Add a CPU to a specific server USAGE: - rpk systems get [OPTIONS] + rpk servers cpu add [OPTIONS] ARGUMENTS: - The name of the system + OPTIONS: - -h, --help Prints help information + -h, --help Prints help information + --model + --cores + --threads ``` -## `rpk systems describe` - +## `rpk servers cpu del` ``` DESCRIPTION: -Display detailed information about a system +Remove a CPU from a server USAGE: - rpk systems describe [OPTIONS] + rpk servers cpu del [OPTIONS] ARGUMENTS: - The name of the system + OPTIONS: - -h, --help Prints help information + -h, --help Prints help information + --index ``` -## `rpk systems set` - +## `rpk servers cpu set` ``` DESCRIPTION: -Update properties of a system +Update configuration of a server CPU USAGE: - rpk systems set [OPTIONS] + rpk servers cpu set [OPTIONS] ARGUMENTS: OPTIONS: - -h, --help Prints help information - --type - --os - --cores - --ram - --runs-on + -h, --help Prints help information + --index + --model + --cores + --threads ``` -## `rpk systems del` - +## `rpk servers del` ``` DESCRIPTION: -Delete a system from the inventory +Delete a server from the inventory USAGE: - rpk systems del [OPTIONS] + rpk servers del [OPTIONS] ARGUMENTS: - The name of the system + OPTIONS: -h, --help Prints help information ``` -## `rpk systems tree` - +## `rpk servers describe` ``` DESCRIPTION: -Display the dependency tree for a system +Display detailed information about a specific server USAGE: - rpk systems tree [OPTIONS] + rpk servers describe [OPTIONS] ARGUMENTS: - The name of the system + OPTIONS: -h, --help Prints help information ``` -## `rpk accesspoints` - +## `rpk servers drive` ``` DESCRIPTION: -Manage access points +Manage drives attached to a server USAGE: - rpk accesspoints [OPTIONS] + rpk servers drive [OPTIONS] OPTIONS: -h, --help Prints help information COMMANDS: - summary Show a hardware report for all access points - add Add a new access point - list List all access points - get Retrieve an access point by name - describe Show detailed information about an access point - set Update properties of an access point - del Delete an access point + add Add a storage drive to a server + set Update properties of a server drive + del Remove a drive from a server ``` -## `rpk accesspoints summary` - +## `rpk servers drive add` ``` DESCRIPTION: -Show a hardware report for all access points +Add a storage drive to a server USAGE: - rpk accesspoints summary [OPTIONS] + rpk servers drive add [OPTIONS] + +ARGUMENTS: + OPTIONS: - -h, --help Prints help information + -h, --help Prints help information + --type The drive type e.g hdd / ssd + --size The drive capacity in GB ``` -## `rpk accesspoints add` - +## `rpk servers drive del` ``` DESCRIPTION: -Add a new access point +Remove a drive from a server USAGE: - rpk accesspoints add [OPTIONS] + rpk servers drive del [OPTIONS] ARGUMENTS: - The access point name + OPTIONS: - -h, --help Prints help information + -h, --help Prints help information + --index ``` -## `rpk accesspoints list` +## `rpk servers drive set` +``` +DESCRIPTION: +Update properties of a server drive + +USAGE: + rpk servers drive set [OPTIONS] + +ARGUMENTS: + + +OPTIONS: + -h, --help Prints help information + --index + --type + --size +``` +## `rpk servers get` ``` DESCRIPTION: -List all access points +List all servers or retrieve a specific server by name USAGE: - rpk accesspoints list [OPTIONS] + rpk servers get [OPTIONS] + +ARGUMENTS: + OPTIONS: -h, --help Prints help information ``` -## `rpk accesspoints get` - +## `rpk servers gpu` ``` DESCRIPTION: -Retrieve an access point by name +Manage GPUs attached to a server USAGE: - rpk accesspoints get [OPTIONS] - -ARGUMENTS: - The access point name + rpk servers gpu [OPTIONS] OPTIONS: -h, --help Prints help information -``` -## `rpk accesspoints describe` +COMMANDS: + add Add a GPU to a server + set Update properties of a server GPU + del Remove a GPU from a server +``` +## `rpk servers gpu add` ``` DESCRIPTION: -Show detailed information about an access point +Add a GPU to a server USAGE: - rpk accesspoints describe [OPTIONS] + rpk servers gpu add [OPTIONS] ARGUMENTS: - The access point name + OPTIONS: - -h, --help Prints help information + -h, --help Prints help information + --model + --vram ``` -## `rpk accesspoints set` - +## `rpk servers gpu del` ``` DESCRIPTION: -Update properties of an access point +Remove a GPU from a server USAGE: - rpk accesspoints set [OPTIONS] + rpk servers gpu del [OPTIONS] ARGUMENTS: OPTIONS: - -h, --help Prints help information - --model The access point model name - --speed The speed of the access point in Gb + -h, --help Prints help information + --index ``` -## `rpk accesspoints del` - +## `rpk servers gpu set` ``` DESCRIPTION: -Delete an access point +Update properties of a server GPU USAGE: - rpk accesspoints del [OPTIONS] + rpk servers gpu set [OPTIONS] ARGUMENTS: - The access point name + OPTIONS: - -h, --help Prints help information + -h, --help Prints help information + --index + --model + --vram ``` -## `rpk ups` - +## `rpk servers label` ``` DESCRIPTION: -Manage UPS units +Manage labels on a server USAGE: - rpk ups [OPTIONS] + rpk servers label [OPTIONS] OPTIONS: -h, --help Prints help information COMMANDS: - summary Show a hardware report for all UPS units - add Add a new UPS unit - list List all UPS units - get Retrieve a UPS unit by name - describe Show detailed information about a UPS unit - set Update properties of a UPS unit - del Delete a UPS unit + add Add a label to a server + remove Remove a label from a server ``` -## `rpk ups summary` - +## `rpk servers label add` ``` DESCRIPTION: -Show a hardware report for all UPS units +Add a label to a server USAGE: - rpk ups summary [OPTIONS] + rpk servers label add [OPTIONS] + +ARGUMENTS: + OPTIONS: - -h, --help Prints help information + -h, --help Prints help information + --key + --value ``` -## `rpk ups add` - +## `rpk servers label remove` ``` DESCRIPTION: -Add a new UPS unit +Remove a label from a server USAGE: - rpk ups add [OPTIONS] + rpk servers label remove [OPTIONS] ARGUMENTS: OPTIONS: - -h, --help Prints help information + -h, --help Prints help information + --key ``` -## `rpk ups list` - +## `rpk servers nic` ``` DESCRIPTION: -List all UPS units +Manage network interface cards (NICs) for a server USAGE: - rpk ups list [OPTIONS] + rpk servers nic [OPTIONS] OPTIONS: -h, --help Prints help information -``` -## `rpk ups get` +COMMANDS: + add Add a NIC to a server + set Update properties of a server NIC + del Remove a NIC from a server +``` +## `rpk servers nic add` ``` DESCRIPTION: -Retrieve a UPS unit by name +Add a NIC to a server USAGE: - rpk ups get [OPTIONS] + rpk servers nic add [OPTIONS] ARGUMENTS: OPTIONS: - -h, --help Prints help information + -h, --help Prints help information + --type + --speed + --ports ``` -## `rpk ups describe` - +## `rpk servers nic del` ``` DESCRIPTION: -Show detailed information about a UPS unit +Remove a NIC from a server USAGE: - rpk ups describe [OPTIONS] + rpk servers nic del [OPTIONS] ARGUMENTS: OPTIONS: - -h, --help Prints help information + -h, --help Prints help information + --index ``` -## `rpk ups set` - +## `rpk servers nic set` ``` DESCRIPTION: -Update properties of a UPS unit +Update properties of a server NIC USAGE: - rpk ups set [OPTIONS] + rpk servers nic set [OPTIONS] ARGUMENTS: OPTIONS: - -h, --help Prints help information - --model - --va + -h, --help Prints help information + --index + --type + --speed + --ports ``` -## `rpk ups del` - +## `rpk servers set` ``` DESCRIPTION: -Delete a UPS unit +Update properties of an existing server USAGE: - rpk ups del [OPTIONS] + rpk servers set [OPTIONS] ARGUMENTS: OPTIONS: - -h, --help Prints help information + -h, --help Prints help information + --ram + --ram_mts + --ipmi ``` -## `rpk desktops` - +## `rpk servers summary` ``` DESCRIPTION: -Manage desktop computers and their components +Show a summarized hardware report for all servers USAGE: - rpk desktops [OPTIONS] + rpk servers summary [OPTIONS] OPTIONS: -h, --help Prints help information - -COMMANDS: - add Add a new desktop - list List all desktops - get Retrieve a desktop by name - describe Show detailed information about a desktop - set Update properties of a desktop - del Delete a desktop from the inventory - summary Show a summarized hardware report for all desktops - tree Display the dependency tree for a desktop - cpu Manage CPUs attached to desktops - drive Manage storage drives attached to desktops - gpu Manage GPUs attached to desktops - nic Manage network interface cards (NICs) for desktops ``` -## `rpk desktops add` - +## `rpk servers tree` ``` DESCRIPTION: -Add a new desktop +Display the dependency tree of a server USAGE: - rpk desktops add [OPTIONS] + rpk servers tree [OPTIONS] ARGUMENTS: @@ -1538,900 +2103,846 @@ OPTIONS: -h, --help Prints help information ``` -## `rpk desktops list` - +## `rpk services` ``` DESCRIPTION: -List all desktops +Manage services and their configurations USAGE: - rpk desktops list [OPTIONS] + rpk services [OPTIONS] OPTIONS: -h, --help Prints help information -``` -## `rpk desktops get` +COMMANDS: + summary Show a summary report for all services + add Add a new service + list List all services + get Retrieve a service by name + describe Show detailed information about a service + set Update properties of a service + del Delete a service + subnets List subnets associated with a service, optionally filtered by CIDR + label Manage labels on a service +``` +## `rpk services add` ``` DESCRIPTION: -Retrieve a desktop by name +Add a new service USAGE: - rpk desktops get [OPTIONS] + rpk services add [OPTIONS] ARGUMENTS: - + The name of the service OPTIONS: -h, --help Prints help information ``` -## `rpk desktops describe` - +## `rpk services del` ``` DESCRIPTION: -Show detailed information about a desktop +Delete a service USAGE: - rpk desktops describe [OPTIONS] + rpk services del [OPTIONS] ARGUMENTS: - + The name of the service OPTIONS: -h, --help Prints help information ``` -## `rpk desktops set` - +## `rpk services describe` ``` DESCRIPTION: -Update properties of a desktop +Show detailed information about a service USAGE: - rpk desktops set [OPTIONS] + rpk services describe [OPTIONS] ARGUMENTS: - + The name of the service OPTIONS: - -h, --help Prints help information - --model + -h, --help Prints help information ``` -## `rpk desktops del` - +## `rpk services get` ``` DESCRIPTION: -Delete a desktop from the inventory +Retrieve a service by name USAGE: - rpk desktops del [OPTIONS] + rpk services get [OPTIONS] ARGUMENTS: - + The name of the service OPTIONS: -h, --help Prints help information ``` -## `rpk desktops summary` - +## `rpk services label` ``` DESCRIPTION: -Show a summarized hardware report for all desktops +Manage labels on a service USAGE: - rpk desktops summary [OPTIONS] + rpk services label [OPTIONS] OPTIONS: -h, --help Prints help information -``` -## `rpk desktops tree` +COMMANDS: + add Add a label to a service + remove Remove a label from a service +``` +## `rpk services label add` ``` DESCRIPTION: -Display the dependency tree for a desktop +Add a label to a service USAGE: - rpk desktops tree [OPTIONS] + rpk services label add [OPTIONS] ARGUMENTS: - + The name of the service OPTIONS: - -h, --help Prints help information + -h, --help Prints help information + --key + --value ``` -## `rpk desktops cpu` - +## `rpk services label remove` ``` DESCRIPTION: -Manage CPUs attached to desktops +Remove a label from a service USAGE: - rpk desktops cpu [OPTIONS] + rpk services label remove [OPTIONS] + +ARGUMENTS: + The name of the service OPTIONS: - -h, --help Prints help information + -h, --help Prints help information + --key +``` -COMMANDS: - add Add a CPU to a desktop - set Update a desktop CPU - del Remove a CPU from a desktop +## `rpk services list` ``` +DESCRIPTION: +List all services + +USAGE: + rpk services list [OPTIONS] -## `rpk desktops cpu add` +OPTIONS: + -h, --help Prints help information +``` +## `rpk services set` ``` DESCRIPTION: -Add a CPU to a desktop +Update properties of a service USAGE: - rpk desktops cpu add [OPTIONS] + rpk services set [OPTIONS] ARGUMENTS: - The desktop name + OPTIONS: - -h, --help Prints help information - --model The model name - --cores The number of cpu cores - --threads The number of cpu threads + -h, --help Prints help information + --ip The ip address of the service + --port The port the service is running on + --protocol The service protocol + --url The service URL + --runs-on The system(s) the service is running on ``` -## `rpk desktops cpu set` - +## `rpk services subnets` ``` DESCRIPTION: -Update a desktop CPU +List subnets associated with a service, optionally filtered by CIDR USAGE: - rpk desktops cpu set [OPTIONS] - -ARGUMENTS: - The desktop name - The index of the desktop cpu + rpk services subnets [OPTIONS] OPTIONS: - -h, --help Prints help information - --model The cpu model - --cores The number of cpu cores - --threads The number of cpu threads + -h, --help Prints help information + --cidr + --prefix ``` -## `rpk desktops cpu del` - +## `rpk services summary` ``` DESCRIPTION: -Remove a CPU from a desktop +Show a summary report for all services USAGE: - rpk desktops cpu del [OPTIONS] - -ARGUMENTS: - The name of the desktop - The index of the desktop cpu to remove + rpk services summary [OPTIONS] OPTIONS: -h, --help Prints help information ``` -## `rpk desktops drive` - +## `rpk ssh` ``` DESCRIPTION: -Manage storage drives attached to desktops +Generate SSH configuration from infrastructure USAGE: - rpk desktops drive [OPTIONS] + rpk ssh [OPTIONS] OPTIONS: -h, --help Prints help information COMMANDS: - add Add a drive to a desktop - set Update a desktop drive - del Remove a drive from a desktop + export Generate an SSH config file ``` -## `rpk desktops drive add` - +## `rpk ssh export` ``` DESCRIPTION: -Add a drive to a desktop +Generate an SSH config file USAGE: - rpk desktops drive add [OPTIONS] - -ARGUMENTS: - The name of the desktop + rpk ssh export [OPTIONS] OPTIONS: - -h, --help Prints help information - --type The drive type e.g hdd / ssd - --size The drive capacity in Gb + DEFAULT + -h, --help Prints help information + --include-tags Comma-separated list of tags to include (e.g. prod,linux) + --default-user Default SSH user if not defined in labels + --default-port 22 Default SSH port if not defined in labels (default: 22) + --default-identity Default SSH identity file (e.g. ~/.ssh/id_rsa) + -o, --output Write SSH config to file instead of stdout ``` -## `rpk desktops drive set` - +## `rpk summary` ``` DESCRIPTION: -Update a desktop drive +Show a summarized report of all resources in the system USAGE: - rpk desktops drive set [OPTIONS] - -ARGUMENTS: - The desktop name - The drive index to update + rpk summary [OPTIONS] OPTIONS: - -h, --help Prints help information - --type The drive type e.g hdd / ssd - --size The drive capacity in Gb + -h, --help Prints help information ``` -## `rpk desktops drive del` - +## `rpk switches` ``` DESCRIPTION: -Remove a drive from a desktop +Manage network switches USAGE: - rpk desktops drive del [OPTIONS] - -ARGUMENTS: - The name of the desktop - The index of the drive to remove + rpk switches [OPTIONS] OPTIONS: -h, --help Prints help information -``` -## `rpk desktops gpu` +COMMANDS: + summary Show a hardware report for all switches + add Add a new network switch to the inventory + list List all switches in the system + get Retrieve details of a specific switch by name + describe Show detailed information about a switch + set Update properties of a switch + del Delete a switch from the inventory + port Manage ports on a network switch + label Manage labels on a switch +``` +## `rpk switches add` ``` DESCRIPTION: -Manage GPUs attached to desktops +Add a new network switch to the inventory USAGE: - rpk desktops gpu [OPTIONS] + rpk switches add [OPTIONS] + +ARGUMENTS: + OPTIONS: -h, --help Prints help information - -COMMANDS: - add Add a GPU to a desktop - set Update a desktop GPU - del Remove a GPU from a desktop ``` -## `rpk desktops gpu add` - +## `rpk switches del` ``` DESCRIPTION: -Add a GPU to a desktop +Delete a switch from the inventory USAGE: - rpk desktops gpu add [OPTIONS] + rpk switches del [OPTIONS] ARGUMENTS: - The name of the desktop + OPTIONS: - -h, --help Prints help information - --model The Gpu model - --vram The amount of gpu vram in Gb + -h, --help Prints help information ``` -## `rpk desktops gpu set` - +## `rpk switches describe` ``` DESCRIPTION: -Update a desktop GPU +Show detailed information about a switch USAGE: - rpk desktops gpu set [OPTIONS] + rpk switches describe [OPTIONS] ARGUMENTS: - The desktop name - The index of the gpu to update + OPTIONS: - -h, --help Prints help information - --model The gpu model name - --vram The amount of gpu vram in Gb + -h, --help Prints help information ``` -## `rpk desktops gpu del` - +## `rpk switches get` ``` DESCRIPTION: -Remove a GPU from a desktop +Retrieve details of a specific switch by name USAGE: - rpk desktops gpu del [OPTIONS] + rpk switches get [OPTIONS] ARGUMENTS: - The desktop name - The index of the Gpu to remove + OPTIONS: -h, --help Prints help information ``` -## `rpk desktops nic` - +## `rpk switches label` ``` DESCRIPTION: -Manage network interface cards (NICs) for desktops +Manage labels on a switch USAGE: - rpk desktops nic [OPTIONS] + rpk switches label [OPTIONS] OPTIONS: -h, --help Prints help information COMMANDS: - add Add a NIC to a desktop - set Update a desktop NIC - del Remove a NIC from a desktop + add Add a label to a switch + remove Remove a label from a switch ``` -## `rpk desktops nic add` - +## `rpk switches label add` ``` DESCRIPTION: -Add a NIC to a desktop +Add a label to a switch USAGE: - rpk desktops nic add [OPTIONS] + rpk switches label add [OPTIONS] ARGUMENTS: - The desktop name + OPTIONS: - -h, --help Prints help information - --type The nic port type e.g rj45 / sfp+ - --speed The port speed - --ports The number of ports + -h, --help Prints help information + --key + --value ``` -## `rpk desktops nic set` - +## `rpk switches label remove` ``` DESCRIPTION: -Update a desktop NIC +Remove a label from a switch USAGE: - rpk desktops nic set [OPTIONS] + rpk switches label remove [OPTIONS] ARGUMENTS: - The desktop name - The index of the nic to remove + OPTIONS: - -h, --help Prints help information - --type The nic port type e.g rj45 / sfp+ - --speed The speed of the nic in Gb/s - --ports The number of ports + -h, --help Prints help information + --key ``` -## `rpk desktops nic del` - +## `rpk switches list` ``` DESCRIPTION: -Remove a NIC from a desktop +List all switches in the system USAGE: - rpk desktops nic del [OPTIONS] - -ARGUMENTS: - The desktop name - The index of the nic to remove + rpk switches list [OPTIONS] OPTIONS: -h, --help Prints help information ``` -## `rpk Laptops` - +## `rpk switches port` ``` DESCRIPTION: -Manage Laptop computers and their components +Manage ports on a network switch USAGE: - rpk Laptops [OPTIONS] + rpk switches port [OPTIONS] OPTIONS: -h, --help Prints help information COMMANDS: - add Add a new Laptop - list List all Laptops - get Retrieve a Laptop by name - describe Show detailed information about a Laptop - del Delete a Laptop from the inventory - summary Show a summarized hardware report for all Laptops - tree Display the dependency tree for a Laptop - cpu Manage CPUs attached to Laptops - drive Manage storage drives attached to Laptops - gpu Manage GPUs attached to Laptops + add Add a port to a switch + set Update a switch port + del Remove a port from a switch ``` -## `rpk Laptops add` - +## `rpk switches port add` ``` DESCRIPTION: -Add a new Laptop +Add a port to a switch USAGE: - rpk Laptops add [OPTIONS] + rpk switches port add [OPTIONS] ARGUMENTS: OPTIONS: - -h, --help Prints help information -``` - -## `rpk Laptops list` - -``` -DESCRIPTION: -List all Laptops - -USAGE: - rpk Laptops list [OPTIONS] - -OPTIONS: - -h, --help Prints help information + -h, --help Prints help information + --type The port type (e.g., rj45, sfp+) + --speed The port speed (e.g., 1, 2.5, 10) + --count Number of ports of this type ``` -## `rpk Laptops get` - +## `rpk switches port del` ``` DESCRIPTION: -Retrieve a Laptop by name +Remove a port from a switch USAGE: - rpk Laptops get [OPTIONS] + rpk switches port del [OPTIONS] ARGUMENTS: OPTIONS: - -h, --help Prints help information + -h, --help Prints help information + --index ``` -## `rpk Laptops describe` - +## `rpk switches port set` ``` DESCRIPTION: -Show detailed information about a Laptop +Update a switch port USAGE: - rpk Laptops describe [OPTIONS] + rpk switches port set [OPTIONS] ARGUMENTS: OPTIONS: - -h, --help Prints help information + -h, --help Prints help information + --index + --type + --speed + --count ``` -## `rpk Laptops del` - +## `rpk switches set` ``` DESCRIPTION: -Delete a Laptop from the inventory +Update properties of a switch USAGE: - rpk Laptops del [OPTIONS] + rpk switches set [OPTIONS] ARGUMENTS: OPTIONS: - -h, --help Prints help information + -h, --help Prints help information + --Model + --managed + --poe ``` -## `rpk Laptops summary` - +## `rpk switches summary` ``` DESCRIPTION: -Show a summarized hardware report for all Laptops +Show a hardware report for all switches USAGE: - rpk Laptops summary [OPTIONS] + rpk switches summary [OPTIONS] OPTIONS: -h, --help Prints help information ``` -## `rpk Laptops tree` - +## `rpk systems` ``` DESCRIPTION: -Display the dependency tree for a Laptop +Manage systems and their dependencies USAGE: - rpk Laptops tree [OPTIONS] - -ARGUMENTS: - + rpk systems [OPTIONS] OPTIONS: -h, --help Prints help information -``` -## `rpk Laptops cpu` +COMMANDS: + summary Show a summary report for all systems + add Add a new system to the inventory + list List all systems + get Retrieve a system by name + describe Display detailed information about a system + set Update properties of a system + del Delete a system from the inventory + tree Display the dependency tree for a system + label Manage labels on a system +``` +## `rpk systems add` ``` DESCRIPTION: -Manage CPUs attached to Laptops +Add a new system to the inventory USAGE: - rpk Laptops cpu [OPTIONS] + rpk systems add [OPTIONS] + +ARGUMENTS: + OPTIONS: -h, --help Prints help information - -COMMANDS: - add Add a CPU to a Laptop - set Update a Laptop CPU - del Remove a CPU from a Laptop ``` -## `rpk Laptops cpu add` - +## `rpk systems del` ``` DESCRIPTION: -Add a CPU to a Laptop +Delete a system from the inventory USAGE: - rpk Laptops cpu add [OPTIONS] + rpk systems del [OPTIONS] ARGUMENTS: - The Laptop name + The name of the system OPTIONS: - -h, --help Prints help information - --model The model name - --cores The number of cpu cores - --threads The number of cpu threads + -h, --help Prints help information ``` -## `rpk Laptops cpu set` - +## `rpk systems describe` ``` DESCRIPTION: -Update a Laptop CPU +Display detailed information about a system USAGE: - rpk Laptops cpu set [OPTIONS] + rpk systems describe [OPTIONS] ARGUMENTS: - The Laptop name - The index of the Laptop cpu + The name of the system OPTIONS: - -h, --help Prints help information - --model The cpu model - --cores The number of cpu cores - --threads The number of cpu threads + -h, --help Prints help information ``` -## `rpk Laptops cpu del` - +## `rpk systems get` ``` DESCRIPTION: -Remove a CPU from a Laptop +Retrieve a system by name USAGE: - rpk Laptops cpu del [OPTIONS] + rpk systems get [OPTIONS] ARGUMENTS: - The name of the Laptop - The index of the Laptop cpu to remove + The name of the system OPTIONS: -h, --help Prints help information ``` -## `rpk Laptops drive` - +## `rpk systems label` ``` DESCRIPTION: -Manage storage drives attached to Laptops +Manage labels on a system USAGE: - rpk Laptops drive [OPTIONS] + rpk systems label [OPTIONS] OPTIONS: -h, --help Prints help information COMMANDS: - add Add a drive to a Laptop - set Update a Laptop drive - del Remove a drive from a Laptop + add Add a label to a system + remove Remove a label from a system ``` -## `rpk Laptops drive add` - +## `rpk systems label add` ``` DESCRIPTION: -Add a drive to a Laptop +Add a label to a system USAGE: - rpk Laptops drive add [OPTIONS] + rpk systems label add [OPTIONS] ARGUMENTS: - The name of the Laptop + The name of the system OPTIONS: - -h, --help Prints help information - --type The drive type e.g hdd / ssd - --size The drive capacity in Gb + -h, --help Prints help information + --key + --value ``` -## `rpk Laptops drive set` - +## `rpk systems label remove` ``` DESCRIPTION: -Update a Laptop drive +Remove a label from a system USAGE: - rpk Laptops drive set [OPTIONS] + rpk systems label remove [OPTIONS] ARGUMENTS: - The Laptop name - The drive index to update + The name of the system OPTIONS: - -h, --help Prints help information - --type The drive type e.g hdd / ssd - --size The drive capacity in Gb + -h, --help Prints help information + --key +``` + +## `rpk systems list` ``` +DESCRIPTION: +List all systems -## `rpk Laptops drive del` +USAGE: + rpk systems list [OPTIONS] + +OPTIONS: + -h, --help Prints help information +``` +## `rpk systems set` ``` DESCRIPTION: -Remove a drive from a Laptop +Update properties of a system USAGE: - rpk Laptops drive del [OPTIONS] + rpk systems set [OPTIONS] ARGUMENTS: - The name of the Laptop - The index of the drive to remove + OPTIONS: - -h, --help Prints help information + -h, --help Prints help information + --type + --os + --cores + --ram + --runs-on The physical machine(s) the service is running on + --ip The ip address of the system ``` -## `rpk Laptops gpu` - +## `rpk systems summary` ``` DESCRIPTION: -Manage GPUs attached to Laptops +Show a summary report for all systems USAGE: - rpk Laptops gpu [OPTIONS] + rpk systems summary [OPTIONS] OPTIONS: -h, --help Prints help information - -COMMANDS: - add Add a GPU to a Laptop - set Update a Laptop GPU - del Remove a GPU from a Laptop ``` -## `rpk Laptops gpu add` - +## `rpk systems tree` ``` DESCRIPTION: -Add a GPU to a Laptop +Display the dependency tree for a system USAGE: - rpk Laptops gpu add [OPTIONS] + rpk systems tree [OPTIONS] ARGUMENTS: - The name of the Laptop + The name of the system OPTIONS: - -h, --help Prints help information - --model The Gpu model - --vram The amount of gpu vram in Gb + -h, --help Prints help information ``` -## `rpk Laptops gpu set` - +## `rpk ups` ``` DESCRIPTION: -Update a Laptop GPU +Manage UPS units USAGE: - rpk Laptops gpu set [OPTIONS] - -ARGUMENTS: - The Laptop name - The index of the gpu to update + rpk ups [OPTIONS] OPTIONS: - -h, --help Prints help information - --model The gpu model name - --vram The amount of gpu vram in Gb -``` + -h, --help Prints help information -## `rpk Laptops gpu del` +COMMANDS: + summary Show a hardware report for all UPS units + add Add a new UPS unit + list List all UPS units + get Retrieve a UPS unit by name + describe Show detailed information about a UPS unit + set Update properties of a UPS unit + del Delete a UPS unit + label Manage labels on a UPS unit +``` +## `rpk ups add` ``` DESCRIPTION: -Remove a GPU from a Laptop +Add a new UPS unit USAGE: - rpk Laptops gpu del [OPTIONS] + rpk ups add [OPTIONS] ARGUMENTS: - The Laptop name - The index of the Gpu to remove + OPTIONS: -h, --help Prints help information ``` -## `rpk services` - +## `rpk ups del` ``` DESCRIPTION: -Manage services and their configurations +Delete a UPS unit USAGE: - rpk services [OPTIONS] + rpk ups del [OPTIONS] + +ARGUMENTS: + OPTIONS: -h, --help Prints help information - -COMMANDS: - summary Show a summary report for all services - add Add a new service - list List all services - get Retrieve a service by name - describe Show detailed information about a service - set Update properties of a service - del Delete a service - subnets List subnets associated with a service, optionally filtered by CIDR ``` -## `rpk services summary` - +## `rpk ups describe` ``` DESCRIPTION: -Show a summary report for all services +Show detailed information about a UPS unit USAGE: - rpk services summary [OPTIONS] + rpk ups describe [OPTIONS] + +ARGUMENTS: + OPTIONS: -h, --help Prints help information ``` -## `rpk services add` - +## `rpk ups get` ``` DESCRIPTION: -Add a new service +Retrieve a UPS unit by name USAGE: - rpk services add [OPTIONS] + rpk ups get [OPTIONS] ARGUMENTS: - The name of the service + OPTIONS: -h, --help Prints help information ``` -## `rpk services list` - +## `rpk ups label` ``` DESCRIPTION: -List all services +Manage labels on a UPS unit USAGE: - rpk services list [OPTIONS] + rpk ups label [OPTIONS] OPTIONS: -h, --help Prints help information -``` -## `rpk services get` +COMMANDS: + add Add a label to a UPS unit + remove Remove a label from a UPS unit +``` +## `rpk ups label add` ``` DESCRIPTION: -Retrieve a service by name +Add a label to a UPS unit USAGE: - rpk services get [OPTIONS] + rpk ups label add [OPTIONS] ARGUMENTS: - The name of the service + OPTIONS: - -h, --help Prints help information + -h, --help Prints help information + --key + --value ``` -## `rpk services describe` - +## `rpk ups label remove` ``` DESCRIPTION: -Show detailed information about a service +Remove a label from a UPS unit USAGE: - rpk services describe [OPTIONS] + rpk ups label remove [OPTIONS] ARGUMENTS: - The name of the service + OPTIONS: - -h, --help Prints help information + -h, --help Prints help information + --key ``` -## `rpk services set` - +## `rpk ups list` ``` DESCRIPTION: -Update properties of a service +List all UPS units USAGE: - rpk services set [OPTIONS] - -ARGUMENTS: - + rpk ups list [OPTIONS] OPTIONS: - -h, --help Prints help information - --ip The ip address of the service - --port The port the service is running on - --protocol The service protocol - --url The service URL - --runs-on The system the service is running on + -h, --help Prints help information ``` -## `rpk services del` - +## `rpk ups set` ``` DESCRIPTION: -Delete a service +Update properties of a UPS unit USAGE: - rpk services del [OPTIONS] + rpk ups set [OPTIONS] ARGUMENTS: - The name of the service + OPTIONS: - -h, --help Prints help information + -h, --help Prints help information + --model + --va ``` -## `rpk services subnets` - +## `rpk ups summary` ``` DESCRIPTION: -List subnets associated with a service, optionally filtered by CIDR +Show a hardware report for all UPS units USAGE: - rpk services subnets [OPTIONS] + rpk ups summary [OPTIONS] OPTIONS: - -h, --help Prints help information - --cidr - --prefix + -h, --help Prints help information ``` diff --git a/Tests/EndToEnd/ExporterTests/MermaidExportTests.cs b/Tests/EndToEnd/ExporterTests/MermaidExportTests.cs new file mode 100644 index 00000000..35172cf8 --- /dev/null +++ b/Tests/EndToEnd/ExporterTests/MermaidExportTests.cs @@ -0,0 +1,133 @@ +using System.IO; +using System.Threading.Tasks; +using Tests.EndToEnd.Infra; +using Xunit; +using Xunit.Abstractions; + +namespace Tests.EndToEnd.MermaidTests; + +[Collection("Yaml CLI tests")] +public class MermaidExportCommandTests(TempYamlCliFixture fs, ITestOutputHelper outputHelper) + : IClassFixture +{ + private async Task<(string output, string yaml)> ExecuteAsync(params string[] args) + { + outputHelper.WriteLine($"rpk {string.Join(" ", args)}"); + + var output = await YamlCliTestHost.RunAsync( + args, + fs.Root, + outputHelper, + "config.yaml" + ); + + var yaml = await File.ReadAllTextAsync(Path.Combine(fs.Root, "config.yaml")); + return (output, yaml); + } + + [Fact] + public async Task help_commands_do_not_throw() + { + (var output, var _) = await ExecuteAsync("mermaid", "export", "--help"); + Assert.Equal(""" + DESCRIPTION: + Generate a Mermaid infrastructure diagram + + USAGE: + rpk mermaid export [OPTIONS] + + OPTIONS: + -h, --help Prints help information + --include-tags Comma-separated list of tags to include (e.g. + prod,linux) + --diagram-type Mermaid diagram type (default: "flowchart TD") + --no-labels Disable resource label annotations + --no-edges Disable relationship edges + --label-whitelist Comma-separated list of label keys to include + -o, --output Write Mermaid diagram to file instead of stdout + + """, output); + + outputHelper.WriteLine(output); + + (output, _) = await ExecuteAsync("mermaid", "--help"); + Assert.Equal(""" + DESCRIPTION: + Generate Mermaid diagrams from infrastructure + + USAGE: + rpk mermaid [OPTIONS] + + OPTIONS: + -h, --help Prints help information + + COMMANDS: + export Generate a Mermaid infrastructure diagram + + """, output); + + } + + [Fact] + public async Task mermaid_export_creates_expected_diagram() + { + // Prepare test resources + await File.WriteAllTextAsync(Path.Combine(fs.Root, "config.yaml"), ""); + + // Add resources + await ExecuteAsync("servers", "add", "srv01"); + await ExecuteAsync("servers", "add", "srv02"); + await ExecuteAsync("switches", "add", "sw01"); + await ExecuteAsync("services", "add", "svc01"); + await ExecuteAsync("systems", "add", "sys01"); + + // Define RunsOn relationships + await ExecuteAsync("services", "set", "svc01", "--RunsOn", "sys01"); + await ExecuteAsync("systems", "set", "sys01", "--RunsOn", "srv01"); + + // Export Mermaid + (var output, var _) = await ExecuteAsync("mermaid", "export"); + + outputHelper.WriteLine(output); + + // Assertions: check subgraphs + Assert.Contains("subgraph servers", output); + Assert.Contains("subgraph switches", output); + Assert.Contains("subgraph services", output); + Assert.Contains("subgraph systems", output); + + // Assertions: check nodes + Assert.Contains("srv01", output); + Assert.Contains("srv02", output); + Assert.Contains("sw01", output); + Assert.Contains("svc01", output); + Assert.Contains("sys01", output); + + // Assertions: check edges + Assert.Contains("svc01 --> sys01", output); + Assert.Contains("sys01 --> srv01", output); + + // Ensure diagram type is included + Assert.StartsWith("flowchart TD", output); + } + + [Fact] + public async Task mermaid_export_with_tags_and_labels() + { + // Add resources with tags and labels + await ExecuteAsync("servers", "add", "srv03", "--Tags", "db,primary", "--Label", "env:prod"); + + // Export only resources with tag 'db' + (var output, _) = await ExecuteAsync("mermaid", "export", "--IncludeTags", "db"); + + outputHelper.WriteLine(output); + + // Only srv03 should appear + Assert.Contains("srv03", output); + Assert.DoesNotContain("srv01", output); + Assert.DoesNotContain("srv02", output); + + // Label should be included + Assert.Contains("env: prod", output); + } +} diff --git a/generate-docs.sh b/generate-docs.sh index 5075b692..9fb5f987 100755 --- a/generate-docs.sh +++ b/generate-docs.sh @@ -18,11 +18,12 @@ strip_colors() { sed -E "s/\x1B\[[0-9;]*[mK]//g" } + run_help() { - local project="./RackPeek" - local config="Release" - local publish_dir="$project/publish" - local exe="$publish_dir/RackPeek" + local project="./RackPeek" + local config="Release" + local publish_dir="$project/publish" + local exe="$publish_dir/RackPeek" if [[ ! -x "$exe" ]]; then echo "Publishing RackPeek ($config)..." >&2 @@ -30,7 +31,8 @@ run_help() { fi local output - output=$("$exe" "$@" 2>&1 | strip_colors) + output=$("$exe" "$@" 2>&1 | strip_colors || true) + echo "$output" } @@ -68,26 +70,26 @@ get_description() { ' } -# UPDATED: Handles "add " correctly by taking only the first column ($1) + get_child_commands() { local help_output="$1" - + echo "$help_output" | awk ' - BEGIN { in_commands = 0 } - /^COMMANDS:/ { in_commands = 1; next } - + /^COMMANDS:/ { in_commands=1; next } + in_commands { - # Stop if we hit an empty line or a new section - if ($0 ~ /^[[:space:]]*$/) exit; - if ($0 ~ /^[A-Z]+:/) exit; - - # Match lines that look like commands (indented) - if ($0 ~ /^[[:space:]]+[a-zA-Z0-9-]+/) { - # Print only the first word (the command name) - print $1 + # stop when another section header appears + if ($0 ~ /^[A-Z]+:/) exit + + # ignore empty lines + if ($0 ~ /^[[:space:]]*$/) next + + # capture first token (command name) + if (match($0, /^[[:space:]]*([a-zA-Z0-9_-]+)/, m)) { + print m[1] } } - ' + ' | sort -u } # ---------------------------- @@ -160,16 +162,22 @@ fi # 5. Recurse local child_cmds mapfile -t child_cmds < <(get_child_commands "$help_output") - + + # If no children, still create a leaf entry + if [[ ${#child_cmds[@]} -eq 0 && ${#current_cmd_array[@]} -gt 0 ]]; then + # Leaf command entry + echo "$tree_entry" >> "$TREE_TEMP" + fi + for child in "${child_cmds[@]}"; do - echo "Recursing into: ${display_header} ${child}" >&2 - local next_path - if [[ -z "$path_string" ]]; then - next_path="$child" - else - next_path="$path_string $child" - fi - generate_help_recursive "$next_path" + echo "Recursing into: ${display_header} ${child}" >&2 + local next_path + if [[ -z "$path_string" ]]; then + next_path="$child" + else + next_path="$path_string $child" + fi + generate_help_recursive "$next_path" done }