Custom slash commands
Junie CLI supports custom slash commands that you can create to quickly execute frequently used prompts or repetitive tasks. Custom commands are added to the list of built-in slash commands that is shown when you type /.
To create a custom command:
Use
/commands→Create New Commandand provide the command name and description.Select the command scope:
Project-specific commands are stored as Markdown files in the
.junie/commandsfolder at your project’s root directory. You can commit this folder to version control to ensure that all team members can use it.User commands are stored as Markdown files in the
~/.junie/commandsfolder on your machine, making them available across all projects you open locally.
Enter and save the prompt.
To view, modify, or delete the added custom commands in interactive mode, use /commands.
In ACP clients, /commands lists the custom commands available in the session (name, description, source, arguments) and explains how to run them with /name. Create and edit still happen by editing the Markdown files above or by using the TUI /commands screen.
Use arguments in the command prompt
You can use special keywords $argumentName in the prompt text to pass parameter values when invoking the custom slash command.
For example, if you create a command named explain and set the prompt as Explain the code in $file and suggest improvements, the /explain slash command should be used with the file argument when invoked as follows:
Argument values may be either unquoted or quoted with double or single quotes.
By default, custom slash commands accept only the named arguments defined in the command template. Commands created through the /commands wizard use this default.
To also accept free-form text the way some built-in slash commands do, add allowPromptArgument: true to the command's YAML frontmatter. This exposes an additional $prompt argument: you can reference $prompt explicitly in the prompt text, or, if you don't, any free text passed when invoking the command is appended automatically as User Input: ....
Slash command file format
Each custom slash command is saved as a separate Markdown file with YAML frontmatter that defines the command metadata. The file name is taken from the command name.
For example, a file for the /explain command will be named explain.md and look as follows: