import { readFileSync } from "node:fs";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
function packageRoot() {
  const here = dirname(fileURLToPath(import.meta.url));
  return join(here, "..", "..");
}
function getVersion() {
  try {
    const raw = readFileSync(join(packageRoot(), "package.json"), "utf-8");
    const pkg = JSON.parse(raw);
    return pkg.version ?? "0.0.0";
  } catch {
    return "0.0.0";
  }
}
const HELP_TEXT = `wigolo \u2014 local-first web intelligence MCP server

Usage:
  wigolo                  Start MCP server on stdio (default)
  wigolo <command>        Run a subcommand

Subcommands:
  warmup                  Pre-fetch models + run setup checks
  serve                   Start HTTP daemon
  health                  Health check (exit code = status)
  doctor                  Diagnose installation
  auth                    Manage site auth
  plugin                  Manage plugins
  shell                   Interactive REPL
  init                    Initialize project config
  uninstall               Remove wigolo install
  setup mcp               Wire wigolo into MCP clients
  status                  Show running daemon status
  backfill                Backfill embeddings for cached pages without them

Options:
  -h, --help              Print this help
  -V, --version           Print version

Docs: https://github.com/KnockOutEZ/wigolo
`;
function printHelp(stream = process.stdout) {
  stream.write(HELP_TEXT);
}
function printVersion(stream = process.stdout) {
  stream.write(`wigolo ${getVersion()}
`);
}
function printUnknownCommand(name, stream = process.stderr) {
  stream.write(`wigolo: unknown command '${name}'

`);
  stream.write(HELP_TEXT);
}
export {
  HELP_TEXT,
  getVersion,
  printHelp,
  printUnknownCommand,
  printVersion
};
//# sourceMappingURL=help.js.map