Skip to content

Improve first-run experience and event store selection#7

Merged
woksin merged 7 commits intomainfrom
feat/plug-and-play-first-run
May 4, 2026
Merged

Improve first-run experience and event store selection#7
woksin merged 7 commits intomainfrom
feat/plug-and-play-first-run

Conversation

@woksin
Copy link
Copy Markdown
Collaborator

@woksin woksin commented May 4, 2026

Added

  • Running cratis with no arguments now shows the active context name and server URL, so it is always clear where the CLI is pointed.
  • Connection error messages now include the active context name, server URL, and the exact commands to update the connection (cratis context set-value server / cratis context create).
  • cratis llm-context --schema outputs the JSON Schema for the llm-context format — useful for tooling that validates or generates against the descriptor shape.

Changed

  • First run automatically creates a default context pointing at chronicle://localhost:35000/?disableTls=true — no manual cratis context create step required.
  • The event store prompt now also fires when the stored event store no longer exists on the server (e.g. it was deleted), re-prompting the user and saving the new selection before the command runs.
  • cratis llm-context now outputs a proper nested hierarchy: chronicle sub-groups (observers, jobs, events, etc.) appear as subGroups instead of being flattened alongside top-level commands.
  • cratis llm-context hoists -e -n to the chronicle group level — they appear once in inheritedOptions on the group rather than being repeated on every sub-group and command.
  • cratis llm-context now separates positional arguments (e.g. <OBSERVER_ID>) from named options (e.g. --type) in the command descriptor, making it unambiguous how each parameter is supplied.
  • All commands now carry AI-focused descriptions in cratis llm-context output, distinct from their --help text, with more context on when and how to use them.

Fixed

  • cratis llm-context no longer includes examples in the output.
  • Angle brackets in cratis llm-context JSON output are now emitted as literal </> instead of \u003C/\u003E.
  • PowerShell completion script now correctly quotes 'cratis' in Register-ArgumentCompleter -CommandName.

woksin added 3 commits May 4, 2026 14:41
…mand

Move the event store fetch-and-prompt logic out of EventStoreInterceptor
into a new shared EventStoreSelector helper. The selector now also validates
the stored event store against the server on every command — if the stored
name no longer exists (e.g. it was deleted), the user is re-prompted and the
new choice is saved immediately so the current command runs with it.

Returns an EventStoreSelectorResult enum instead of a bool, giving callers
precise outcome information (Unreachable, NoEventStores, AlreadyValid,
Selected, Declined).
Replace the bare connection string in connection failure output with a
structured hint that includes the active context name, the server URL, and
the exact commands to fix it (cratis context set-value server / cratis context create).
JSON/json-compact formats keep a minimal single-line hint.
…nvocation

First run now silently creates a default context pointing at
chronicle://localhost:35000/?disableTls=true and prints a one-line welcome
message directing the user to run any chronicle command — which will then
trigger the event store selection prompt automatically.

Running bare 'cratis' (no args) now prints the active context name and
server URL so users always know where the CLI is pointed.
@woksin woksin added the minor New features, non-breaking additions label May 4, 2026
woksin and others added 4 commits May 4, 2026 15:08
- Introduced PowerShellCompletionGenerator for generating PowerShell completion scripts.
- Updated PrintCompletionCommand to support PowerShell as a completion option.
- Enhanced dynamic option completion for various commands by adding DynamicOptionCompletionAttribute.
- Improved shell completion installers to include PowerShell support.
- Refactored completion generators for Bash, Zsh, and Fish to utilize dynamic completions.
- Added LlmDescription attributes to various commands to provide AI-focused descriptions, enhancing the context for automated suggestions and usage scenarios.
- Updated command descriptions in the Chronicle branch to clarify functionalities and improve user understanding.
- Introduced a new LlmDescriptionAttribute to facilitate richer command descriptions for AI agents.
- Improved output guidance for commands related to recommendations, users, contexts, and completions.
- Enhanced the CLI command tree to support dynamic option completions for output formats.
- Refined the structure of command descriptors to include inherited options and positional arguments for better clarity.

Co-authored-by: Copilot <copilot@github.com>
@woksin woksin merged commit c2adaea into main May 4, 2026
1 check passed
@woksin woksin deleted the feat/plug-and-play-first-run branch May 4, 2026 21:05
@woksin woksin restored the feat/plug-and-play-first-run branch May 5, 2026 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

minor New features, non-breaking additions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant