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.
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.
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.
How to use
- Install globally:
npm install -g lnai
- Initialize in your project:
lnai init
- Edit your configs in the
.ai/directory. - Sync to all tools:
lnai sync
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.
Related on TokRepo
- AI tools for coding -- Other tools that enhance AI-assisted development workflows
- Prompt library -- Reusable prompt templates that pair well with lnai configs
Common pitfalls
- Running
lnai syncbefore 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
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.
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.
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.
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.
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
Related on TokRepo
Source & Thanks
Created by Krystian Jonca. Licensed under MIT.
lnai — ⭐ 238
Thank you for solving the multi-tool config fragmentation problem.
Discussion
Related Assets
Cucumber.js — BDD Testing with Plain Language Scenarios
Cucumber.js is a JavaScript implementation of Cucumber that runs automated tests written in Gherkin plain language.
WireMock — Flexible API Mocking for Java and Beyond
WireMock is an HTTP mock server for stubbing and verifying API calls in integration tests and development.
Google Benchmark — Microbenchmark Library for C++
Google Benchmark is a library for measuring and reporting the performance of C++ code with statistical rigor.