Command reference ยท Cursor CLI
agent install-shell-integration
Installs the CLI's shell integration into ~/.zshrc.
agent install-shell-integration is not a slash command inside a running chat session but a standalone terminal subcommand of the Cursor CLI. You run it directly in the shell, independent of a cursor-agent session, not as a / command in the chat.
The command sets up the shell integration by adding matching entries to ~/.zshrc. According to the official docs, this explicitly refers to zsh; no separate integration routine is documented for other shells like bash, even though the regular installation of the CLI itself supports both bash and zsh according to the setup guide.
You typically run the command once after installing the CLI so Cursor Agent is cleanly wired into your shell environment, for example for autocomplete or context features. If you want to remove the integration again later, use its counterpart agent uninstall-shell-integration.
โ WHEN TO USE IT?
Set up the shell integration once after installing the CLI
agent install-shell-integration
Check after a CLI update whether the integration is still wired up cleanly
Run agent install-shell-integration again if shell features no longer work as expected.
โ WHEN NOT TO?
The shell integration should be removed again
agent install-shell-integration only installs, it doesn't remove anything.
Better: Use agent uninstall-shell-integration
You're not using a zsh shell
According to the docs, the command explicitly targets ~/.zshrc; no integration routine is documented for other shells.
Better: Use Cursor CLI normally regardless โ the shell integration is optional, not a requirement for it to work
SOURCES
- Cursor Docs โ CLI Reference: Parameters โ cursor.com
MORE COMMANDS ยท Cursor CLI