Answer: Chain commands to run in other directories, for example: cd subdir && npm test. Status: Confirmed Entry: tool/cursor/commands-and-shortcuts/run-command-in-other-directory Revision: 1 Digest: sha256:d7ff268a479b0662 (changes whenever the content changes) Timeline: Created: 2026-11-13T03:09:48Z Last changed: 2026-11-13T03:09:48Z Last verified: 2026-11-20T12:36:00Z Next check: 2026-11-21T12:36:00Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of example command | cd subdir && npm test | [1] | 2026-11-20 Sources: [1] Anysphere. "cursor.com/docs/cli/shell-mode.md". https://cursor.com/docs/cli/shell-mode.md Role: primary. Accessed: 2026-11-20T12:36:00Z Quote: "cd subdir && npm test" (Supports: example command) Snapshot SHA-256: 7acca7788419524ddc8f677930401a10d3413a760f830b33d5bc42c9353bc0c7 (captured 2026-11-13T03:09:48Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. On this check the text of [1] was unchanged since 2026-11-13T03:09:48Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T12:36:00Z. No independent second source is configured for this entry Last successful check: 2026-11-20T12:36:00Z Last attempt: 2026-11-20T12:36:00Z Notes and limitations: Extracted automatically from a single official source (section "Command execution"). Related: https://latestn.com/tool/cursor/commands-and-shortcuts/run-security-review-in-agent How do I run a security review in my own Cursor agent before pushing? https://latestn.com/tool/cursor/commands-and-shortcuts/set-output-format How do I set the output format for the Cursor Agent CLI? https://latestn.com/tool/cursor/commands-and-shortcuts/shell-mode-command-timeout How long does a command run in Cursor Shell Mode before it times out? https://latestn.com/tool/cursor/commands-and-shortcuts/playground-slash-commands How do I run a custom channel route as a slash command in the Cursor Agent SDK playground? https://latestn.com/tool/cursor/commands-and-shortcuts/pr-subcommands-list What pull request subcommands does the Cursor Origin CLI support? https://latestn.com/tool/cursor/commands-and-shortcuts/replay-github-pr How do I replay a GitHub pull request with the Cursor agent-sdk? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-13T03:09:48Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/cursor/commands-and-shortcuts/run-command-in-other-directory/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/cursor/commands-and-shortcuts/run-command-in-other-directory POST: https://latestn.com/dispute/tool/cursor/commands-and-shortcuts/run-command-in-other-directory with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/cursor/commands-and-shortcuts/run-command-in-other-directory?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I run a command in a different directory in Cursor Shell Mode? Revision 1, last verified 2026-11-20T12:36:00Z. https://latestn.com/tool/cursor/commands-and-shortcuts/run-command-in-other-directory (accessed 2026-11-21T10:07:45Z). @misc{LatestN_tool_cursor_commands_and_shortcuts_run_command_in_other_directory_r1, title = {How do I run a command in a different directory in Cursor Shell Mode?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/cursor/commands-and-shortcuts/run-command-in-other-directory}}, note = {Revision 1; digest sha256:d7ff268a479b0662; last verified 2026-11-20T12:36:00Z; accessed 2026-11-21T10:07:45Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/cursor/commands-and-shortcuts/run-command-in-other-directory