From f53d9f198410663d3777aa3db8d2afd14d30dfc4 Mon Sep 17 00:00:00 2001 From: 7000pctAUTO Date: Tue, 3 Feb 2026 06:56:40 +0000 Subject: [PATCH] Add CLI commands and output renderer --- vibeguard/cli/commands/init.py | 61 ++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 vibeguard/cli/commands/init.py diff --git a/vibeguard/cli/commands/init.py b/vibeguard/cli/commands/init.py new file mode 100644 index 0000000..79b42ab --- /dev/null +++ b/vibeguard/cli/commands/init.py @@ -0,0 +1,61 @@ +"""Init command for VibeGuard CLI.""" + +import os +from pathlib import Path + +import click + + +@click.command(name="init") +@click.option("--path", "-p", type=click.Path(), default=".", help="Path to create config") +@click.pass_obj +def init(ctx: dict, path: str) -> None: + """Initialize VibeGuard configuration in the current directory.""" + config_path = Path(path) / ".vibeguard.toml" + + config_content = '''version = "0.1.0" + +[analyze] +severity_threshold = "warning" +incremental = true +workers = 0 + +[patterns] +enabled = ["all"] +disabled = [] + +[ignore] +paths = [ + "*.egg-info/", + "*.pyc", + "__pycache__/", + ".git/", + "node_modules/", + "vendor/", + "test_*/", + "*_test.go", +] + +[output] +theme = "default" +show_fixes = true +show_snippets = true +max_snippet_lines = 10 + +[formats] +json = true +html = true +sarif = true + +[github] +comment_on_pr = false +create_check_runs = true +sarif_upload_url = "" +''' + + if config_path.exists(): + click.echo(f"[warning]Config file already exists at {config_path}[/warning]") + return + + config_path.write_text(config_content) + click.echo(f"[success]Created config file at {config_path}[/success]")