MCPcopy
hub / github.com/kvcache-ai/ktransformers / check_first_run

Function check_first_run

kt-kernel/python/cli/main.py:77–100  ·  view source on GitHub ↗

Check if this is the first run and prompt for language setup.

()

Source from the content-addressed store, hash-verified

75
76
77def check_first_run() -> None:
78 """Check if this is the first run and prompt for language setup."""
79 import os
80
81 # Skip if not running in interactive terminal
82 if not sys.stdin.isatty():
83 return
84
85 from kt_kernel.cli.config.settings import DEFAULT_CONFIG_FILE
86
87 # Only check if config file exists - don't create it yet
88 if not DEFAULT_CONFIG_FILE.exists():
89 # First run - show welcome and language selection
90 from kt_kernel.cli.config.settings import get_settings
91
92 settings = get_settings()
93 _show_first_run_setup(settings)
94 else:
95 # Config exists - check if initialized
96 from kt_kernel.cli.config.settings import get_settings
97
98 settings = get_settings()
99 if not settings.get("general._initialized"):
100 _show_first_run_setup(settings)
101
102
103def _show_first_run_setup(settings) -> None:

Callers 1

mainFunction · 0.85

Calls 3

get_settingsFunction · 0.90
_show_first_run_setupFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected