A simple command-line tool for managing AI generated rules in Git repositories.
Bulid by Actual Software
- π Detects if you're in a Git repository
- βοΈ Creates empty rules file if none exists
- π Analyzes repository against existing rules
- π Supports rule iteration (coming soon)
- π Validates rules syntax
- π Easy to use command-line interface
- π Analyze any Git repository by path
- π Automatic BAML initialization - no manual setup required
- π¦ Smart rate limiting - Prevents API rate limit errors with configurable delays
- π¦ Batch processing - Analyzes multiple files efficiently to reduce API calls
- π Automatic retry - Handles failures gracefully with exponential backoff
- βοΈ Flexible configuration - Customize rate limiting behavior via config files or CLI options
Rulectl now includes intelligent rate limiting to help you work within API provider limits:
- Automatic rate limiting - Stays within your API plan's request limits
- Batch processing - Groups files to reduce total API calls
- Configurable strategies - Choose between constant, exponential, or adaptive delays
- Provider-aware - Automatically detects Anthropic vs OpenAI and applies appropriate limits
- Command-line options - Override settings on-the-fly with
--rate-limit,--batch-size, etc.
For detailed rate limiting configuration, see RATE_LIMITING.md.
# Basic usage with automatic rate limiting
rulectl start
# Increase rate limit to 10 requests/minute
rulectl start --rate-limit 10
# Use conservative settings for large repositories
rulectl start --batch-size 2 --delay-ms 2000
# Show current rate limiting configuration
rulectl config showChoose one of the following installation methods:
curl -sSL https://raw.githubusercontent.com/actual-software/rulectl/main/install.sh | bashThis will prompt you to:
- Install Python 3.11+ if not available (via pyenv)
- Confirm installation of dependencies
- Set up your environment interactively
curl -sSL https://raw.githubusercontent.com/actual-software/rulectl/main/install.sh | bash -s -- --yesThis will automatically:
- Install all dependencies without prompts
- Set up Python 3.11+ if needed
- Configure PATH in your shell profiles
- Complete installation non-interactively
Both methods will:
- β Install Python 3.11+ if not present (via pyenv)
- β Configure PATH automatically in shell profiles
- β Build and install the rulectl binary
- β Verify installation works correctly
- β Clean up temporary files
For Debian and Ubuntu users, you can install rulectl using a .deb package:
# For x86_64 (Intel/AMD) systems:
wget https://github.com/actual-software/rulectl/releases/latest/download/rulectl_*_amd64.deb
sudo dpkg -i rulectl_*_amd64.deb
# For ARM64 (Apple Silicon, Raspberry Pi, etc.) systems:
wget https://github.com/actual-software/rulectl/releases/latest/download/rulectl_*_arm64.deb
sudo dpkg -i rulectl_*_arm64.deb
# If dependencies are missing, fix them with:
sudo apt-get install -fWindows users must build from source:
- Install Python 3.11+
- Install Git
- Follow the Manual Installation steps below
For more control or if the one-line installer doesn't work:
-
Prerequisites (for manual installation only):
- Python 3.11 or higher (Note: The automated installer above handles Python installation for you)
- Git
- C compiler (for building Python packages)
-
Clone the repository:
git clone https://github.com/actual-software/rulectl.git
cd rulectl- Set up virtual environment:
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Build the executable:
python build.py- Install to system:
# Copy to ~/.local/bin (recommended)
cp dist/rulectl ~/.local/bin/
# OR copy to /usr/local/bin (requires sudo, system-wide)
sudo cp dist/rulectl /usr/local/bin/- Verify installation:
rulectl --helpThe executable contains all dependencies and doesn't require Python on the target machine.
If you want to run the CLI directly without building:
- Create a virtual environment:
python3 -m venv venv- Activate the virtual environment:
# On macOS/Linux:
source venv/bin/activate
# On Windows:
.\venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Run the CLI:
python -m rulectl.cli start- When you're done, deactivate the virtual environment:
deactivateNote: Make sure to add venv/ to your .gitignore file to avoid committing the virtual environment to version control.
For macOS developers, you can test GitHub Actions workflows locally using the ci-local-test make target:
# Install act (if not already installed)
brew install act
# Test the GitHub Actions workflow locally
make ci-local-testThis command uses act to simulate the GitHub Actions environment locally, allowing you to test CI workflows before pushing changes.
Basic usage (analyze current directory):
rulectl startAnalyze a specific directory:
rulectl start ~/path/to/repositoryWith verbose output:
rulectl start --verbose ~/path/to/repositoryThe tool will:
- Check if the specified directory is a Git repository
- Initialize BAML client code generation
- Create an empty rules file if none exists
- Analyze the repository against the rules
Note: The build process automatically runs BAML generation, so built executables don't need this step.
The rules and analysis files will be created in the target repository under:
- The rules file:
.cursor/rules.mdc - Analysis results:
.rulectl/analysis.json
Please see docs/ folder for more documentation on feature implementations, usage, and development.