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, use /commands.
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.
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: