You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: codex-rs/tui/docs.md
+30-3Lines changed: 30 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,9 +14,9 @@ TUI is one of the primary entry points, invoked when running `codex` without a s
14
14
-**Depends on**`codex-acp` for ACP agent backend (alternative to HTTP-based LLM providers)
15
15
-**Depends on**`codex-common` for CLI argument parsing and shared utilities
16
16
-**Uses**`codex-protocol` types for events and messages
17
-
-**Integrates**`codex-feedback` for tracing/feedback collection
17
+
-**Optionally integrates**`codex-feedback`, `codex-login`, `codex-backend-client` via feature flags
18
18
19
-
The `cli/` crate's `main.rs` dispatches to `codex_tui::run_main()` for interactive mode.
19
+
The `cli/` crate's `main.rs` dispatches to `codex_tui::run_main()` for interactive mode. Feature flags propagate from CLI to TUI for coordinated modular builds.
20
20
21
21
### Core Implementation
22
22
@@ -84,7 +84,7 @@ In `spawn_acp_agent()`, the main task must drop its `Arc<AcpBackend>` reference
84
84
**Onboarding:**
85
85
86
86
The `onboarding/` module handles first-run experience:
87
-
- Login screen (ChatGPT OAuth or API key)
87
+
- Login screen (ChatGPT OAuth or API key) - requires `login` feature
88
88
- Trust screen (directory permission settings)
89
89
- Windows WSL setup instructions
90
90
@@ -95,6 +95,33 @@ The `onboarding/` module handles first-run experience:
95
95
96
96
### Things to Know
97
97
98
+
**Feature Flags Architecture:**
99
+
100
+
The TUI crate uses Cargo feature flags to enable modular builds with two primary modes:
101
+
102
+
| Feature | Optional Dep | Description |
103
+
|---------|-------------|-------------|
104
+
|`full`| - | Meta-feature enabling all optional features |
Copy file name to clipboardExpand all lines: codex-rs/tui/src/nori/docs.md
+43-1Lines changed: 43 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,14 +4,16 @@ Path: @/codex-rs/tui/src/nori
4
4
5
5
### Overview
6
6
7
-
The `nori` module contains Nori-specific TUI customizations that replace or extend the default Codex UI behavior. Currently, the primary component is a branded session header that displays at the start of each TUI session.
7
+
The `nori` module contains Nori-specific TUI customizations that replace or extend the default Codex UI behavior. It provides branded session headers, agent picking, feedback redirection, and a Nori-specific update checking mechanism that queries GitHub releases instead of OpenAI's update system.
8
8
9
9
### How it fits into the larger codebase
10
10
11
11
-**Called by**`history_cell.rs` via `new_session_info()` which delegates to `new_nori_session_info()`
12
12
-**Replaces** the original `SessionHeaderHistoryCell` (preserved as dead code for potential future feature flag selection)
13
13
-**Uses**`HistoryCell` trait from `@/codex-rs/tui/src/history_cell.rs` for consistent rendering
14
14
-**Reads**`~/.nori-config.json` for Nori profile information
15
+
-**Conditionally compiled** based on feature flags - modules like `feedback.rs`, `updates.rs` are only included when their corresponding upstream features are disabled
16
+
-**Re-exported** by `@/codex-rs/tui/src/lib.rs` to provide unified access to update types regardless of which update system is active
15
17
16
18
### Core Implementation
17
19
@@ -54,6 +56,33 @@ The banner uses green+bold for alphabetic characters and dark gray for structura
54
56
-`acp_model_picker_params()` renders the `/model` fallback page that disables selection when ACP mode is active and points the user back to `/agent`.
55
57
-`PendingAgentSelection` holds the selected model/display name pair so the App and `ChatWidget` can store it until the next prompt triggers `AppEvent::SubmitWithAgentSwitch`, at which point the conversation is rebuilt with the new model and the picker view is dismissed.
56
58
59
+
**Feedback Redirect (`feedback.rs`):**
60
+
61
+
Compiled only when `feedback` feature is disabled (`#[cfg(not(feature = "feedback"))]`). Redirects `/feedback` command to GitHub Discussions instead of OpenAI's feedback system:
62
+
-`NORI_FEEDBACK_URL`: Points to `https://github.com/tilework-tech/nori-cli/discussions`
63
+
-`feedback_message()`: Returns user-facing message with the discussions URL
64
+
65
+
**Update System (`update_action.rs`, `updates.rs`, `update_prompt.rs`):**
66
+
67
+
Compiled only when `upstream-updates` feature is disabled. Provides Nori-specific update checking:
68
+
69
+
`update_action.rs`:
70
+
-`UpdateAction` enum with `NpmGlobalLatest` and `Manual` variants
71
+
-`command_args()` returns the shell command to execute the update
72
+
-`get_update_action()` (release builds only) checks `NORI_MANAGED_BY_NPM` env var to determine update method
73
+
74
+
`updates.rs` (release builds only):
75
+
- Queries `https://api.github.com/repos/tilework-tech/nori-cli/releases/latest` for version info
76
+
- Caches version data in `~/.codex/nori-version.json` with 20-hour refresh interval
77
+
-`get_upgrade_version()`: Background-refreshes cache and returns newer version if available
78
+
-`get_upgrade_version_for_popup()`: Returns version only if not previously dismissed
79
+
-`dismiss_version()`: Persists user's dismissal to avoid repeated prompts
80
+
- Tag format: expects `nori-v<semver>` (e.g., `nori-v1.2.3`)
81
+
82
+
`update_prompt.rs` (release builds only):
83
+
-`run_update_prompt_if_needed()`: Displays update prompt UI when new version available
84
+
- Returns `UpdatePromptOutcome::Continue` or `UpdatePromptOutcome::RunUpdate(action)`
85
+
57
86
### Things to Know
58
87
59
88
**Profile Display:**
@@ -70,4 +99,17 @@ The original Codex session header (`SessionHeaderHistoryCell`) is preserved with
70
99
71
100
The session header uses a max inner width of 60 characters. Directory paths are center-truncated when they exceed available space (e.g., `~/a/b/…/y/z`).
72
101
102
+
**Conditional Compilation:**
103
+
104
+
Module availability in `mod.rs` follows this pattern:
105
+
106
+
```
107
+
session_header.rs, agent_picker.rs -> Always included
The `lib.rs` re-export logic ensures `UpdateAction` type is always available via `codex_tui::update_action::UpdateAction` regardless of which update system is compiled.
0 commit comments