Skip to content
CLI Tools
Command

/add-command

Create a new CLI command for mgrep.

BOOST
From plugin
mgrep
4.4k6 skills6 commands
Install
> /plugin marketplace add mixedbread-ai/mgrep
> /plugin install mgrep@Mixedbread-Grep

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/add-command

Context preview

What this command does when you run it.

Create a new CLI command for mgrep.

Command definition

add-command.md

Add Command

Create a new CLI command for mgrep.

Arguments

  • `$ARGUMENTS` - The name of the new command (e.g., "status", "info")

Steps

1. Create a new file at `src/commands/$ARGUMENTS.ts` following the pattern:

   import { Command } from "commander";

   export const $ARGUMENTS = new Command("$ARGUMENTS")
     .description("Description of what this command does")
     .option("-x, --example <value>", "Example option description")
     .action(async (options) => {
       // Implementation here
     });

2. Register the command in `src/index.ts`:

  • Add import: `import { $ARGUMENTS } from "./commands/$ARGUMENTS.js";`
  • Add to program: `program.addCommand($ARGUMENTS);`

3. Add tests in `test/test.bats`:

   @test "$ARGUMENTS command runs successfully" {
     run mgrep $ARGUMENTS
     assert_success
   }

4. Run verification: `pnpm typecheck && pnpm test`

Ships withmgrep

A calm, CLI-native way to semantically grep everything, like code, images, pdfs and more.

Get the whole plugin
Stats
4,414
Stars
176
Forks
Maintained
Maintenance
TypeScript
Language
Apache-2.0
License
5mo ago
Last commit
11mo ago
Created
1d ago
Added

Repo: mixedbread-ai/mgrep

Other commands on mgrep.