Skip to main content

A universal CLI utility to configure AI rules files for any project.

Project description

rules4

A universal CLI utility to configure AI rules files (e.g., .roo/rules, CLAUDE.md, .cursor/rules) for any project, based on the latest industry best practices via live Perplexity research.

Features

  • Supports any language or framework via --lang and --tags options
  • Configures rules for tools like Cursor, Roo, Claude, and more
  • Uses live Perplexity API for up-to-date best practices
  • Dry-run mode to preview changes
  • Prompts before overwriting existing files
  • Simple one-command install (packaged for PyPI)
  • Designed for future MCP integration

Installation

pip install rules4

Usage

Basic Rule Generation

To generate rules for a specific tool (e.g., copilot) for a given language and tags:

rules4 copilot --lang python --tags "pytest,langgraph"

This command will:

  • Use gpt-4-turbo as the primary model (default).
  • Generate rules for Python projects, focusing on pytest and langgraph.
  • Save the rules to .github/copilot-python-pytest,langgraph.md (or similar, depending on the tool).

Advanced Usage

You can specify a primary model, a review model, and enable research:

rules4 copilot --primary gpt4.1 --review claude-4-sonnet --research --lang javascript --tags "react,typescript"

This command will:

  • Use gpt4.1 as the primary model for rule generation.
  • Perform research using Perplexity AI before generating rules.
  • Have claude-4-sonnet review and refine the generated rules.
  • Generate rules for JavaScript projects, focusing on react and typescript.

Generating Rules for All Configured Tools

If you have a .rules4rc file configured, you can generate rules for all specified tools:

rules4 generate --lang go --tags "code style"

This command will:

  • Read the list of tools from your .rules4rc file.
  • Generate rules for each tool, focusing on code style for Go projects.

Command-Line Options

  • --primary <model_name>: Specify the primary AI model for rule generation (e.g., gpt-4-turbo, gpt4.1).
  • --review <model_name>: Specify an AI model for reviewing and refining the generated rules (e.g., claude-4-sonnet).
  • --research: Enable research using Perplexity AI before rule generation.
  • --lang <language>: Specify the programming language for rule generation (e.g., python, javascript, go).
  • --tags <tag1,tag2,...>: Comma-separated list of tags or topics for rule generation (e.g., pytest,langgraph, react,typescript, code style).
  • --dry-run: Preview the changes without actually writing any files.
  • --yes, -y: Overwrite existing files without prompting for confirmation.
  • --project-path <path>: (Optional) Specify the target project directory. Defaults to the current directory.

This project is in early development. For contributions, see CONTRIBUTING.md.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rules4-0.0.3.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rules4-0.0.3-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file rules4-0.0.3.tar.gz.

File metadata

  • Download URL: rules4-0.0.3.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.11

File hashes

Hashes for rules4-0.0.3.tar.gz
Algorithm Hash digest
SHA256 4f5051c6c04f7fb87802111781017438930018c68c16572dd8411eabd1379c5c
MD5 95a3678792048ccf7eff2c1434c6a90e
BLAKE2b-256 3a968dc42d95647b790905768cd63dedd1f095ce4a2afd998ac6d351851267f9

See more details on using hashes here.

File details

Details for the file rules4-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: rules4-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.11

File hashes

Hashes for rules4-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8885a38e8bac40f703c27c2905e8cd2f1dee206dc426d1d4623b106bcf97edb6
MD5 f4dde92d7653d2f0a1bf1ad0adf37958
BLAKE2b-256 e90e0bbab65f20e20f41508081ea9fa6e81a3e3b847690da4de089658fa482bc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page