Run and manage per-project shell commands with project.el
- upstream on sourcehut: https://git.sr.ht/~alex-iam/epx
- mirror on github: https://github.com/alex-iam/epx
epx.el helps you define, manage, and run shell commands specific to
your Emacs projects (those recognized by project.el).
It stores named commands, along with optional environment variables and
a flag to use compilation-mode, directly in each project's
root: in .dir-locals.el or .epx.eld file. You get interactive commands to
easily add, remove, and run these project tasks.
- Completion prompt for commands defined in the current project.
- Re-uses an existing shell window or opens one with
project-shell. - Can run the command in
compilation-modeinstead of a shell. - Can use either
.dir-locals.elor a dedicated.epx.eldto store commands. - Command storage can be customized by
epx-commands-file-typevariable (globally). - Pure Elisp, only depends on built-in
project.
epx can be installed from MELPA. A common way to setup the package using use-package is:
(use-package epx
:after project
:bind
("C-c p r" . #'epx-run-command-in-shell)
("C-c p c" . #'epx-add-command)
("C-c p d" . #'epx-remove-command))
You can also always install the package using M-x package-install instead.
-
You can use variable
epx-commands-file-typeto control where your commands are stored. It accepts the following values: ’locals and ’eld. -
epx-add-command: Prompt for a command, name, env vars, and whether to use a compilation buffer; writes it to commands file. -
epx-run-command-in-shell: Pick a saved command and execute it in a shell (or compilation) buffer scoped to the project. -
epx-remove-command: Remove a saved command from commands file.
- NOTE: ‘local-project-cmds’ was renamed to ‘epx-commands’ in 0.3.1. Deprecation mechanism is provided.
((nil . ((local-project-cmds ;; This is the variable epx looks for
. ((:name "lint"
:command "ruff check ."
:compile t)))))
You'll have to set epx-commands-file-type to 'eld.
((:name "lint"
:command "ruff check ."
:compile t))
With this entry present in your project root's commands file, running
M-x epx-run-command-in-shell RET lint RET will execute ruff check .
in a compilation-mode buffer, using your project's root as the
working directory.
Patches, bug reports, and suggestions are welcome! Please use the SourceHut mailing list or issue tracker. Or create an issue on GitHub
For a list of contributors, look at CONTRIBUTORS file.
GPL v3 or later. See the LICENSE file for details.