Skip to content

Improve Kit startup context and actionable CLI errors#124

Merged
alexec merged 6 commits into
mainfrom
copilot/implement-ux-improvements
Jun 26, 2026
Merged

Improve Kit startup context and actionable CLI errors#124
alexec merged 6 commits into
mainfrom
copilot/implement-ux-improvements

Conversation

Copilot AI commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

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

    • Emit a stable startup line describing Kit and including build/version when available.
    • Emit the resolved config file path on startup.
    • Distinguish config source as default vs explicit.
  • Top-level error shaping

    • Route CLI execution through a single testable entrypoint.
    • Normalize user-facing failures into three lines:
      • kit: error: ...
      • kit: cause: ...
      • kit: next: ...
  • Covered failure classes

    • Invalid CLI flags / argument parsing
    • Invalid or inaccessible working directory
    • Config read / parse / rewrite failures
    • Workflow selection / validation / task failure summaries
  • Behavior notes

    • Keep existing non-zero exit behavior for failures.
    • Preserve help/version/completion flows while improving completion error wording.
  • Tests

    • Add focused coverage for startup messaging, config source/path reporting, malformed config handling, invalid flags, and runtime task failures.

Example of the new surface:

kit: startup: workflow engine for software development; version=(devel)
kit: config: path=/workspace/tasks.yaml source=default

kit: error: workflow run failed: failed tasks: [job]
kit: cause: one or more tasks exited with a non-zero status
kit: next: inspect the task output above or the logs/ directory and retry

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
Copilot AI requested a review from alexec June 25, 2026 23:56
@alexec alexec requested a review from Copilot June 26, 2026 00:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 main into a single testable run/execute flow 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.

Comment thread main.go
Comment thread main_test.go Outdated
Comment thread main_test.go Outdated
Comment thread main_test.go Outdated
alexec and others added 4 commits June 25, 2026 17:13
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 alexec marked this pull request as ready for review June 26, 2026 00:20
@alexec alexec merged commit 593382d into main Jun 26, 2026
2 checks passed
@alexec alexec deleted the copilot/implement-ux-improvements branch June 26, 2026 00:21
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.
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.

3 participants