A compact CLI for managing instruction files and MCP tooling across multiple repositories. Built with Go and Bubble Tea, rulem keeps each repository’s instructions, settings, and MCP tools in sync while sharing credentials, storage, and background scans.
- Multi-repo aware: Each repository gets its own instructions and settings inside the TUI, but all share the same credentials and MCP registry.
- Primary workflows: Launch
rulemfor the TUI,rulem mcpfor the MCP server, and use the menu actions to save/import rules, refresh GitHub repos, or edit repository metadata. - Safety guards: Git-backed flows run dirty-state checks before mutating branches, clone paths, or deleting a repo.
- Install (see below), then run
rulemto launch the interactive UI. - Add or select a repository, use the main menu to save/import rules, or open the settings menu to edit metadata.
- Run
rulem mcpto expose your rule files as MCP tools for connected IDEs/assistants. - When developing,
go test ./...andgo run ./cmd/rulemare the canonical verification/build loops (seehacking.mdfor more).
- Homebrew (macOS):
brew tap muhammadbassiony/rulem && brew install rulem - Snap/Linux:
sudo snap install rulem - Binary: Download the latest release from GitHub Releases
- Source:
git clone https://github.com/muhammadbassiony/rulem && go build -o rulem ./cmd/rulem
Config lives at ~/.config/rulem/config.yaml. The CLI initializes it on first run and exposes it through the TUI settings menu (storage paths, version info, timestamps). Refer to the settings menu flows in internal/tui/settingsmenu when adjusting how multiple repositories are handled simultaneously.
- Start the MCP server with
rulem mcp(add--debugfor verbose logging). - Rule files with YAML frontmatter are auto-registered as MCP tools; each repo contributes tools that share the stored PAT/token.
- Use MCP inspectors (e.g.,
mcp-inspector) to confirm tool registration and invocation flows.
- Prereqs: Go 1.24+. Task is optional (
task build/test/lint). - Common commands:
go mod tidy,go test ./...,go build ./cmd/rulem,go run ./cmd/rulem. - Testing note: Tests that mutate config must call
helpers.SetTestConfigPath(t)to avoid touching your real settings. - Code layout: Core logic lives under
cmd/rulem,internal/(config, filemanager, logging, tui), andpkg/fileops. The settings menu and its multi-repo flows are documented ininternal/tui/settingsmenu/README.mdandhacking.md.