@ogygia/cli
Commands
Every command of `npx ogygia` with its flags, defaults and exit codes, as a reference. The task pages explain what each command does in depth.
This page lists every command, flag, default and exit code of the ogygia command in one place. Each command’s section links the page that explains it.
npx ogygia <command> [arguments] [flags]Usage
Run every command from your app’s root folder, through npx or your package manager’s runner. How it runs explains how the ogygia command finds @ogygia/cli.
A flag that takes a value reads the next argument. For perf and bisect, a value that starts with -- counts as missing. npx ogygia, npx ogygia help and npx ogygia --help print the usage and exit with 0; an unknown command prints it and exits with 1.
npx ogygia init
pnpm dlx ogygia initinit
Wires ogygia into the SvelteKit app in the current folder: the dependencies, the Vite plugin, the hooks, the types and a .gitignore line, merged into what’s already there. Then it installs. Project setup shows each file it writes.
| Flag | Default | What it does |
|---|---|---|
--markdown / --no-markdown | asks, and the answer is no | Turns markdown content collections on or off. With no terminal to ask in, it’s off. |
--no-install | Edits package.json but skips the install. | |
-y, --yes | Asks nothing. Markdown stays off unless you also pass --markdown. |
It exits with 0 when the app is wired, and with 1 when there’s no package.json, the package.json isn’t valid JSON, @sveltejs/kit isn’t a dependency, or there’s no vite.config.ts or vite.config.js. A failed install is reported but still exits with 0.
npx ogygia init [--markdown | --no-markdown] [--no-install] [-y]site init
Scaffolds a docs site as files you own. It runs the same wiring as init with markdown on, turns on Svelte’s async compiler, and writes the site, the routes and a layout. Docs site lists the files.
| Flag | Default | What it does |
|---|---|---|
--layout <path> | src/routes/+layout.svelte | The layout to write: a +layout.svelte under src/routes. Its folder is where the site mounts. |
--force | Overwrites every file it writes, your layout and existing starter pages included. | |
--no-install | Skips the install. | |
-y, --yes | Asks nothing. A layout you wrote yourself is then never overwritten: the command stops and says how to go on. |
It exits with 1 for the same missing files as init, for a --layout that isn’t a +layout.svelte under src/routes, and when it won’t overwrite your layout, by which time part of the site is written (Existing files). npx ogygia site alone prints its usage and exits with 0; npx ogygia site <other> exits with 1.
The usage text the command prints is behind this page in three places: it says the layout always asks even with --force (it doesn’t), and its flag lists leave out --no-install under site init and --no-markdown on the init line, though both work (#2314, item 12).
npx ogygia site init [--layout <path>] [--force] [--no-install] [-y]keys
Makes an Ed25519 key pair for signing federation calls and prints it as two export lines on standard output, named from name. Key pairs has the naming rule and the formats.
| Argument | Default | What it does |
|---|---|---|
name | ogygia | The prefix of the two variable names, upper-cased. Each run of characters other than A–Z and 0–9 becomes one _, and a _ at either end is dropped. |
It always exits with 0, and never writes a file.
npx ogygia keys [name]fragments
Reads a federated app’s widget catalog at <origin>/og/fragment/__catalog and writes a TypeScript stub, or checks a committed one. Widget stubs shows the stub.
| Flag | What it does |
|---|---|
| (neither) | Prints the stub to standard output. |
--out <file> | Writes the stub to file. |
--check <file> | Compares the stub the live catalog makes with file, byte for byte, and exits with 1 when they differ. |
It exits with 0 on success, and with 1 when <origin> is missing or isn’t a URL, the catalog doesn’t answer within 10 seconds, answers an error status or something that isn’t { names: string[] }, the --check file doesn’t exist, or the stub drifted.
npx ogygia fragments <origin> [--out <file>] [--check <file>]ai
Writes the ogygia skill to .claude/skills/ogygia/SKILL.md, replacing an older copy, and registers the MCP server in .mcp.json as ogygia, keeping the other servers there. Skill explains both. It takes no flags.
It exits with 1 when .mcp.json exists but isn’t valid JSON, and with 0 otherwise. The skill is written before .mcp.json is read, so after that failure it’s already in place: fix .mcp.json and run the command again.
npx ogygia aimcp
Runs the MCP server on standard input and output until the client disconnects. It logs to standard error. Tools lists what it offers. It takes no flags.
npx ogygia mcpperf
Renders each page under the SSR profiler on a running server, writes a snapshot, and judges it against a baseline under a budget. Perf budgets covers the snapshot, the budget file and the comment.
| Flag | Default | What it does |
|---|---|---|
--url <origin> | required | The running server. |
--pages <list> | required, or --pages-file | The pages to measure, comma-separated paths that start with /. |
--pages-file <file> | A JSON array of paths, or { "pages": […] }, added to --pages. | |
--runs <n> | 5 | Renders per page, from 1 to 50. |
--key <secret> | $OGYGIA_PROFILER_SECRET | The profiler’s secret, sent as x-profiler-key. A dev server needs none. |
--base <path> | /__profiler | Where the profiler is mounted. |
--baseline <file> | The snapshot to compare with. Without it, or when the file doesn’t exist, only the caps are judged. | |
--budget <file> | the default budget | The budget JSON. |
--out <file> | Writes the snapshot. | |
--md <file> | Writes the PR comment as markdown. | |
--label <text> | A label kept in the snapshot and shown in the comment’s title, such as the commit. | |
--no-fail | Exits with 0 even when the budget fails. |
| Exit | When |
|---|---|
0 | The budget passed, or it failed under --no-fail. |
1 | The budget failed. Also: a --budget, --baseline or --pages-file that isn’t valid JSON. |
2 | --url or every page is missing, a page isn’t a path, or a page couldn’t be measured. |
npx ogygia perf --url <origin> --pages /a,/b [flags]bisect
Builds and profiles commits between --good and --bad in a binary search, each in its own git worktree, and names the first one that made a page slower. First bad commit shows a run.
| Flag | Default | What it does |
|---|---|---|
--good <ref> | required | A commit, tag or branch where the page was fast. |
--bad <ref> | HEAD | Where it’s slow. |
--page <path> | required | The page to profile. |
--build "<cmd>" | required | Builds a checkout. Runs in each worktree with CI=1 set. |
--start "<cmd>" | required | Starts the built app in each worktree. |
--url <origin> | required | Where the started app answers. |
--key <secret> | $OGYGIA_PROFILER_SECRET | The profiler’s secret. |
--runs <n> | 3 | Renders per commit, from 1 to 50. |
--margin <share> | 0.5 | Where the bar sits between the good and the bad median, as a share of the gap. |
--ready <ms> | 60000 | How long to wait for a free port and for the started app to answer. |
--build-timeout <ms> | 900000 | How long one build may take (15 minutes). |
| Exit | When |
|---|---|
0 | It named a commit. |
1 | No commit in the range crossed the bar, or the bad end wasn’t slower than the good one. Also: a git command that failed. |
2 | A required flag is missing, there are no commits between the two refs, or one of the two ends couldn’t be measured. |
npx ogygia bisect --good <ref> --page /x --build "<cmd>" --start "<cmd>" --url <origin> [flags]