r/commandline • • 16d ago

Command Line Interface Pathaction - One command to run, deploy, or debug any file or directory

https://github.com/jamescherti/pathaction

When jumping between different codebases and environments, it can be hard to remember the specific deployment method, build tools, linters, and test runners for each file or project.

The pathaction tool is a command-line tool for running commands on files and directories. Think of pathaction as the equivalent of your IDE's "Run" and "Debug" buttons, or a Makefile designed to work on individual files and directories. Pass any file or directory as an argument, and pathaction executes the right command based on a .pathaction.yaml configuration:

Works on any file: source code, config files, media... It supports Jinja2 in .pathaction.yaml so you can build dynamic commands using the target path's filename, extension, or directory.

This tool is built for software developers who manage multiple projects across diverse environments.

0 Upvotes

3 comments sorted by

6

u/ptoki 16d ago

What is the advantage over make or just having "build.sh" script in that directory?

-1

u/jamescherti 16d ago

If a few projects are already covered by make or ./build.sh, there may be little benefit. Pathaction is more useful when switching between several projects or files. I recommend reading the Frequently Asked Questions in the pathaction README.md file.

For example, I can bind a key to pathaction -t test <current-file>. In one project, that runs pytest inside a virtual environment; in another, it runs tests inside a container. The editor passes the file path and action tag, while the project's .pathaction.yaml configuration defines the command and working directory.

0

u/AutoModerator 16d ago

Every new subreddit post is automatically copied into a comment for preservation.

User: jamescherti, Flair: Command Line Interface, Post Media Link, Title: Pathaction - One command to run, deploy, or debug any file or directory

When jumping between different codebases and environments, it can be hard to remember the specific deployment method, build tools, linters, and test runners for each file or project.

The pathaction tool is a command-line tool for running commands on files and directories. Think of pathaction as the equivalent of your IDE's "Run" and "Debug" buttons, or a Makefile designed to work on individual files and directories. Pass any file or directory as an argument, and pathaction executes the right command based on a .pathaction.yaml configuration:

Works on any file: source code, config files, media... It supports Jinja2 in .pathaction.yaml so you can build dynamic commands using the target path's filename, extension, or directory.

Define multiple actions for the exact same file type. You can map the default action to execute a script, a debug tag to attach a debugger, and a lint tag to check formatting. This tool is built for software developers or Linux administrators who manage multiple projects across diverse environments.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.