67cca9854f22afaa20c0bf9ebb1367f2288f7494
Bash Argument Parser Generator
A self-contained web application for interactively building bash argument parsing code. Zero external dependencies - single binary deployment.
Features
- Zero Dependencies: Single Go binary with embedded assets
- Real-time Help Preview: See generated help output as you type
- Clean Separation: Frontend assets organized in separate directories
- Auto-expanding Rows: New input rows appear automatically
- Dark Terminal Theme: Professional terminal-style interface
- Copy to Clipboard: One-click script copying
Architecture
argparse-builder/
├── main.go # Go server with embedded FS
├── static/
│ ├── css/
│ │ └── style.css # Styling
│ └── js/
│ └── app.js # Frontend logic
└── templates/
└── index.html # HTML template
All files are embedded using //go:embed
directive, resulting in a single binary.
Build
go build -o argparse-builder
Run
./argparse-builder
Server starts on port 8080. Open http://localhost:8080 in your browser. Demo available at: https://pages.git.pynezz.dev/argparse-builder
Usage
- Add Custom Header (optional): Set a greeting or description
- Define Arguments:
- Parameters:
-v --verbose
(flag syntax) - Variable Name:
verbose
(internal variable) - Help Text: Description shown in help output
- Parameters:
- Real-time Preview: Help output updates as you type
- Generate: Click "Generate BASH" to create the script
- Copy: Use the copy button to get the generated code
Example Output
For inputs:
- Header: "My Script v1.0"
- Arguments:
-v --verbose
,verbose
, "Enable verbose output"
Generates a complete bash script with:
- Usage function with formatted help
- Argument parsing with case statements
- Variable initialization
- Unknown option handling
-h/--help
support
Technical Details
- Language: Go 1.21+
- Embedding:
embed.FS
for asset bundling - Binary Size: ~9MB (includes runtime and all assets)
- HTTP Server: Standard library net/http
- Frontend: Vanilla JavaScript (no frameworks)
Performance
- Instant startup (no compilation)
- Low memory footprint
- Efficient static file serving from memory
- No external network calls
Security Considerations
- Input sanitization on server side
- No shell execution
- Template-based HTML generation
- CORS headers not set (localhost only by default)
Description
Languages
JavaScript
28%
Go
25.9%
CSS
17.9%
HTML
17.7%
Dockerfile
4.5%
Other
6%