PitchHut logo
Effortlessly manage AI agent configurations without repo clutter.
Pitch

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.

Description

lac

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.

Overview

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.

How It Works

The process utilizes several key components:

  • Symlinks: Each linked file in the repository is a symlink pointing to its copy stored in lac's designated storage directory.
  • Git Exclusion: The filenames of linked files are added to .git/info/exclude, ensuring they are ignored by Git without affecting the .gitignore file.
  • Repository Identity: Each repository is identified by its Git remote URL or, if unavailable, by its absolute path. This mechanism allows the same repository on different machines to link to the same storage subdirectory.

Use Cases

  • Manage AI configurations that deviate from standard team defaults.
  • Keep personal adjustments private and separate from the shared version history.
  • Ensure uniform configurations across various devices.

Quick Start

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.

Default Files Supported

  • CLAUDE.md
  • AGENTS.md
  • .claude/
  • .agents/
  • .cursorrules
  • .mcp.json

Additional files can be linked using the command lac link <filename>.

Syncing Across Machines

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

Commands Summary

Basic Commands:

CommandDescription
lac registerRegisters the current repository.
lac linkInteractive selection of files to link.
lac link --allLinks all default configuration files at once.
lac link <file>Links a specific file by name.
lac statusDisplays registration state of the current repository.
lac unregisterRestores linked files and backs up the storage.

Diagnostic & Management Commands:

CommandDescription
lac doctorChecks for broken symlinks and missing targets.
lac listLists all registered repositories.
lac homePrints 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.

Limitations

  • Supported only on macOS and Linux (Windows is not supported).
  • Requires Python version 3.11 or higher.
  • Designed for single-user usage, sharing the storage between multiple users is not supported.
  • Manual synchronization needed between machines using Git commands (git push, git pull).

Overall, lac streamlines the management of AI agent configs, enhancing flexibility and consistency across development environments.

0 comments

No comments yet.

Sign in to be the first to comment.