134 words
1 minutes
How to Set Up Project Instructions in GitHub Copilot CLI【/init】

Overview#

Does Copilot keep generating code that doesn’t quite match your project’s coding standards?

“We use camelCase here, not snake_case.” “Tests should be in Vitest, not Jest.” Sound familiar? You can fix this with /init.


Usage#

Run this in Copilot CLI:

/copilot> /init

This creates a Copilot instruction file for your repository. Write your project’s rules there, and Copilot will follow them in every session.


What Gets Created?#

/init generates an instruction file (e.g., COPILOT.md or .github/copilot-instructions.md) in your repository.

You can specify things like:

  • Coding conventions (naming, indentation, etc.)
  • Preferred frameworks and libraries
  • How tests should be written
  • Patterns to avoid

The Difference#

BeforeAfter
Correcting “use Vitest, not Jest” every timeCopilot uses Vitest by default
Fixing naming conventions manuallyCode follows your standards from the start
Output varies between team membersEveryone gets consistent results

How to Set Up Project Instructions in GitHub Copilot CLI【/init】
https://naonao-na.com/en/posts/github-copilot-cli-init/
Author
[object Object]
Published at
2026-03-28