I’ve been building a CLI tool using Swift Argument Parser, and I noticed something that might trip up folks who are new to Swift or SwiftPM.
In the docs, the examples often show commands like:
MyCLI --input 'Hello, world!'
But unless you’ve installed the binary or manually added it to your $PATH, trying to run mytool like that will just throw a “command not found” error.
Meanwhile, the official tutorial for CLI tools does use:
swift run MyCLI --input 'Hello, world!'
which actually works out of the box when you’re still developing the tool using SwiftPM.
I think this difference might confuse beginners who expect the tool to “just work” by name. It might help if the Argument Parser docs included a quick note that explains this—something like:
“During development, run your tool using swift run your-tool-name unless you’ve installed it or symlinked it.”
Just wanted to raise this in case others have run into the same thing or if it’s something worth updating in the docs.
Thanks!