Shell Completion
Sake supports shell completion for streamlined command usage. To enable shell completion, follow the installation instructions provided in the Swift Argument Parser documentation.
With shell completion configured, you can use Tab
to auto-complete available commands, including built-in Sake commands and custom ones defined in your Sake project.
Built-in Sake Commands
$ sake <Tab>
build -- Manually trigger a rebuild of the SakeApp. This is typically unnecessary, but can be used to "warm up" the build if needed.
clean -- Remove all build artifacts generated by the SakeApp to ensure a clean state for future builds.
help -- Show subcommand help information.
init -- Initialize a new SakeApp project template for defining commands.
list -- List all available commands defined in the SakeApp.
run -- Run the specified command from the SakeApp.
User Commands
Note
Command listing will only work if SakeApp has already been built.
$ sake run <Tab>
check lint build test
Pressing Tab
immediately after sake run
(without typing any characters) will list all available user-defined commands. In this example, check
, lint
, build
, and test
are custom commands defined in your Sake project.
Auto-completing a Partial Command
$ sake run che<Tab>
$ sake run check
Here, typing che
followed by Tab
auto-completes to check
, assuming check
is a defined command.
This feature enhances the usability of Sake by making command discovery and execution faster and more efficient.
Fig Completion
Support for Fig autocompletion is coming soon! You can track the progress on this feature in the Fig Autocomplete PR.