# 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. ## Install Save in your project root: ## Quick Use 1. Install globally: `npm install -g lnai` 2. Initialize in your project: `lnai init` 3. Edit configs in the `.ai/` directory 4. Sync to all tools: `lnai sync` All your AI tool configs are now generated from a single source. --- ## Intro lnai is a CLI tool that lets you define AI coding tool configurations once in a unified `.ai/` directory and automatically syncs them to native formats for 7+ tools: Claude Code, Cursor, GitHub Copilot, Gemini CLI, Codex, OpenCode, and Windsurf. With 238 GitHub stars and active npm downloads, it eliminates the pain of maintaining separate config files for each AI tool. Best for: developers who use multiple AI coding tools and want consistent rules across all of them. Works with: Claude Code, Cursor, GitHub Copilot, Gemini CLI, Codex, Windsurf. Setup time: under 2 minutes. --- ## lnai — One Config, All AI Tools ### The Problem Every AI coding tool has its own config format: - Claude Code → `.claude/` - Cursor → `.cursor/` - GitHub Copilot → `.github/copilot-instructions.md` - Gemini CLI → `.gemini/` - Windsurf → `.windsurf/` Maintaining separate configs for each tool is tedious and error-prone. ### The Solution lnai creates a single `.ai/` directory as your source of truth: ``` .ai/ ├── instructions.md # Shared coding instructions ├── rules/ # Coding rules (applied to all tools) └── config.yaml # Tool-specific overrides ``` Then `lnai sync` generates native config files for all supported tools. ### Supported Tools | Tool | Config Directory | Status | |------|-----------------|--------| | Claude Code | `.claude/` | ✅ | | Codex | `.codex/` | ✅ | | Cursor | `.cursor/` | ✅ | | Gemini CLI | `.gemini/` | ✅ | | GitHub Copilot | `.github/copilot-instructions.md` | ✅ | | OpenCode | `.opencode/` | ✅ | | Windsurf | `.windsurf/` | ✅ | ### Commands ```bash lnai init # Create .ai/ configuration structure lnai validate # Check configs for errors lnai sync # Export to all native tool formats lnai clean # Remove orphaned config files ``` ### FAQ **Q: What is lnai?** A: lnai is a CLI tool that manages AI coding configurations from a single `.ai/` directory and syncs them to 7+ tools including Claude Code, Cursor, and GitHub Copilot. **Q: Is lnai free?** A: Yes, lnai is free and open source under the MIT license. **Q: How do I install lnai?** A: Run `npm install -g lnai`, then `lnai init` in your project to create the `.ai/` config directory. --- ## Source & Thanks > Created by [Krystian Jonca](https://github.com/KrystianJonca). Licensed under MIT. > > [lnai](https://github.com/KrystianJonca/lnai) — ⭐ 238 Thank you for solving the multi-tool config fragmentation problem. --- ## 快速使用 1. 全局安装: `npm install -g lnai` 2. 初始化项目: `lnai init` 3. 编辑 `.ai/` 目录中的配置 4. 同步到所有工具: `lnai sync` --- ## 简介 lnai 是一个 CLI 工具,让你在统一的 `.ai/` 目录中定义 AI 编码工具配置,然后自动同步到 7+ 工具的原生格式:Claude Code、Cursor、GitHub Copilot、Gemini CLI、Codex、OpenCode 和 Windsurf。拥有 238 GitHub stars,消除了为每个 AI 工具维护独立配置文件的痛苦。 --- ## lnai — 一份配置,所有 AI 工具 ### 问题 每个 AI 编码工具都有自己的配置格式,为每个工具维护独立配置既繁琐又容易出错。 ### 解决方案 lnai 创建一个 `.ai/` 目录作为唯一真实来源,然后 `lnai sync` 为所有支持的工具生成原生配置文件。 ### 支持的工具 | 工具 | 配置目录 | |------|---------| | Claude Code | `.claude/` | | Cursor | `.cursor/` | | GitHub Copilot | `.github/copilot-instructions.md` | | Gemini CLI | `.gemini/` | | Windsurf | `.windsurf/` | --- ## 来源与感谢 > Created by [Krystian Jonca](https://github.com/KrystianJonca). Licensed under MIT. > > [lnai](https://github.com/KrystianJonca/lnai) — ⭐ 238 --- Source: https://tokrepo.com/en/workflows/c3338e8d-2ef8-4d72-8d2a-43e7518555fd Author: AI Open Source