Custom Slash Commands

Slash commands can be accessed in the command palette and are now called custom commands.

You can now define custom slash commands in the Amp CLI. They allow you to insert pre-defined or dynamically-generated text into the prompt input.

To define a custom slash command, create a file at the root of your repository in a .agents/commands/ folder. The name of the file serves as the name of the slash command.

For example, if you create .agents/commands/pr-review.md it will create the /pr-review slash command. When you use the command, the contents of the pr-review.md file will be inserted into the prompt input.

Alongside this, we're also shipping an experimental mode for executable slash commands: if a text file in .agents/commands is executable and has a #! on its first line (as in #!/usr/bin/env bash, for example), it will also get turned into a slash command. And when that command is then invoked, the corresponding file is executed and its output will be inserted.