Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
### Added
- `omnishell tui`: a full-screen terminal UI to browse modules (description,
homepage, package status, platforms, shells) with a `/` filter. Space enables
or disables the selected module in `config.toml`, like `enable` / `disable`
(run `apply` afterwards), and modules that cannot run on this host are
dimmed with the reason shown. It needs an interactive terminal. It brings the
first runtime dependencies, Bubble Tea and Lip Gloss, so the binary grows by
about 1.5 MiB.
or disables the selected module in `config.toml`, like `enable` / `disable`.
`a` previews the plan; confirming it closes the UI and runs `omnishell apply`,
which still asks before it changes anything. Modules that cannot run on this
host are dimmed with the reason shown. It needs an interactive terminal. It
brings the first runtime dependencies, Bubble Tea and Lip Gloss, so the
binary grows by about 1.5 MiB.

### Fixed
- `list`, `diff` / `apply --dry-run` and `doctor` no longer print the package
Expand Down
29 changes: 18 additions & 11 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,17 +151,24 @@ files matters more than any single file:
11. **`internal/tui`** — the Bubble Tea v2 module browser behind
`omnishell tui` (`charm.land/bubbletea/v2`, `charm.land/lipgloss/v2`). It
imports neither `cli` nor `engine`: everything comes through its `Backend`
interface, which `internal/cli/tui.go` implements over `modedit`. The command
refuses a non-terminal and a missing or malformed config before the screen is
taken over. `Update` stays free of I/O: toggling returns a `tea.Cmd` that
writes through `modedit.Enable`/`Disable` and then re-reads only the module
statuses (`Backend.Statuses`; `Modules` probes the package manager and takes
seconds), one write at a time. The `tui` command builds its engine with
`io.Discard` writers, because the runner copies package-manager output to
them and the UI owns the terminal. Any
text that comes from a backend or a manifest (module fields, error messages)
must go through `sanitize` before it is drawn. Rendering tests compare `View().Content` (styling stripped) with
golden files in `internal/tui/testdata`; regenerate them with
interface, which `internal/cli/tui.go` implements over `modedit` and the
engine. The command refuses a non-terminal and a missing or malformed config
before the screen is taken over.
`Update` stays free of I/O: toggling returns a `tea.Cmd` that writes through
`modedit.Enable`/`Disable` and then re-reads only the module statuses
(`Backend.Statuses`; `Modules` probes the package manager and takes seconds),
one write at a time. The plan screen (`a`) asks `Backend.Plan`, which is
`Engine.Preview`: the plan text plus apply's own "nothing to do" rule, so the
screen never promises a change apply would not make. `y` only sets
`Result.ApplyRequested`; once the UI has closed, `internal/cli/tui.go` runs
the real apply command (`handOffToApply`), so its prompt, sudo and exit codes
stay the gate. The UI's own engine is built with `io.Discard` writers,
because the runner copies package-manager output to them and the UI owns the
terminal.
Any text that comes from a backend or a manifest (module fields, plan text,
error messages) must go through `sanitize` before it is drawn. Rendering
tests compare `View().Content` (styling stripped) with golden files in
`internal/tui/testdata`; regenerate them with
`go test ./internal/tui -run Golden -update` and review the diff by eye.

### Key invariants to preserve when touching engine/apply code
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ your system until you run `omnishell apply`.
|----------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `omnishell init` | Create the omnishell config and hook it into your shells. Idempotent. | — |
| `omnishell list` | List known modules and their status (enabled/disabled, packages, platforms, shells, source, description). | `--json` (emit a JSON array instead of the table; also includes each module's `homepage`) |
| `omnishell tui` | Browse and toggle modules in a full-screen terminal UI: a module list with description, homepage, package status, platforms and shells, a `/` filter, and Space to enable or disable the selected module (written to `config.toml` at once, like `enable` / `disable`; run `apply` afterwards). Modules that cannot run on this host are dimmed. Needs an interactive terminal (exit 2 otherwise). | — |
| `omnishell tui` | Browse and toggle modules in a full-screen terminal UI: a module list with description, homepage, package status, platforms and shells, a `/` filter, and Space to enable or disable the selected module (written to `config.toml` at once, like `enable` / `disable`). `a` previews the plan; confirming it closes the UI and runs `omnishell apply`, which still asks before it changes anything. Modules that cannot run on this host are dimmed. Needs an interactive terminal (exit 2 otherwise). | — |
| `omnishell enable <module>` | Enable a module in the config. Does not apply. | — |
| `omnishell disable <module>` | Disable a module in the config. Does not apply. | — |
| `omnishell set <module>.<key> <value>` | Set a module option in the config, validated against that module's option schema. | — |
Expand Down
Loading
Loading