Skip to content

CLI Reference

LNAI provides three commands for managing your unified AI configuration.

Terminal window
pnpm add -g lnai

Initialize a new .ai/ configuration directory.

Terminal window
lnai init [options]

When run interactively (in a terminal), lnai init prompts you to select which tools to configure and how to handle version control. Use -y to skip prompts and use defaults.

OptionDescription
-y, --yesSkip prompts and use defaults
--forceOverwrite existing .ai/ directory
--minimalCreate only config.json (no subdirectories)
-t, --tools <tools...>Enable only specific tools
Terminal window
lnai init # Interactive mode (prompts for tools)
lnai init -y # Non-interactive, use defaults
lnai init --minimal # Create only config.json
lnai init --tools claudeCode # Enable only Claude Code
lnai init --force # Overwrite existing config

Export the unified .ai/ configuration to native tool formats.

Terminal window
lnai sync [options]
OptionDescription
--dry-runPreview changes without writing files
--skip-cleanupSkip deletion of orphaned files
-t, --tools <tools...>Filter to specific tools
-v, --verboseShow detailed output
SymbolMeaning
+File created
~File updated
-File deleted
=File unchanged
Terminal window
lnai sync # Sync all enabled tools
lnai sync --dry-run # Preview changes
lnai sync --tools claudeCode # Sync only Claude Code

Validate the unified .ai/ configuration structure and content.

Terminal window
lnai validate [options]
OptionDescription
-t, --tools <tools...>Filter validation to specific tools
Terminal window
lnai validate # Validate all configuration
lnai validate --tools claudeCode # Validate only for Claude Code

IdentifierTool
claudeCodeClaude Code
codexCodex
cursorCursor
geminiGemini CLI
copilotGitHub Copilot
opencodeOpenCode
windsurfWindsurf