> For the complete documentation index, see [llms.txt](https://ai-os-and-trend-finder.gitbook.io/ai-os-and-trend-finder-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ai-os-and-trend-finder.gitbook.io/ai-os-and-trend-finder-docs/.spec_system/archive/phases/phase_40/session_13_command_ux_and_slash_actions.md).

# Session 13: Command UX And Slash Actions

**Session ID**: `phase40-session13-command-ux-and-slash-actions` **Status**: Complete **Estimated Tasks**: \~12-25 **Estimated Duration**: 2-4 hours

***

## Objective

Add the interactive command menu and slash actions on top of the admin command endpoint and compact flow.

***

## Scope

### In Scope (MVP)

* Add a split command menu component and wire `runHermesCommand` through `useHermesAdmin`.
* Show command output as a redacted Hermes message with stable pre/monospace formatting and controlled error states.
* Add slash actions for compact, insights, status, doctor, version, update, and new chat.
* Confirm before running `update` and handle command timeout failures clearly.
* Show sanitized chat `info` SSE events as diagnostics or map them to Intelligence activity rather than normal assistant reply text.
* Keep slash behavior discoverable without adding tutorial prose.

### Out of Scope

* Adding new command endpoint capabilities beyond the allowlist.
* Shell-like freeform command execution.
* Ministry UI.

***

## Prerequisites

* [x] Session 05 command endpoint and hook method are available.
* [x] Session 12 compact flow is available.
* [x] Session 11 toolbar placement is available or coordinated.

***

## Deliverables

1. Command menu and slash action UI.
2. Command output rendering with redacted success and failure states.
3. Tests for command calls, update cancel/accept, command errors, slash filtering, and `/compact` routing.

***

## Success Criteria

* [x] Commands run allowlisted Hermes subcommands, not prompt text.
* [x] Command output remains useful after redaction and exposes no private state.
* [x] `update` requires confirmation and reports timeout as failure.

***

## Folded Source Session Split

The section below preserves the original Phase 40 session split detail for this session, including dependencies, decisions, outputs, and acceptance checks.

### Session 13: Command UX And Slash Actions

**Objective**: Add the interactive command menu and slash actions on top of the admin command endpoint and compact flow.

**Scope**:

* Add a split command menu component and wire `runHermesCommand` through `useHermesAdmin`.
* Show command output as a redacted Hermes message with stable pre/monospace formatting and controlled error states.
* Add slash actions for compact, insights, status, doctor, version, update, and new chat.
* Confirm before running `update` and handle command timeout failures clearly.
* Show sanitized chat `info` SSE events as diagnostics or map them to Intelligence activity rather than normal assistant reply text.
* Keep slash behavior discoverable without adding tutorial prose.

**Outputs**:

* Command menu and slash action UI.
* Command output rendering with redacted success and failure states.
* Tests for command calls, update cancel/accept, command errors, slash filtering, and `/compact` routing.

**Dependencies / Notes**:

* Depends on Sessions 05 and 12.
* Benefits from Session 11 for toolbar placement.

**Acceptance Checks**:

* Commands run allowlisted Hermes subcommands, not prompt text.
* Command output remains useful after redaction and exposes no private state.
* `update` requires confirmation and reports timeout as failure.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://ai-os-and-trend-finder.gitbook.io/ai-os-and-trend-finder-docs/.spec_system/archive/phases/phase_40/session_13_command_ux_and_slash_actions.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
