MCPcopy Create free account
hub / github.com/bigdra50/unity-cli / config_show

Function config_show

unity_cli/cli/commands/config.py:27–54  ·  view source on GitHub ↗

Print the resolved config (from file + env vars + CLI flags) and its source path.

(
    ctx: typer.Context,
    json_flag: Annotated[
        bool,
        typer.Option("--json", help="Output as JSON"),
    ] = False,
)

Source from the content-addressed store, hash-verified

25
26@config_app.command("show")
27def config_show(
28 ctx: typer.Context,
29 json_flag: Annotated[
30 bool,
31 typer.Option("--json", help="Output as JSON"),
32 ] = False,
33) -> None:
34 """Print the resolved config (from file + env vars + CLI flags) and its source path."""
35 context: CLIContext = ctx.obj
36 config_file = UnityCLIConfig._find_config_file()
37
38 if _should_json(context, json_flag):
39 # JSON mode
40 data = {
41 "config_file": str(config_file) if config_file else None,
42 "relay_host": context.config.relay_host,
43 "relay_port": context.config.relay_port,
44 "timeout": context.config.timeout,
45 "instance": context.config.instance,
46 }
47 print_json(data, None)
48 else:
49 print_line("[bold]=== Unity CLI Configuration ===[/bold]")
50 print_line(f"Config file: {config_file or '[dim]Not found (using defaults)[/dim]'}")
51 print_line(f"Relay host: {context.config.relay_host}")
52 print_line(f"Relay port: {context.config.relay_port}")
53 print_line(f"Timeout: {context.config.timeout}s")
54 print_line(f"Instance: {context.config.instance or '[dim](default)[/dim]'}")
55
56
57@config_app.command("init")

Callers

nothing calls this directly

Calls 4

_should_jsonFunction · 0.90
print_jsonFunction · 0.90
print_lineFunction · 0.90
_find_config_fileMethod · 0.80

Tested by

no test coverage detected