Skip to content

Add the UniGetUI terminal UI (TUI) - #5447

Merged
Marc-André Moreau (mamoreau-devolutions) merged 7 commits into
mainfrom
tui-terminal-ui-spike
Oct 6, 2026
Merged

Marc-André Moreau (mamoreau-devolutions) merged 7 commits into
mainfrom
tui-terminal-ui-spike

Conversation

@forestmaxime

Copy link
Copy Markdown
Contributor
  • I have read the contributing guidelines, and I agree with the Code of Conduct.
  • Have you checked that there aren't other open pull requests for the same changes?
  • Have you tested that the committed code can be executed without errors?
  • Have you confirmed that this issue is caused by UniGetUI itself, and not by the package manager or the package involved?
    If the same issue can be reproduced outside UniGetUI with the relevant package manager or with the package itself, please report it there first. UniGetUI should only be used to track issues that are specific to UniGetUI's behavior or integration.

Summary

This PR adds UniGetUI.Tui, a terminal front end for the UniGetUI package engine. It is built with Consolonia, which renders Avalonia 12 in a console. It uses the same engine as the desktop app and shares its settings, secure settings, install options, ignored updates, bundles and operation history, so a change made in one app shows up in the other. docs/TUI.md documents it.

Pages. The TUI has the same pages as the desktop app, reached from a tab strip:

  • Discover, Updates, Installed and Bundles
  • Operations (live output, cancel, retry)
  • Managers (sources, default install options, Scoop maintenance, WinGet repair)
  • Settings, Logs and History
  • About and Help, shown as dialogs

Keyboard and themes.

  • Keyboard first: Alt access keys on the menu bar, a function-key bar, and F3 for search mode.
  • The Mode, Sources and Sort chips can also be clicked.
  • 16 colour themes: Devolutions Graphite (the default), Black, Light, Dark Blue and others, plus popular themes such as Dracula and Monokai. --theme <id> uses a theme for one session without saving it. A test checks WCAG contrast for every theme.

Fake data mode. --fake-data replaces every package manager with a fake one and redirects all state into a sandbox. Operations run a fake package-manager process, so the full flows can be exercised (install, update, cancel, retry, add and remove sources, Scoop maintenance) without installing anything.

Publishing. Release publishes are NativeAOT and trimmed:

  • The output is UniGetUI.Tui.exe, e_sqlite3.dll, Microsoft.Management.Deployment.winmd (needed for WinGet COM activation) and Assets\Utilities\unigetui_ps_operation.ps1.
  • Skia is not used, and the translations, data files and contributors list are embedded through the new BundledAssets in UniGetUI.Core.Data. It reads from disk first, so the desktop app behaves as before.
Metric (fake data, median of warm runs) ReadyToRun (JIT) NativeAOT
Launch to first screen 725 ms 252 ms
--help (start to exit) 105 ms 46 ms
Working set once loaded 91 MB 67 MB

Changes outside the TUI.

  • BundledAssets (new) is now used by LanguageEngine, LanguageData and Contributors.
  • Two new settings names in SettingsEngine_Names.cs.
  • SQLitePCLRaw.bundle_e_sqlite3 is bumped to 2.1.13 in the WinGet manager (GHSA-2m69-gcr7-jv3q).
  • The TUI projects are added to both solutions, and AGENTS.md gets a TUI section.

