Skip to main content

Overview

The grab configure command allows you to customize React Grab’s behavior including activation keys, activation modes, and context options.

Usage

Alias: grab config

Options

Configuration Options

Activation Key

The keyboard shortcut to activate React Grab:
Supported modifiers:
  • Meta (Cmd on Mac, Win on Windows)
  • Ctrl
  • Shift
  • Alt (Option on Mac)
Supported keys:
  • Letters: a-z
  • Numbers: 0-9
  • Special keys: Space, Enter, Escape, Tab
  • Function keys: F1-F12
  • Symbols: `, -, =, [, ], \, ;, ', ,, ., /

Activation Mode

How the activation key behaves:
  • Toggle — Press once to activate, press again to deactivate
  • Hold — Hold the key to keep React Grab active, release to deactivate

Key Hold Duration

Milliseconds to hold the key before activation (only for hold mode):
Range: 0-2000ms
Default: 150ms

Allow Activation Inside Input

Whether to allow activation when focused on input fields:

Max Context Lines

Number of surrounding code lines to include in copied context:
Range: 0-50
Default: 3

CDN Domain

Customize the CDN domain for loading React Grab:

Examples

Interactive Mode

Run without flags to use the interactive configuration wizard:
1

Select option to configure

Search and select from available options:
2

Configure the option

Follow prompts based on the selected option:
3

Review changes

Preview the code changes:
4

Apply changes

Confirm to save the configuration:

Configure Multiple Options

Set multiple options at once:

Non-Interactive Configuration

Configure without prompts:

Change CDN Domain

Use a custom CDN:

Output Example

Advanced Configuration

Combined Options Example

Results in:

Interactive Key Selection

The interactive mode provides smart suggestions:
Type to filter suggestions:

Troubleshooting

React Grab Not Installed

Solution: Run grab init first.

Invalid Mode

Solution: Use toggle or hold for the --mode flag.

Invalid Hold Duration

Solution: Provide a value between 0 and 2000.

Invalid Context Lines

Solution: Provide a value between 0 and 50.

No Changes Needed

If the configuration is already set:

Configuration Persistence

Configurations are stored in your code via the data-options attribute:
For programmatic usage, pass options to the init function or React component:
  • grab init — Initialize React Grab in your project
  • grab add — Connect React Grab to your coding agent
  • grab remove — Disconnect agent integrations