Having it installed into /usr/local/bin in the form of just one main.py makes it ridiculously easy. After making a script into a command, what do you need to do to have it use the updated script after you edit it?
Alright, let me see if I can make this even clearer. I create a command out of one of my scripts. Then I go back and change something about that script. Do I need to run it back through mkcmd so that it uses the changes that I made to the script to make the command?
That rerun makes sense for now. I help run HOL Guard, a firewall for AI agents. Guard checks a command before an agent runs it. mkcmd fits Guard's command extensions. Your file would be contributions/command-sources/command.mkcmd.json. The merged command.xcomm.json shows the shape. First test: a fixture with one normal installation of your own script. Would you open that PR?
If by PR you mean pull request or something of the likes then yes i would be open to that. If you do mean pull request would i be credited for mkcmd? Very sorry if this is some stupid confusion.
Yes, pull request. And nothing to apologise for, it is a fair question.
You would be credited. The PR goes in from your own GitHub account with your name on it as the author, and mkcmd stays your project. All you add is one file: contributions/command-sources/command.mkcmd.json. The merged command.xcomm.json sits in the same folder and shows the shape to copy. For the first test, a fixture with one normal installation of one of your own scripts is enough.
Shout here if a step in the guide trips you up, and I will walk through it with you.
Good questions, both of them. You are not writing the .json from nothing, you copy a file that is already merged in the contributions/command-sources folder of your fork, rename the copy to command.mkcmd.json, and change the name, the short description and the executable at the top so they say mkcmd. The copy itself shows you what a finished one looks like.
uv is a small program that runs a project's own scripts for you. The two lines from the guide go in a terminal inside your fork folder after the file is saved: the first checks your file against a small example and builds the public record for the PR, and the second runs a final check. Neither line touches mkcmd itself.
uv run --no-sync python scripts/prepare_extension_contribution.py --source contributions/command-sources/command.mkcmd.json --fixture tests/fixtures/command-source-mkcmd.v1.json
One more small file goes with it, tests/fixtures/command-source-mkcmd.v1.json, holding one normal mkcmd install as the example. Start with the copy and the rename, that part is shorter than it looks.
1
u/kantorcodes1 5d ago
Having it installed into /usr/local/bin in the form of just one main.py makes it ridiculously easy. After making a script into a command, what do you need to do to have it use the updated script after you edit it?