Follow-ups from recent main commits.

  • The Add source dialog accepts a local folder or network share for Chocolatey, PowerShell, PowerShell7 and .NET Tool (Serve NuGet sources that are local folders or network shares #5435).
  • A canceled operation now shows exactly one "Operation canceled" notification per run. Before, Cancel() and the end of the run each reported it once.

Testing

  • UniGetUI.Tui.Tests: 93 tests pass. They are NUnit tests, including end-to-end tests that drive the real UI in fake data mode.
  • dotnet format whitespace and dotnet format style --verify-no-changes are clean.
  • The NativeAOT publish was checked by hand in Windows Terminal with fake data.

Known limitations

  • Building in parallel can hit a file lock on the WinGet project, which is referenced two different ways. -m:1 avoids it.
  • A NativeAOT publish needs the MSVC build tools, which provide the native linker.

🤖 Generated with Claude Code

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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.

Comment thread src/UniGetUI.Tui/UniGetUI.Tui.csproj Resolved
A Consolonia (Avalonia 12 in the console) front-end for the UniGetUI engine,
in src/UniGetUI.Tui, with feature parity with the desktop app and end-to-end
tests on fake data. See docs/TUI.md.

- Pages: Discover, Updates, Installed, Bundles, Operations, Managers,
  Settings (with search), Logs and History as numbered tabs; Help (F1) and
  About as dialogs. Code-only UI, dialogs as in-window overlays.
- Layout: framed page header with Mode / Sources / Sort chips (clickable; F3
  for the search mode), split details / actions panel, function-key bar.
- Keyboard: Alt+letter menu bar, Alt+1-9 / Ctrl+Tab pages, focus always in
  the page; AltGr text and ConPTY clipboard fixes.
- Themes: 16 colour themes switchable live and saved (TuiTheme setting,
  --theme); Devolutions Graphite (default), Black, Light, Dark Blue, Blue, Gray
  and High contrast follow the RDM colour tokens; WCAG contrast is tested.
- Fake data mode (--fake-data): sandboxed data, fake package managers backed
  by a JSON state file, fake elevator, downloads and cloud backup; nothing real
  is installed. Consolonia.NUnit E2E tests drive the real UI with it.
- Release publishes are NativeAOT (about 3x faster startup than ReadyToRun):
  compiled grid bindings, Consolonia kept untrimmed, no Skia, translations and
  data embedded (new BundledAssets helper in UniGetUI.Core.Data, disk first).
  The publish is UniGetUI.Tui.exe, e_sqlite3.dll, the WinGet .winmd and the
  PowerShell operation launcher.
- Scoop install / uninstall / cleanup run as TUI operations instead of the
  desktop app's .cmd scripts.
- Pin SQLitePCLRaw.bundle_e_sqlite3 2.1.13 in the WinGet manager to fix
  GHSA-2m69-gcr7-jv3q (CVE-2025-6965); remove once Pinget.Core moves up.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…notification per run

The Add source prompt for Chocolatey, PowerShell, PowerShell7 and .NET Tool now
asks for a URL or a folder (local path or network share), matching #5435.

A running operation reports Canceled twice (Cancel() and again when the run
winds down), so the registry now shows "Operation canceled" once per run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MetaTests.TestJsonSerializationOptions counts trim-safe metadata per line, and
the calls using FakeStateJsonContext.Default.FakeState directly didn't match.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Use Consolonia's NativeAOT fixes without whole-assembly roots, adapt its per-test NUnit lifecycle, and require review before importing high-risk bundles after the mainline security-report changes.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Host the TUI as a main-executable command, preserve fake-data subprocesses and installer guards, harden CLI parsing and secure settings, and document blocking PowerShell launch. Add main-host regressions and remove build numbers from TUI version displays.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Correct proxy handling, OAuth polling, selected paste, operation history and batch summaries, pending-operation roles, repair failures, and localized help. Add deterministic regression coverage and a user-oriented terminal guide.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@mamoreau-devolutions
Marc-André Moreau (mamoreau-devolutions) merged commit 925be42 into main Oct 6, 2026
6 checks passed
@mamoreau-devolutions
Marc-André Moreau (mamoreau-devolutions) deleted the tui-terminal-ui-spike branch October 6, 2026 12:06
Gabriel Dufresne (GabrielDuf) added a commit that referenced this pull request Oct 6, 2026
Resolves the overlap with #5447's SQLitePCLRaw pin. Pinget.Core 0.13.0
still depends on Microsoft.Data.Sqlite 10.0.7, which still brings
SQLitePCLRaw.bundle_e_sqlite3 2.1.11, so the pin to the patched 2.1.13
stays; only the version named in its comment moves to 0.13.0. Restore
resolves Devolutions.Pinget.Core/0.13.0 alongside
SQLitePCLRaw.bundle_e_sqlite3/2.1.13 with no NU1903.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants