A new command-line tool called Shef has sparked debate among developers about the merits of YAML-based approaches to shell scripting. The tool, which describes itself as a powerful CLI tool for cooking up shell recipes, combines elements of Make, GitHub Actions, and CyberChef to create a YAML-driven interface for shell commands.
YAML Fatigue Among Developers
The community's response to Shef has highlighted a growing sentiment of YAML DSL fatigue among experienced developers. Many commenters expressed skepticism about the value of wrapping shell commands in yet another YAML-based domain-specific language. The comparison to previous attempts at similar approaches was immediate, with one developer drawing parallels to Maven 1 and Apache Jelly, describing how such XML-based scripting was eventually abandoned.
I don't see the use case for writing the recipes in YAML instead of using a shell function (or Python, which is multiplatform)... it will quickly end up being a pseudo-programming language without the benefits of a better composition syntax.
This sentiment was echoed across multiple comments, with developers who work regularly with Kubernetes and other YAML-heavy tools expressing particular resistance to adding another layer of YAML to their workflows.
Raw Shell Scripts vs. Structured Approaches
A central theme in the discussion was whether Shef provides enough advantages over traditional shell scripting to justify its existence. While the tool's creator defended its interactive user prompts and additional features as benefits beyond basic bash scripting, many developers maintained that with just a little bit of effort, shell scripting really isn't that arcane.
Several commenters suggested that when shell scripts grow too complex, the better approach is to switch to a full programming language like Python rather than introducing a new abstraction layer. Others pointed to existing tools like Taskfile that offer similar functionality but where developers often end up reverting to raw shell commands anyway.
Key Features of Shef
- Interactive user prompts
- Piping commands together
- Complex control structures and loops
- Reusable workflows with conditional logic
- YAML-based recipe format
Community Concerns
- YAML as a pseudo-programming language
- Complexity compared to raw shell scripts
- Installation requirements (initially required Go tools)
- Similar patterns to previously abandoned approaches (e.g., Apache Jelly)
Installation Barriers and Practical Considerations
The initial release of Shef faced criticism for its installation process, which required users to install Go tools to try the software. The developer acknowledged this limitation and quickly updated the project to include binary assets in releases, demonstrating responsiveness to community feedback.
Some users appreciated certain aspects of the tool, such as its clever name (a play on chef and shell) and the potential for reusing recipes within other recipes. One commenter suggested adding asciinema recordings to the README to better demonstrate the tool's functionality, a suggestion the developer promptly implemented.
Alternative Approaches
The discussion around Shef prompted several developers to share their own alternative approaches to similar problems. Some described Python-based tools inspired by Ansible but designed for smaller-scale operations. Others mentioned the benefits of CDK-like strongly-typed approaches over Go and YAML combinations.
These alternatives highlight the diversity of opinions on how to best handle complex shell operations, with many developers preferring to leverage existing programming languages rather than creating new domain-specific languages.
While Shef represents an interesting approach to making shell scripts more accessible and interactive, the developer community's response suggests that the appetite for YAML-based scripting solutions may be waning in favor of more traditional programming approaches. Nevertheless, the tool's creator remains enthusiastic about the project and responsive to feedback, suggesting that Shef may continue to evolve based on community input.
Reference: Shef: A Powerful CLI Tool for Cooking Up Shell Recipes