MCPcopy Create free account
hub / github.com/InsForge/InsForge / cmd_init

Function cmd_init

examples/python-ml-experiment-tracker/tracker/cli.py:168–188  ·  view source on GitHub ↗

Verify that the required InsForge tables exist and are accessible.

()

Source from the content-addressed store, hash-verified

166@cli.command("init")
167@handle_errors
168def cmd_init() -> None:
169 """Verify that the required InsForge tables exist and are accessible."""
170 with InsForgeClient() as client:
171 missing = [t for t in REQUIRED_TABLES if not client.table_exists(t)]
172
173 if not missing:
174 console.print(Panel(
175 "[green]Database ready.[/] Tables [bold]experiments[/] and [bold]runs[/] are accessible.",
176 ))
177 return
178
179 missing_list = ", ".join(f"[bold]{t}[/]" for t in missing)
180 err_console.print(Panel(
181 f"[yellow]Missing tables:[/] {missing_list}\n\n"
182 "InsForge table creation requires admin access. Ask your project admin to run "
183 "the following migration via the InsForge dashboard or admin API:\n\n"
184 f"[dim]{ADMIN_SETUP_SQL}[/]",
185 title="Setup required",
186 border_style="yellow",
187 ))
188 raise SystemExit(1)
189
190
191# ── tracker log ───────────────────────────────────────────────────────────

Callers

nothing calls this directly

Calls 2

InsForgeClientClass · 0.90
table_existsMethod · 0.80

Tested by

no test coverage detected