rules

package
v0.0.102 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 4, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package rules provides functionality for managing Cursor rule files.

The package supports: - Adding rule files to the user's ~/.kool/rules/files directory - Listing available rule files - Using rule files by copying them to the current project's .cursor/rules directory - Removing rule files from the ~/.kool/rules/files directory - Renaming rule files in the ~/.kool/rules/files directory - Printing the content of rule files - Entering an interactive shell for working with rules

When running 'kool rule' without arguments, an interactive bash sub-shell is launched with a custom prompt showing the rules directory. In this shell, users can execute all standard bash commands plus special rule management commands like 'use <file>' to apply a rule.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(rulePath string) (string, error)

Add copies a rule file to the ~/.kool/rules/files directory If a file with the same name already exists, a timestamp will be appended to make it unique

func EnterSubshell added in v0.0.15

func EnterSubshell() error

EnterSubshell creates and enters a bash sub-shell with a custom prompt and special 'use' command for rule management

func Get added in v0.0.15

func Get(ruleName string) error

Get prints the content of a rule file from the ~/.kool/rules/files directory

func GetCursorRulesDir

func GetCursorRulesDir() (string, error)

GetCursorRulesDir returns the path to the .cursor/rules directory in the current working directory

func GetRulesDir

func GetRulesDir() (string, error)

GetRulesDir returns the path to the .kool/rules directory in the user's home directory

func Handle added in v0.0.14

func Handle(args []string) error

func List

func List() ([]string, error)

List returns a list of rule files in the ~/.kool/rules/files directory

func Move added in v0.0.15

func Move(srcName, destName string) error

Move renames a rule file in the ~/.kool/rules/files directory

func Remove

func Remove(ruleName string) error

Remove deletes a rule file from the ~/.kool/rules/files directory

func Use

func Use(ruleName string) error

Use copies a rule file from ~/.kool/rules/files to .cursor/rules if it doesn't already exist

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL