Add ghost init command for interactive post-install setup#13
Merged
Conversation
c00d32a to
d89d427
Compare
murrayju
added a commit
that referenced
this pull request
May 15, 2026
Cobra's `doc.GenMarkdownTree` emits files that end with a blank line (`...text\n\n`). `git diff --check` flags that as a whitespace error whenever a doc gets added or its tail modified — e.g. the doc EOF issues called out in the review of #13. Fix: post-process generated markdown in `cmd/generate-docs` to collapse trailing newlines down to a single `\n`, and regenerate every CLI doc to match. Future regenerations stay clean automatically. The 52 doc-file changes are mechanical (one trailing newline removed each); the only behavior change is in `cmd/generate-docs/main.go`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ghost init, an interactive multi-select that walks the user through adding Ghost to$PATH, logging in, installing the MCP server for one or more clients, and installing shell completions. Each step shows its detected status (e.g.already in PATH (~/.local/bin),already configured (you@example.com)) and is pre-selected only if not already configured.ghost init path— a non-interactive subcommand that appends the install dir to the user's shell rc file. Suitable for scripts.--skip-if-configuredsoghost initis safe to re-run from the installer; it exits cleanly when nothing needs to change.scripts/install.shnow delegates all post-install setup (PATH, login, MCP, completions) toghost init, removing ~200 lines of shell-side rc-file logic that previously duplicated what the Go code can now do correctly. The installer falls back toghost init pathwhen/dev/ttyisn't usable.ghost mcp installandghost mcp uninstallnow support multi-client selection via the same shared multi-select prompt — pick any combination interactively, or passall/ a specific client name as before.internal/common/multiselect.goand the shell rc / PATH / completion helpers intointernal/common/shell_setup.go, both with unit tests../checkscript that runsgo install,fmt,mod tidy,fix,vet,staticcheck, andtestin one shot; CLAUDE.md updated to reference it.docs/cli/.Test plan
./checkpassescurl -fsSL https://install.ghost.build | shwalks through the new menu on a machine with no prior Ghost config--skip-if-configuredpath)ghost initwith stdin redirected returns the TTY error instead of hangingghost init pathworks undersh -cwith no TTY (smoke test for the script-friendly fallback)ghost mcp installwith no args shows the multi-select; selecting multiple clients installs into all of themghost mcp uninstallwith no args shows the multi-select; selected clients are removed and others are left aloneghost initexits the flow cleanly with "Canceled."ghost initexits without a stack trace🤖 Generated with Claude Code