Improve Kit startup context and actionable CLI errors#124
Merged
Conversation
Copilot
AI
changed the title
[WIP] Improve startup and error output messages for Kit
Improve Kit startup context and actionable CLI errors
Jun 25, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors Kit’s CLI entrypoint to emit clearer startup context (what Kit is, version when available, resolved config path + source) and to normalize top-level user-facing failures into consistent kit: error/cause/next messaging, with focused tests to validate the new output surfaces.
Changes:
- Refactor
maininto a single testablerun/executeflow and add stable startup + config-source/path lines. - Add structured, actionable error shaping for flag parsing, working directory failures, config read/parse/rewrite, and common runtime workflow failures.
- Add unit tests asserting startup messaging and actionable error formatting for several failure classes.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| main.go | Introduces run/execute, prints startup/config context, and shapes common CLI/runtime errors into actionable 3-line messages. |
| main_test.go | Adds coverage for startup/config reporting and for the new normalized error surfaces. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Alex Collins <alexec@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Alex Collins <alexec@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Alex Collins <alexec@users.noreply.github.com>
alexec
added a commit
that referenced
this pull request
Jun 26, 2026
Resolved main.go conflict by taking the upstream rewrite (#124), which already includes the debug.ReadBuildInfo ok-check fix.
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.
Kit startup output did not tell users or agents what Kit is or which config file was actually loaded, and top-level failures surfaced as raw errors without clear recovery guidance. This change makes startup output self-describing and normal user errors explicit about what failed, why, and what to do next.
Startup context
defaultvsexplicit.Top-level error shaping
kit: error: ...kit: cause: ...kit: next: ...Covered failure classes
Behavior notes
Tests
Example of the new surface: