Skip to content
CLI Tools
Command

/add-command

Create a new CLI command for mgrep.

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

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`

@mixedbread-ai
Ships withmgrep

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

Stars on GitHub

Momentum

stars in total
4.4k
Star history of mixedbread-ai/mgrep on GitHub, a chart by star-history.com

Other commands on mgrep.

More commands from other plugins.

canvas

canvas

Command

Spawn interactive terminal canvases for calendars, documents, and flight booking

@dvdsgl@dvdsglInstall Command
debug-logs

debug-logs

Command

Analyze claudish debug logs from a failed model run. Extracts SSE fixtures, diagnoses failures, adds regression tests.

@madappgang@madappgangInstall Command