Conversation
Allow mdt to read markdown content from stdin via pipes (e.g., `echo "# Hello" | mdt`, `cat README.md | mdt`, or `mdt -`). Stdin mode is read-only with the file tree, file finder, and editor disabled. The status bar shows `<stdin>` as the file path. Navigation, search, help, and link picker all work normally on piped content. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughAdds a piped-stdin read-only mode: main detects piped input, reads content, constructs the app via Changes
Sequence DiagramsequenceDiagram
participant User
participant Main as main()
participant Stdin
participant App
participant UI
User->>Main: invoke mdt with piped input
Main->>Stdin: detect piped stdin / read content (enforce max size)
Stdin-->>Main: content string
Main->>App: App::from_stdin(content, bg_color)
App->>App: render markdown, rebuild caches, set stdin_mode
Main->>UI: render read-only preview (no lockfile, no watcher)
UI-->>User: display document (editor/file-tree/file-finder disabled)
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment Tip CodeRabbit can use OpenGrep to find security vulnerabilities and bugs across 17+ programming languages.OpenGrep is compatible with Semgrep configurations. Add an |
Deploying mdtui with
|
| Latest commit: |
8128b2a
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://3a9d63ef.mdtui.pages.dev |
| Branch Preview URL: | https://feat-stdin-pipe-support.mdtui.pages.dev |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
echo "# Hello" | mdt,cat README.md | mdt,mdt -)Changes
src/app/mod.rsstdin_modefield,App::from_stdin()constructor,display_file_path()returns<stdin>src/main.rsrun_looptakesOption<&Receiver>src/input/editor.rsenter_editor()— "Read-only (stdin)"src/input/normal.rstoggle_file_tree()— no-op in stdin modesrc/app/file_finder.rsopen_file_finder()— "Not available (stdin)"src/ui/status_bar.rssrc/app/tests.rswebsite/Test plan
cargo test— 300 tests pass (8 new stdin tests, 0 regressions)cargo clippy -- -D warnings— cleancargo fmt --check— cleanecho "# Hello World" | cargo run— renders headingecho "# Hello\n\n- item 1\n- item 2" | cargo run— renders listcargo run -- -with typed input then Ctrl+D — renders stdincargo run(no pipe) — existing behavior unchangedi/ein stdin mode — shows "Read-only (stdin)"Space+ein stdin mode — does nothingffin stdin mode — shows "Not available (stdin)"/search, heading jump,?help,qquit — all work🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
cat file.md | mdtormdt -). Editor, file finder, and file-tree toggling are disabled; a stdin pseudo-path is shown.Documentation
Tests
Chores