old sprints work, new sprints for exposing functionality via cli, improve code_of_conduct and other agents instructions
This commit is contained in:
54
src/Cli/StellaOps.Cli/Commands/ConfigCommandGroup.cs
Normal file
54
src/Cli/StellaOps.Cli/Commands/ConfigCommandGroup.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
// <copyright file="ConfigCommandGroup.cs" company="StellaOps">
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
// Sprint: SPRINT_20260112_014_CLI_config_viewer (CLI-CONFIG-010, CLI-CONFIG-011)
|
||||
// </copyright>
|
||||
|
||||
using System.CommandLine;
|
||||
using StellaOps.Cli.Services;
|
||||
|
||||
namespace StellaOps.Cli.Commands;
|
||||
|
||||
/// <summary>
|
||||
/// CLI commands for inspecting StellaOps configuration.
|
||||
/// </summary>
|
||||
public static class ConfigCommandGroup
|
||||
{
|
||||
public static Command Create(IBackendOperationsClient client)
|
||||
{
|
||||
var configCommand = new Command("config", "Inspect StellaOps configuration");
|
||||
|
||||
// stella config list
|
||||
var listCommand = new Command("list", "List all available configuration paths");
|
||||
var categoryOption = new Option<string?>(
|
||||
["--category", "-c"],
|
||||
"Filter by category (e.g., policy, scanner, notifier)");
|
||||
listCommand.AddOption(categoryOption);
|
||||
listCommand.SetHandler(
|
||||
async (string? category) => await CommandHandlers.Config.ListAsync(category),
|
||||
categoryOption);
|
||||
|
||||
// stella config <path> show
|
||||
var pathArgument = new Argument<string>("path", "Configuration path (e.g., policy.determinization, scanner.epss)");
|
||||
var showCommand = new Command("show", "Show configuration for a specific path");
|
||||
showCommand.AddArgument(pathArgument);
|
||||
var formatOption = new Option<string>(
|
||||
["--format", "-f"],
|
||||
() => "table",
|
||||
"Output format: table, json, yaml");
|
||||
var showSecretsOption = new Option<bool>(
|
||||
"--show-secrets",
|
||||
() => false,
|
||||
"Show secret values (default: redacted)");
|
||||
showCommand.AddOption(formatOption);
|
||||
showCommand.AddOption(showSecretsOption);
|
||||
showCommand.SetHandler(
|
||||
async (string path, string format, bool showSecrets) =>
|
||||
await CommandHandlers.Config.ShowAsync(client, path, format, showSecrets),
|
||||
pathArgument, formatOption, showSecretsOption);
|
||||
|
||||
configCommand.AddCommand(listCommand);
|
||||
configCommand.AddCommand(showCommand);
|
||||
|
||||
return configCommand;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user