scriptura: a cozy corner for your scripts
Alan Pearce has created scriptura, a small tool for running and managing scripts stored in a folder tree. It is made for fish[1] users and is based on the idea behind sd, which Pearce did not use directly because its name was already taken on his system and it had no fish completions. Given a SCRIPTURA_ROOT folder, running "scriptura run os update linde" executes the script at the matching path, with tab completion for each element of the path.
Pressing tab after a script is resolved adds "--" to mark the end of the script part of the command line, then uses the normal shell filename completion. Documentation can come from an adjacent .help file, from comments inside the script, or from a help file in a folder. Scripts do not have to be written in fish: scriptura new creates a fish script with a shebang[2], and Pearce plans to add an option to set a different interpreter.
Compared with sd, scriptura uses subcommands instead of flags, adds tab completion after the new subcommand, and includes a cmd subcommand that runs commands in the script root. Scripts placed in a special scriptura subdirectory become custom subcommands, such as a tree command. Pearce says building the tool took more than one sitting, and the repository has installation instructions, including a home-manager module.
Read the original alanpearce.euDiscussion
Sources
-
alanpearce.eu
scriptura: a cozy corner for your scripts


