Skip to main content

CODEOWNERS Generator

Turn pasted ownership rules into a clean, aligned GitHub CODEOWNERS file. Flags patterns with no owner, dead duplicate rules, unsupported ! negation, and malformed owner tokens — and resolves which rule governs a given file under GitHub's real last-match-wins order.

Input

One rule per line: <pattern> <owner1> [owner2 ...]. Owners are @username, @org/team, or an email — leave them blank to mark a path unowned. Lines starting with # are comments. Later rules override earlier ones for the same path.

See which rule actually governs this path, per GitHub's last-match-wins order.

Output

Generated CODEOWNERS
 
Warnings
LinePatternIssue
No data yet
Was this helpful?

More ways to use this tool

REST API

curl -X POST https://api.iotools.cloud/v1/tool/codeowners-generator \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "rules": "# Default owners for everything\n*               …",
    "testPath": "docs/setup.md"
  }'

Swap in your own key from your account. The tool's fields are the body — no wrapper.

Ask an AI agent

Use the IOTools `codeowners-generator` tool (CODEOWNERS Generator) on this input:

YOUR_INPUT_HERE

Paste this at any agent connected to the IOTools MCP server, then add your input.

Embed widget

<iframe
  src="https://iotools.cloud/embed/codeowners-generator/"
  width="100%" height="520" frameborder="0" scrolling="no" loading="lazy"
  title="CODEOWNERS Generator — iotools.cloud"
  sandbox="allow-scripts allow-forms allow-same-origin allow-downloads allow-popups allow-popups-to-escape-sandbox"
  allow="clipboard-write"
  style="width:100%;border:1px solid #e5e7eb;border-radius:12px;overflow:hidden"></iframe>
<script src="https://iotools.cloud/embed.js" async></script>

Drop this into your own page — free, no key required, just a link back.

Cost per API/MCP callFrom 5 credits

Also available with

Guides

Paste your ownership rules and get back a clean, aligned GitHub CODEOWNERS file — plus a warnings list that catches the mistakes this file format quietly allows: a pattern with no owner, a duplicate rule that's already dead, ! negation (which .gitignore supports but CODEOWNERS doesn't), and owner tokens that aren't a valid @username, @org/team, or email.

What is a CODEOWNERS file?

A CODEOWNERS file tells GitHub (or GitLab/Bitbucket, which use the same format) which people or teams are automatically requested for review when a pull request touches specific paths. It lives at .github/CODEOWNERS, CODEOWNERS, or docs/CODEOWNERS in a repository, and can also drive required-reviewer branch protection rules.

How to use this generator

  1. Paste your rules into the Ownership Rules box, one per line: a path pattern followed by one or more owners (*.js @web-team, /docs/ @doc-team @jane-doe). Lines starting with # are kept as comments.
  2. The generator re-emits the file with owners aligned into a readable column, and lists any issues it finds in the Warnings table.
  3. Optionally enter a path in Test a file path — the tool resolves exactly which rule wins for that path under GitHub's real last-match-wins order, and shows its owners.
  4. Copy the result or download it as CODEOWNERS.

Why order matters

GitHub doesn't merge overlapping CODEOWNERS rules — it applies only the last matching pattern in the file, full stop. A broad rule near the top (* @global-owner) is routinely overridden by a narrower one further down (/docs/ @doc-team), and a rule repeated verbatim later in the file makes every earlier copy of it dead code. Both are easy to introduce by accident once a file grows past a handful of lines, and neither produces an error from GitHub itself — the generator's warnings and the "test a file path" lookup exist specifically to catch what GitHub silently allows.

Pattern syntax

Patterns follow the same rules as .gitignore, with one notable exception:

  • A pattern with no / (like *.js) matches at any depth in the repository.
  • A pattern starting or containing a / (like /docs/ or apps/web/) is anchored relative to the repository root.
  • A trailing / (like /build/logs/) matches that directory and everything inside it.
  • * matches within one path segment; ** crosses segments.
  • Unlike .gitignore, CODEOWNERS does not support ! negation patterns — the generator flags any pattern starting with !.

Who can be an owner?

A GitHub username (@octocat), a team (@my-org/reviewers), or an email address tied to a GitHub account. A pattern with no owners at all is valid syntax too — GitHub reads it as "no reviewers are required here," which is useful for carving an exception out of a broader rule above it, but easy to leave in by mistake, so the generator flags it as a warning either way.

Is this private?

Yes — everything runs in your browser. Your rules and any file path you test are never sent to a server.

For the file that keeps generated build output and dependencies out of Git in the first place, see the Gitignore Generator. To check whether a single glob pattern matches the paths you expect before dropping it into CODEOWNERS, use the Shell Glob Pattern Tester.

githubpull requestcode reviewrequired reviewersrepositoryownershipbranch protectiongit

Love the tools? Lose the ads.

One payment clears every ad from your account, for good. No subscription, no tracking.