Skip to content

feat(init): print a closing summary instead of logging each step - #865

Open
morinokami wants to merge 4 commits into
voidzero-dev:mainfrom
morinokami:feat/init-summary
Open

morinokami wants to merge 4 commits into
voidzero-dev:mainfrom
morinokami:feat/init-summary

Conversation

@morinokami

Copy link
Copy Markdown
Collaborator

This PR changes how void init reports its work. Init used to print one line for each step as it ran. It now records what it does and prints a short summary right before the success line.

This follows #853 and #860. The dependency install still prints its full output here. More PRs will follow to shorten the rest of the void init output in the style of vp create.

Changes

A summary instead of one line per step

Init printed a gray ◇ line for every file it created or changed. Answered questions use the same ◇, so the output did not show which lines were the user's answers and which were init's work. A new project also printed about 20 of these lines, most of them for the starter's files, which are all new.

Steps now record their file changes, and init prints them once at the end:

  • A new starter gets one line, such as "Created a React Pages starter with D1 (SQLite)". A starter in a new subfolder adds "in ./my-app", which replaces the "Scaffolding in " line.
  • An existing project gets "Configured Void" with the files below it: new files with +, then changed files with ~ and what changed in each.
  • A run that changes nothing prints "Void is already set up. No files changed." It replaces the lines that reported no change, such as "tsconfig.json looks good", "No database configured yet" and "AGENTS.md already has Void instructions".

Warnings, and the notes that ask the user to do something by hand, still print where they did.

Next steps as → lines

Hints for the user were spread through the log, as blue ● lines, as a box, or at the end of a ◇ line: the Git (optional) command, the DATABASE_URL note of a PostgreSQL or MySQL starter, "Don't forget to install typescript", the lockfile hint, and the env.ts hints. Init used the same ● for status lines and skipped steps, so the hints did not stand out. They now follow the summary as → lines. The lockfile hint is left out when init installs the dependencies itself.

"Bundled Void docs: node_modules/void/docs/" is gone. A new project's AGENTS.md points to the same docs, and so does the line that init prints when it skips AGENTS.md without a terminal.

One line for linked skills

Init printed a header for each detected agent and a line for each skill. Amp, Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode read the same .agents/skills folder, so with two of them the second block only said "already linked". Init now links each folder once and prints one line, such as "Linked Void skills for Codex and Cursor". A path that is in the way warns once, with its path.

A run that stops early says what it changed

Without the step lines, a run that stops before the summary would leave its changes unmentioned. That matters in an existing project, which init configures before it asks its first question. When a prompt is cancelled or a step fails, init now prints a warning with the files it changed so far, or with the starter it created. It prints nothing if it changed nothing.

Before / after

Blank lines are omitted, and the starter's file lines and the install output are shortened.

New project, answering every question:

 ● Empty project detected. Creating a Pages starter.
 ◇ Initialize a git repository?
   Yes
 ◇ Choose a Pages scaffold toolchain:
   Vite+
 ◇ Choose a Pages framework to scaffold:
   React
 ◇ Choose a Pages starter:
   D1 (SQLite)
 ◇ Where should this project deploy?
   Skip deployment setup
-◇ Updated pnpm-workspace.yaml with approved builds
-◇ Updated package.json with starter scripts and dependencies
-◇ Created void.config.ts
-…
-◇ Created AGENTS.md with Void instructions
-● Bundled Void docs: node_modules/void/docs/
 ◇ Installing dependencies with vp
   … (vp install output)
 ◇ Installed dependencies with vp
 ◇ Generating initial Drizzle migration
 ◇ Generated initial Drizzle migration
-● Git (optional): git add -A && git commit -m "chore: initial commit"
+✓ Created a React Pages starter with D1 (SQLite)
+→ Git (optional): git add -A && git commit -m "chore: initial commit"
 ✓ Project initialized. Run `vp dev` to start developing.

An existing Vite app with a .claude folder:

 ● Existing project detected. Configuring Void.
-◇ Updated package.json with Void dependencies and Vite scripts
-◇ Added voidPlugin() to vite.config.ts
-◇ Updated tsconfig.json — added extends .void/tsconfig.json
-◇ Updated tsconfig.json — added void/env to types
-◇ Created .gitignore
-◇ Pinned worker compatibility_date in void.config.ts
 ◇ Choose a database setup for this project:
   No Database Yet
-● No database configured yet
 ◇ Create AGENTS.md with Void instructions?
   Yes
-◇ Created AGENTS.md with Void instructions
-● Claude Code → .claude/skills
-◇   migrate-cloudflare-to-void — linked
-◇   void — linked
 ◇ Scaffold demo code? (migration + API route + frontend fetch)
   No
 ◇ Where should this project deploy?
   Skip deployment setup
 ◇ Installing dependencies with npm
   … (npm install output)
 ◇ Installed dependencies with npm
