Repository navigation
refactor: simplify API and add plumbing commands - #99
Merged
Merged
Conversation
Analyzed proposed flag removals and added findings: - Validated logic for --save-ansi, --no-backup, --result-md-path removal - Noted --no-save removal requires --echo behavioral change - Identified additional candidates: --no-stats, --print-block-results - Added summary table of 7 flags that can be removed/consolidated 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove flags in favor of Unix-style piping: - --save-ansi: use `--echo | save file.ans` - --no-save: --echo now implies no save - --no-backup: replaced with git safety check - --result-md-path: use `--echo | save target.md` Add check-git-clean function that warns if file has uncommitted changes or is not tracked by git. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update examples to use --echo instead of --no-save. Help output auto-regenerated to reflect removed flags. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update preview mode example to use --echo instead of --no-save --echo. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove --no-backup flags (no longer needed) - Use --echo --no-stats for saving to different paths - Import compute-change-stats for manual stats calculation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Change stats example to use non-echo mode which returns the stats record directly instead of full markdown output. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The pipeline input was lost when check-git-clean was called. Fixed by capturing $in before the git check. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This makes piping work correctly: numd run test.md --echo | save test1.md Previously --echo would append stats table to output, corrupting the saved file. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Clarify --print-block-results and --no-fail-on-error descriptions. Fix list syntax in extract-fence-options example. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Config files are now native Nushell scripts that get prepended to the intermediate script - Table width is evaluated at runtime via $env.numd.table-width instead of being baked in at generation time - Flags (--prepend-code, --table-width) override config file settings - Converted numd_config_example1.yaml and numd_config_example2.yaml to .nu format 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Extract `capture start` and `capture stop` commands from commands.nu to dedicated capture.nu file for better code organization. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Extract `parse-help` command from commands.nu to dedicated parse-help.nu file. Exported as main for cleaner `numd parse-help` usage. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Extract fence options data to const for reuse - Remove --list flag, always return user-friendly table - convert-short-options builds its dict from the const - Fix deprecated get -i to get -o 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add composable pipeline commands following Unix philosophy: - `parse-file` - parse markdown file into blocks table - `strip-outputs` - remove # => output lines from blocks - `execute-blocks` - execute code blocks and update table - `to-markdown` - render blocks table back to markdown - `to-numd-script` - extract pure Nushell script from blocks Refactor `run` and `clear-outputs` to use these pipeline commands. Usage examples: numd parse-file file.md | numd strip-outputs | numd to-markdown numd parse-file file.md | numd execute-blocks | numd to-markdown 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Update module structure to reflect new file organization - Add Pipeline Commands section with usage examples - Document how run and clear-outputs use pipeline internally 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Separate user-friendly (porcelain) and low-level (plumbing) commands: - mod.nu exports only high-level commands: run, clear-outputs, etc. - plumbing.nu exports low-level pipeline commands for scripting Usage: use numd # high-level commands only use numd/plumbing.nu # low-level: parse-file, strip-outputs, etc. Also fix temp script path handling - keep logic in run command where it has access to the file path. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add 13 new tests for the new public plumbing APIs: - strip-outputs (4 tests): output line removal, comment preservation - to-markdown (4 tests): rendering blocks back to markdown - to-numd-script (5 tests): extracting pure Nushell scripts Total tests: 46 → 59 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
maxim-uvarov
added a commit
that referenced
this pull request
Dec 17, 2025
This reverts commit a6428cd.
maxim-uvarov
added a commit
that referenced
this pull request
Dec 17, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
runcommand: Removed rarely-used flags (--result-md-path,--save-ansi,--no-backup,--no-save).--echonow outputs only markdown (stats disabled by default)clear-outputscommand: Removed--result-md-pathflag, fixed bug where it created empty files without--echonumd/plumbing.nu): Low-level pipeline commands for advanced scripting:parse-file→strip-outputs→execute-blocks→to-markdown/to-numd-script.nufiles: Config files are now sourceable Nushell scripts prepended to intermediate scriptcapture start/stoptocapture.nu,parse-helptoparse-help.nuTest plan
numd runworks with--echo,--config-path,--table-widthnumd clear-outputsworks with--echo,--strip-markdown🤖 Generated with Claude Code