lac is a CLI tool designed for seamless management of AI agent config files. By creating symlinks to files stored outside the repository, it ensures sensitive configurations are not committed to version control, while enabling portability across multiple machines. This approach keeps personal tweaks and various team configurations organized and accessible.
lac is a powerful command-line interface (CLI) tool designed for managing AI agent configuration files such as CLAUDE.md, AGENTS.md, .cursorrules, and .mcp.json, securely and without cluttering the repository. This innovative solution involves creating symbolic links, allowing configuration files to reside outside the Git repository while maintaining easy access and management within the project.
The functionality of lac revolves around efficiently handling AI configurations that may differ from team defaults or personal customizations that should not be included in the shared project history. The main objective is to provide a streamlined approach for utilizing consistent configurations across multiple machines.
The process utilizes several key components:
.git/info/exclude, ensuring they are ignored by Git without affecting the .gitignore file.In a Git repository, the following commands can be executed for initial setup and management:
# Navigate to the project directory
cd ~/projects/my-project
# Register the repository with lac
lac register
# Link all default configuration files
lac link --all
Once linked, any changes made to these files are reflected in the stored versions automatically due to the symlink structure. To cease usage within a specific repository, the command lac unregister can be executed.
CLAUDE.mdAGENTS.md.claude/.agents/.cursorrules.mcp.jsonAdditional files can be linked using the command lac link <filename>.
To maintain synced configurations between different machines, the storage directory utilized by lac can be treated as a Git repository. Here's how to set it up:
# On Machine A - Initially push the configuration
cd "$(lac home)"
git remote add origin <your-private-remote-url>
git add . && git commit -m "initial" && git push -u origin main
# On Machine B - Clone the repository
git clone <your-private-remote-url> ~/.local/share/lac
# or, if $LAC_HOME is set:
git clone <your-private-remote-url> "$LAC_HOME"
# Continue to register the repo and link files
cd ~/projects/repo
lac register
lac link --all
Basic Commands:
| Command | Description |
|---|---|
lac register | Registers the current repository. |
lac link | Interactive selection of files to link. |
lac link --all | Links all default configuration files at once. |
lac link <file> | Links a specific file by name. |
lac status | Displays registration state of the current repository. |
lac unregister | Restores linked files and backs up the storage. |
Diagnostic & Management Commands:
| Command | Description |
|---|---|
lac doctor | Checks for broken symlinks and missing targets. |
lac list | Lists all registered repositories. |
lac home | Prints the storage directory path. |
lac path [file] | Displays the storage path for the specified file. |
lac rename <name> | Renames the storage subdirectory of the current repo. |
git push, git pull).Overall, lac streamlines the management of AI agent configs, enhancing flexibility and consistency across development environments.
No comments yet.
Sign in to be the first to comment.