+✓ Configured Void
+  + .gitignore
+  + void.config.ts
+  + AGENTS.md
+  ~ package.json    added void
+  ~ vite.config.ts  added voidPlugin()
+  ~ tsconfig.json   extends .void/tsconfig.json, added void/env to types
+✓ Linked Void skills for Claude Code
 ✓ Project initialized. Run `vite dev` to start developing.

void init again in the same app:

 ● Existing project detected. Configuring Void.
-● vite.config.ts already includes voidPlugin()
-◇ tsconfig.json looks good
 ◇ Choose a database setup for this project:
   No Database Yet
-● No database configured yet
-● AGENTS.md already has Void instructions (v1.10.0)
-● Claude Code → .claude/skills
-●   migrate-cloudflare-to-void — already linked
-●   void — already linked
 ◇ Scaffold demo code? (migration + API route + frontend fetch)
   No
 ◇ Where should this project deploy?
   Skip deployment setup [current]
+✓ Void is already set up. No files changed.
 ✓ Project initialized. Run `vite dev` to start developing.

Ctrl+C at the first question of an existing app:

 ● Existing project detected. Configuring Void.
-◇ Updated package.json with Void dependencies and Vite scripts
-◇ Added voidPlugin() to vite.config.ts
-◇ Updated tsconfig.json — added extends .void/tsconfig.json
-◇ Updated tsconfig.json — added void/env to types
-◇ Created .gitignore
-◇ Pinned worker compatibility_date in void.config.ts
 ■ Choose a database setup for this project:
   D1 (SQLite)
 Setup cancelled.
+▲ Setup did not finish. Files changed so far:
+  + .gitignore
+  + void.config.ts
+  ~ package.json    added void
+  ~ vite.config.ts  added voidPlugin()
+  ~ tsconfig.json   extends .void/tsconfig.json, added void/env to types

A new project whose install fails:

 ◇ Installing dependencies with vp
   … (vp install output)
+▲ Setup did not finish. Done so far:
+✓ Created a React Pages starter with D1 (SQLite)
 ■ vp install failed with exit code 1

With --framework vue --starter postgresql, the DATABASE_URL box becomes a next step:

-╭─PostgreSQL local dev─────────────────────────────────────────────────╮
-│                                                                      │
-│  Add DATABASE_URL to .env before running `vp dev`.                   │
-│  Void uses that direct connection for local PostgreSQL development.  │
-│                                                                      │
-╰──────────────────────────────────────────────────────────────────────╯
   …
+✓ Created a Vue Pages starter with PostgreSQL
+→ Add DATABASE_URL to .env before running `vp dev` (Void uses it for local PostgreSQL development)
 ✓ Project initialized. Run `vp dev` to start developing.

Design decisions

  • Steps record a change right after they write the file, in an InitReport that runInitCommand() passes down. Output that other commands share is unchanged: the Cloudflare and Void platform setup, and the config migration.
  • A file that init creates stays a new file when a later step changes it, so void.config.ts appears once, with +. Files that the config migration creates are listed the same way.
  • The details name what init added. package.json says "added void" where the old line said "Void dependencies and Vite scripts" for an app that already had both scripts.
  • output.ts gets printDone (green ✓) and printNextStep (blue →). The last line is still printSuccess.
  • The install and migration lines are unchanged and print before the summary. Moving only "Generated initial Drizzle migration" into the summary would put the starter line between "Generating…" and "Generated…". A follow-up will replace both pairs.
  • Cancelled prompts call process.exit() in several modules, so an exit listener prints the early-stop warning. A failed step prints it before the error is rethrown, which keeps the error as the last line.
  • --tsconfig and --github runs check only part of the setup. When they change nothing, they print "No files changed." without "Void is already set up".
  • For the generated .void-wrangler.jsonc, which Git ignores, the summary lists void.lock.json, which records the same change.
  • No flag lists the starter's files.

Checked

  • init.test.ts (a new "init summary" group), and the new init-report.test.ts and skills.test.ts
  • vp check and vp run check:types
  • Full suite (vp test run): 824 files passed, 1 skipped
  • node --test .github/scripts/packed-*.test.mjs, and the packed consumer with npm and pnpm (React) and with Vite+ (pnpm, React)
  • The built CLI before (void@1.10.0 from npm) and after, for the flows above

🤖 Generated with Claude Code

morinokami and others added 4 commits November 17, 2026 18:16
Init records the files it creates or changes and prints them once, right
before the success line: one line for a new starter, the changed files for
an existing project, or "No files changed". Next steps such as the Git
hint and the DATABASE_URL note follow as "→" lines.

A run that stops early, on a cancelled prompt or a failed step, prints
what it had already changed as a warning.

Skills are linked once per folder, so agents that share .agents/skills
are all named and a conflict warns once.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J8F8mZkyRDommrR2VQzcuN
setupTsconfig() recorded each change before it wrote the file, so a failed
write still listed tsconfig.json as changed. It now records the changes
once the write succeeds.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J8F8mZkyRDommrR2VQzcuN

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants