tool (sh to mjs translator) - Issue #1 #133
Open
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
Implements the
$fytool requested in issue #1 - a shell-to-mjs translator that converts bash/shell scripts into JavaScript modules using the command-stream library syntax.Features
Single Command Conversion: Convert shell commands from stdin
Full Script Conversion: Convert complete shell scripts
Shell Operator Support: Handles &&, ||, ; with proper JavaScript equivalents
cmd1 && cmd2→ Sequential execution with error handlingcmd1 || cmd2→ Try/catch error recoverycmd1 ; cmd2→ Sequential executionAdvanced Features:
ls | grep test→await $\ls | grep test``export VAR=value→process.env.VAR=valueImplementation
$fyregistered as built-in commandshell-parser.mjsfor command parsingExamples
Simple Command Translation
Full Script Translation
Input
deploy.sh:Output:
Test Coverage
Usage
This implementation provides a powerful bridge between shell scripts and modern JavaScript development using the command-stream library, enabling easy migration of bash automation to JavaScript.
🤖 Generated with Claude Code
Resolves #1