<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Volodymyr Nehir</title>
    <description>The latest articles on DEV Community by Volodymyr Nehir (@volodymyr_nehir).</description>
    <link>https://dev.to/volodymyr_nehir</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3875006%2Fb3e095fa-1ea0-45ac-a9c0-884bb3ebb938.jpeg</url>
      <title>DEV Community: Volodymyr Nehir</title>
      <link>https://dev.to/volodymyr_nehir</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/volodymyr_nehir"/>
    <language>en</language>
    <item>
      <title>How to Build Custom Commands for Gemini CLI and Antigravity</title>
      <dc:creator>Volodymyr Nehir</dc:creator>
      <pubDate>Sun, 12 Apr 2026 15:45:20 +0000</pubDate>
      <link>https://dev.to/volodymyr_nehir/how-to-build-custom-commands-for-gemini-cli-and-antigravity-49mb</link>
      <guid>https://dev.to/volodymyr_nehir/how-to-build-custom-commands-for-gemini-cli-and-antigravity-49mb</guid>
      <description>&lt;p&gt;In the rapidly evolving world of AI CLI tools like Gemini CLI and Antigravity, the way we interact with autonomous agents is changing. Instead of writing complex, platform-specific plugins, custom commands are now officially merged with and built as Agent Skills.&lt;/p&gt;

&lt;p&gt;This means that to create a custom command (which you can trigger via a slash command like &lt;code&gt;/my-command&lt;/code&gt;), you simply need to create a skill using the open Agent Skills standard. Because tools like Gemini CLI and Antigravity share this open standard, you can build your command once in a global directory, and all compatible agents will be able to discover and use it.&lt;/p&gt;

&lt;p&gt;Here is a step-by-step guide on how to build a custom command using this modern approach.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create the Directory Structure
Commands are defined by a directory containing a &lt;code&gt;SKILL.md&lt;/code&gt; file. You can create this folder either locally for a specific project or globally for cross-agent compatibility.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For a project-specific command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; .gemini/skills/my-command/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For a global command (available to all compatible agents on your machine):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; ~/.agents/skills/my-command/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For a antigravity:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; ~/.gemini/antigravity/skills/my-command/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Create the SKILL.md Definition File
Inside your new directory, create a &lt;code&gt;SKILL.md&lt;/code&gt; file. To define how the command is invoked, you must start the file with a YAML frontmatter block.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The name field in this block is what dictates your slash command. For example, setting name: &lt;code&gt;my-command&lt;/code&gt; creates the &lt;code&gt;/my-command&lt;/code&gt; console command.&lt;/p&gt;

&lt;p&gt;Here is the exact boilerplate you need:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="nn"&gt;---&lt;/span&gt;
&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;my-command&lt;/span&gt;
&lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;A&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;brief&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;description&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;of&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;what&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;this&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;command&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;does."&lt;/span&gt;
&lt;span class="na"&gt;argument-hint&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;optional-arguments&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
&lt;span class="na"&gt;disable-model-invocation&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;span class="nn"&gt;---&lt;/span&gt;

&lt;span class="gh"&gt;# Instructions&lt;/span&gt;
You are helping to execute my custom command.
User input: $ARGUMENTS

Step 1. Do the following tasks...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Pro Tip: Setting &lt;code&gt;disable-model-invocation: true&lt;/code&gt;is highly recommended for custom commands. This prevents the AI agent from triggering the workflow on its own and ensures the script only runs when you explicitly type the command. You can also use the &lt;code&gt;$ARGUMENTS&lt;/code&gt; variable to automatically pass anything you type after the slash command directly into the agent's prompt.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;Add Execution Logic (Optional)
If your command requires the agent to execute specific code (like an audit script, a database migration, or a deployment script), you can bundle those scripts inside a &lt;code&gt;scripts/&lt;/code&gt; subfolder within your command's directory.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For instance, you could create &lt;code&gt;.gemini/skills/my-command/scripts/action.js.&lt;/code&gt; You can then instruct the agent in your &lt;code&gt;SKILL.md&lt;/code&gt; file to execute that specific file using built-in agent tools like &lt;code&gt;run_shell_command.&lt;/code&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Verify and Use Your Command
AI CLI tools like Gemini CLI automatically scan your directories to discover new skills and commands on the fly.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To verify that your new command was registered successfully, simply type the following in your terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/skills list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To run your custom command, just type &lt;code&gt;/my-command&lt;/code&gt; (or whatever name you defined in the YAML block) directly in the chat session.&lt;/p&gt;

&lt;p&gt;Have you started building custom Agent Skills for your CLI workflows yet? Let me know what commands you are creating in the comments below!&lt;/p&gt;

</description>
      <category>ai</category>
      <category>gemini</category>
      <category>agents</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
