ConfigsApr 6, 2026·2 min read

lnai — Unified AI Config for Claude, Cursor, Copilot & More

Define AI tool configs once in a .ai/ directory and auto-sync to Claude Code, Cursor, GitHub Copilot, Gemini CLI, Codex, and Windsurf native formats.

TL;DR
Define AI tool configs once in .ai/ and sync to Claude Code, Cursor, Copilot, Gemini CLI, and more.
§01

What it is

lnai is a CLI tool that lets developers define AI coding tool configurations in a single .ai/ directory and automatically sync them to native config formats for seven or more tools: Claude Code (CLAUDE.md), Cursor (.cursor/rules), GitHub Copilot (.github/copilot-instructions.md), Gemini CLI (GEMINI.md), Codex (AGENTS.md), OpenCode, and Windsurf (.windsurfrules).

The target audience is developers and teams who use multiple AI coding assistants and are tired of maintaining duplicate config files. Instead of writing the same rules in five different formats, you write them once and let lnai generate the rest.

§02

How it saves time or tokens

Maintaining separate config files for each AI tool is tedious and error-prone. When you update a coding standard in one file, you have to remember to update all the others. lnai eliminates this duplication -- a single lnai sync command propagates changes to every tool. This also prevents the common problem where one tool follows updated rules while another still operates on stale instructions.

Because configs are generated from a single source, teams can version-control the .ai/ directory and review changes in one place during pull requests.

§03

How to use

  1. Install globally:
npm install -g lnai
  1. Initialize in your project:
lnai init
  1. Edit your configs in the .ai/ directory.
  2. Sync to all tools:
lnai sync
§04

Example

# After editing .ai/rules/typescript.md with your coding standards
$ lnai sync

Synced to:
  - .claude/CLAUDE.md
  - .cursor/rules/typescript.mdc
  - .github/copilot-instructions.md
  - GEMINI.md
  - AGENTS.md
  - .windsurfrules

All seven tools now follow the same TypeScript coding standards from a single source file.

§05

Related on TokRepo

§06

Common pitfalls

  • Running lnai sync before committing changes -- the generated files can clutter your git diff. Add a pre-commit hook or run sync as part of your CI pipeline.
  • Assuming all tools interpret rules identically -- each AI tool has different context window sizes and config parsing behavior. Test critical rules in each tool after syncing.
  • Forgetting to add the .ai/ directory to version control -- without it, other team members will not get the configs.

Frequently Asked Questions

Which AI coding tools does lnai support?+

lnai currently supports Claude Code (CLAUDE.md), Cursor (.cursor/rules), GitHub Copilot (.github/copilot-instructions.md), Gemini CLI (GEMINI.md), Codex (AGENTS.md), OpenCode, and Windsurf (.windsurfrules). The architecture is extensible, so new tools can be added through the plugin system.

Do I need to install all supported AI tools to use lnai?+

No. lnai generates config files for all supported tools by default, but you can configure which tools to target in your .ai/ settings. If you only use Claude Code and Cursor, lnai will only generate those two config files.

Can lnai handle project-specific and global configs?+

Yes. You can run lnai init at the project level for project-specific rules, and you can maintain a global .ai/ directory for rules that apply across all your projects. Project-level configs take precedence when both exist.

How does lnai handle conflicts between tool formats?+

Each tool has a different native format. lnai maintains format-specific templates that translate your universal rules into each tool's expected syntax. If a rule uses a feature only available in one tool (like Cursor's .mdc metadata), lnai includes it only in that tool's output.

Is lnai open source?+

Yes. lnai is open-source and available on GitHub. You can install it via npm and contribute new tool adapters through pull requests. The project welcomes contributions for adding support for new AI coding tools.

Citations (3)
  • lnai GitHub— lnai syncs AI tool configs from a unified .ai/ directory to multiple native form…
  • Anthropic Claude Code Docs— CLAUDE.md is the configuration file Claude Code reads for project-level instruct…
  • Cursor Documentation— Cursor uses .mdc rule files for project-specific AI behavior configuration
🙏

Source & Thanks

Created by Krystian Jonca. Licensed under MIT.

lnai — ⭐ 238

Thank you for solving the multi-tool config fragmentation problem.

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets