Bash is powerful but painful. Rad gives you Python-like scripting with CLI superpowers built-in. Write maintainable scripts with declarative argument parsing, built-in JSON processing, HTTP requests, and intuitive user prompts. Transform how CLI tools are built with ease and efficiency.
Rad is an innovative scripting language designed to provide the power of Bash with the simplicity and readability of Python. It addresses the challenges associated with traditional Bash scripts by offering built-in support for argument parsing, JSON processing, and HTTP requests, simplifying the scripting process for developers.
pick() and input() allow for simple user input handling and interactive menus, enhancing user experience.Rad allows straightforward script writing that dramatically reduces the complexity typical of Bash. For instance, a script to fetch GitHub commits can be written as follows:
#!/usr/bin/env rad
args:
repo str # The repo to query. Format: user/project
limit int = 20 # Max commits to return
url = "https://api.github.com/repos/{repo}/commits?per_page={limit}"
Time = json[].commit.author.date
Author = json[].commit.author.name
SHA = json[].sha
rad url:
fields Time, Author, SHA
This Rad script fetches commit details without additional tools or complex commands, showcasing its efficiency and ease of use.
Rad stacks up against Bash and Python in several key areas:
| Feature | Bash | Python | Rad |
|---|---|---|---|
| Syntax familiarity | Archaic, hard to remember | Familiar | Familiar (Python-like) |
| Argument parsing | Verbose, manual | argparse or libraries | Built-in; declarative |
| Type checking | None | Manual or library | Built-in |
| --help generation | Manual | Dependencies handle it | Built-in; auto from comments |
| Validation/constraints | Manual | Manual or library schemas | Built-in (range, enum, etc) |
| JSON processing | Pipe to jq | JSON module + manual handling | Built-in path syntax |
| HTTP requests | curl + pipes | Import requests | Built-in; first-class support |
Rad is currently in early development, with core features functioning effectively. It is continuously improved based on community feedback. Those interested in refining their scripting experience with fewer dependencies and more intuitive syntax will find value in trying Rad.
For more information and a detailed "Getting Started" tutorial, please visit the official documentation.
No comments yet.
Sign in to be the first to comment.