How to use Slash Commands w/ Cursor CLI?

Sometimes my cursor agent invocation can find /command-names that I can see in the Cursor IDE. Sometimes it claims it can’t.

Are Slash Commands supposed to be able to work w/ the agent CLI? e.g.

agent /local/my-command

to run it with its input prompt being that command.

Check on Slash commands | Cursor Docs
i think that between Slash Command in CLI with IDE different.

for CLI, you can create or edit using /commands

1 Like

hi @Texarkanine slash commands are working with agent CLI.

Custom slash commands are discovered from following locations: .cursor/commands (project-level) and ~/.cursor/commands (global),

The inconsistent behavior you’re experiencing isn’t expected. A few things to check:

Working directory: Project-level commands (.cursor/commands) only work when you run cursor agent from within that project’s directory [2]
CLI version: Ensure your CLI is up-to-date with agent update [3]
Command location: Verify your custom commands are in the correct directory (.cursor/commands for project-specific, ~/.cursor/commands for global) [2]

If the inconsistency persists after checking these, it may be a bug worth reporting.