The Grok CLI provides a flexible customization mechanism that allows users to set specific behavioral rules for different projects. The configuration is as follows:
1. Configuration file location:
In the project root directory, create the.grok/GROK.mdfile
2. Configuration content format:
Use Markdown format to write configuration rules, for example:
# Custom Instructions for Grok CLI - Always use TypeScript for new code files. - Use functional components with hooks for React. - Add JSDoc comments for public functions.
3. Common configuration items:
- Code style specification (indentation, naming conventions, etc.)
- Preferred technology stack (e.g. React function components)
- Documentation standards (e.g. JSDoc format)
- Project-specific command aliases
4. Modalities of entry into force:
The Grok CLI automatically detects configuration files in the project directory and applies those rules first. For example, when you type "create new component" in a React project, the Grok CLI automatically generates a function component instead of a class component based on the configuration.
This answer comes from the articleGrok CLI: Intelligent AI Assistant in the TerminalThe
































