dev.cliShortcuts

  • Type:
type CliShortcuts =
  | boolean
  | {
      custom?: (shortcuts?: CliShortcut[]) => CliShortcut[];
    };
  • Default: true when using Rsbuild CLI, false otherwise.
  • Version: >= 1.0.11

Whether to enable CLI shortcuts.

All Shortcuts

Press h + Enter to show all shortcuts:

Shortcuts: c + enter clear console o + enter open in browser q + enter quit process r + enter restart server u + enter show urls

Example

  • Enable:
export default {
  dev: {
    cliShortcuts: true,
  },
};
  • Disable:
export default {
  dev: {
    cliShortcuts: false,
  },
};
  • Disable some shortcuts:
export default {
  dev: {
    cliShortcuts: {
      custom: (shortcuts) => {
        return shortcuts.filter((shortcut) => shortcut.key !== 'o');
      },
    },
  },
};
  • Add custom shortcuts:
export default {
  dev: {
    cliShortcuts: {
      custom: (shortcuts) => {
        return [
          ...shortcuts,
          {
            key: 's',
            description: 'say hello',
            action: () => {
              console.log('hello world!');
            },
          },
        ];
      },
    },
  },
};