Answer: Create a `commands` directory with a subdirectory for your command group, then create a TOML file such as `commands/fs/grep-code.toml` containing the prompt; after saving the file, restart Gemini CLI and run `/fs:grep-code "some pattern"`. Status: Confirmed Entry: tool/gemini-cli/commands-and-shortcuts/add-custom-command Revision: 1 Digest: sha256:98a5ece25ab891cf (changes whenever the content changes) Timeline: Created: 2026-11-13T03:18:24Z Last changed: 2026-11-13T03:18:24Z Last verified: 2026-11-20T12:52:46Z Next check: 2026-11-21T12:52:46Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of command file | commands/fs/grep-code.toml | [1] | 2026-11-20 command name | /fs:grep-code | [1] | 2026-11-20 directory creation (macOS/Linux) | mkdir -p commands/fs | [1] | 2026-11-20 directory creation (Windows) | New-Item -ItemType Directory -Force -Path "commands\fs" | [1] | 2026-11-20 usage example | /fs:grep-code "some pattern" | [1] | 2026-11-20 Sources: [1] Google. "Build Gemini CLI extensions". https://geminicli.com/docs/extensions/writing-extensions.md Role: primary. Accessed: 2026-11-20T12:52:46Z Quote: "Create a file named `commands/fs/grep-code.toml`:" (Supports: command file) Quote: "This command, `/fs:grep-code`, takes an argument, runs the `grep` shell" (Supports: command name) Quote: "mkdir -p commands/fs" (Supports: directory creation (macOS/Linux)) Quote: "New-Item -ItemType Directory -Force -Path "commands\fs"" (Supports: directory creation (Windows)) Quote: "Run `/fs:grep-code "some pattern"` to" (Supports: usage example) Published: 2026-10-16T02:36:07Z Snapshot SHA-256: 4c981cc62340163051ded660bc1d9b650b34f3674e04b16899045aa2198fef98 (captured 2026-11-13T03:18:24Z) 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:18:24Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T12:52:46Z. No independent second source is configured for this entry Last successful check: 2026-11-20T12:52:46Z Last attempt: 2026-11-20T12:52:46Z Notes and limitations: Extracted automatically from a single official source (section "Step 5: Add a custom command"). Related: https://latestn.com/tool/gemini-cli/commands-and-shortcuts/browse-past-sessions How do I browse and load past Gemini CLI sessions? https://latestn.com/tool/gemini-cli/commands-and-shortcuts/cli-options What CLI options are available in Gemini CLI? https://latestn.com/tool/gemini-cli/commands-and-shortcuts/command-line-arguments What command-line arguments does Gemini CLI support? https://latestn.com/tool/gemini-cli/agents-and-automation/unassign-inactive-assignees How does Gemini CLI automatically unassign inactive issue assignees? https://latestn.com/tool/gemini-cli/agents-and-automation/use-agent-skill-in-session How do I activate or use an Agent Skill during a Gemini CLI session? https://latestn.com/tool/gemini-cli/agents-and-automation/write-skill-description How do I write a good description for a Gemini CLI Agent Skill? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-13T03:18:24Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/gemini-cli/commands-and-shortcuts/add-custom-command/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/gemini-cli/commands-and-shortcuts/add-custom-command POST: https://latestn.com/dispute/tool/gemini-cli/commands-and-shortcuts/add-custom-command with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/gemini-cli/commands-and-shortcuts/add-custom-command?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I add a custom command to a Gemini CLI extension? Revision 1, last verified 2026-11-20T12:52:46Z. https://latestn.com/tool/gemini-cli/commands-and-shortcuts/add-custom-command (accessed 2026-11-21T09:58:33Z). @misc{LatestN_tool_gemini_cli_commands_and_shortcuts_add_custom_command_r1, title = {How do I add a custom command to a Gemini CLI extension?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/gemini-cli/commands-and-shortcuts/add-custom-command}}, note = {Revision 1; digest sha256:98a5ece25ab891cf; last verified 2026-11-20T12:52:46Z; accessed 2026-11-21T09:58:33Z} } 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/gemini-cli/commands-and-shortcuts/add-custom-command