{"id":31580995,"url":"https://github.com/nikuscs/glooit","last_synced_at":"2026-02-15T22:18:57.044Z","repository":{"id":316325602,"uuid":"1062725245","full_name":"nikuscs/glooit","owner":"nikuscs","description":"🧴glooit keeps your AI agent rules, MCP, Skills \u0026 Commands configurations in perfect sync across Claude Code, Cursor, Roo Code, and other AI development tools.","archived":false,"fork":false,"pushed_at":"2026-01-18T18:32:20.000Z","size":239,"stargazers_count":18,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-30T03:48:06.068Z","etag":null,"topics":["ai","ai-agents","ai-tools","claude-code","codex","cursor","cursor-ai","roocode"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nikuscs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-23T16:31:35.000Z","updated_at":"2026-01-23T07:46:31.000Z","dependencies_parsed_at":"2025-09-24T01:05:53.591Z","dependency_job_id":"f71152bf-d0f4-411d-8cf2-77930b0e2211","html_url":"https://github.com/nikuscs/glooit","commit_stats":null,"previous_names":["nikuscs/glooit"],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/nikuscs/glooit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikuscs%2Fglooit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikuscs%2Fglooit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikuscs%2Fglooit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikuscs%2Fglooit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nikuscs","download_url":"https://codeload.github.com/nikuscs/glooit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikuscs%2Fglooit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29489314,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-15T19:29:10.908Z","status":"ssl_error","status_checked_at":"2026-02-15T19:29:10.419Z","response_time":118,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","ai-agents","ai-tools","claude-code","codex","cursor","cursor-ai","roocode"],"created_at":"2025-10-05T21:51:56.082Z","updated_at":"2026-02-15T22:18:57.038Z","avatar_url":"https://github.com/nikuscs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# glooit 🧴\n\nSync AI coding assistant configurations across Claude Code, Cursor, Codex, OpenCode, and Roo Code/Cline.\n\n- **Rules** - Agent instructions and guidelines\n- **Commands** - Custom slash commands\n- **Skills** - Reusable agent capabilities\n- **Agents** - Custom agent definitions\n- **MCP Servers** - Model Context Protocol configurations\n- **Agent Hooks** - Lifecycle hooks for Claude Code and Cursor\n- **Settings Merge** - Merge shared env/permissions into provider-native settings files\n\n## Why glooit?\n\nTeams today use different AI coding assistants - some prefer Claude Code, others use Cursor, OpenCode, and CI/CD might run on Codex. Each tool has its own config format and location:\n\n- Claude Code reads `CLAUDE.md`, commands in `.claude/commands/`, skills in `.claude/skills/`\n- Cursor uses `.cursor/rules/*.mdc` with frontmatter, commands in `.cursor/commands/`\n- OpenCode expects `AGENTS.md`, commands in `.opencode/command/`, agents in `.opencode/agent/`\n- Codex expects `AGENTS.md`\n- Roo Code/Cline looks in `.roo/rules/`\n\n**glooit** lets you write your rules once and sync them everywhere. Perfect for:\n\n- **Multi-agent teams** - Everyone uses their preferred AI assistant with consistent rules\n- **Monorepos** - Different rules for different packages, all managed centrally\n- **CI/CD pipelines** - Same rules in development and automation\n- **Evolving tooling** - Switch or add AI assistants without rewriting configs\n\n## Install\n\n```bash\n# Homebrew (macOS/Linux)\nbrew tap nikuscs/glooit https://github.com/nikuscs/glooit\nbrew install glooit\n\n# npm\nnpm install -g glooit\n\n# bun\nbun install -g glooit\n\n# pnpm\npnpm install -g glooit\n```\n\n## Quick Start\n\n```bash\nglooit init              # Create config\nglooit sync              # Sync rules to all agents\n```\n\n## Configuration\n\nCreate `.agents/main.md` with your rules, then configure `glooit.config.ts`:\n\n\u003e Legacy support: `.glooit` is still supported. If `configDir` is not set, glooit will use `.agents` when present, otherwise it falls back to `.glooit`.\n\n```typescript\nimport { defineRules } from 'glooit';\n\nexport default defineRules({\n  rules: [\n    {\n      file: '.agents/main.md',\n      to: './',\n      targets: ['claude', 'cursor', 'codex']\n    }\n  ]\n});\n```\n\nRun `glooit sync` (or `bunx glooit sync` / `npx glooit sync`) and it creates:\n\n- `CLAUDE.md` for Claude Code\n- `.cursor/rules/main.mdc` for Cursor\n- `AGENTS.md` for Codex\n\n## Supported Agents\n\n| Agent | Output Path | Format |\n|-------|-------------|--------|\n| `claude` | `CLAUDE.md` | Markdown |\n| `cursor` | `.cursor/rules/{name}.mdc` | Frontmatter |\n| `codex` | `AGENTS.md` | Markdown |\n| `opencode` | `AGENTS.md` | Markdown |\n| `factory` | `AGENTS.md` | Markdown |\n| `roocode` | `.roo/rules/{name}.md` | Markdown |\n| `generic` | `{name}.md` | Markdown |\n\n### Feature Support Matrix\n\n| Feature     | Claude | Cursor | OpenCode | Codex | Factory | Roo Code/Cline | Generic |\n|-------------|--------|--------|----------|-------|---------|----------------|---------|\n| Rules       | ✓      | ✓      | ✓        | ✓     | ✓       | ✓              | ✓       |\n| Commands    | ✓      | ✓      | ✓        | ✓*    | -       | -              | -       |\n| Skills      | ✓      | ✓      | ✓**      | ✓     | ✓       | -              | -       |\n| Agents      | ✓      | ✓      | ✓        | -     | ✓***    | -              | -       |\n| MCP Servers | ✓      | ✓      | ✓        | ✓     | ✓       | ✓              | ✓       |\n| Hooks       | ✓      | ✓      | -        | -     | ✓       | -              | -       |\n| Settings    | ✓      | ✓      | ✓        | ✓     | -       | -              | -       |\n\n*Codex uses `.codex/prompts` for commands\n**OpenCode uses Claude-compatible skills path (`.claude/skills/`)\n***Factory uses \"droids\" (`.factory/droids/`) for agents\n\n## Features\n\n### Custom Paths\n\nOverride output locations per-agent:\n\n```typescript\n{\n  file: '.agents/backend.md',\n  to: './',\n  targets: [\n    'claude',\n    { name: 'cursor', to: './backend/.cursor/rules/api.mdc' }\n  ]\n}\n```\n\n### Directory Sync\n\nSync commands, skills, and agents directories at the top level:\n\n```typescript\nexport default defineRules({\n  rules: [...],\n\n  // Simple string path (defaults to claude, cursor, opencode)\n  commands: '.agents/commands',\n\n  // Or with explicit targets\n  skills: {\n    path: '.agents/skills',\n    targets: ['claude']\n  },\n\n  agents: {\n    path: '.agents/agents',\n    targets: ['claude', 'cursor']\n  }\n});\n```\n\nOutput mappings:\n\n- `commands` → `.claude/commands`, `.cursor/commands`, `.opencode/command`, `.codex/prompts`\n- `skills` → `.claude/skills`, `.cursor/skills`, `.codex/skills`, `.factory/skills` (OpenCode uses `.claude/skills`)\n- `agents` → `.claude/agents`, `.cursor/agents`, `.opencode/agent`, `.factory/droids`\n\n### Symlink Mode\n\nUse symlinks instead of copying. This keeps your source of truth in `.agents` and updates targets instantly.\n\n```typescript\nexport default defineRules({\n  mode: 'symlink', // or 'copy'\n  rules: [\n    {\n      file: '.agents/main.md',\n      to: './',\n      targets: ['claude', 'cursor']\n    },\n    {\n      file: '.agents/codex.md',\n      to: './',\n      mode: 'copy', // per-rule override\n      targets: ['codex']\n    }\n  ]\n});\n```\n\n**Why use symlink mode?**\n\n- Changes to source files instantly reflect in all agent configs (no need to run `glooit sync`)\n- Single source of truth - edit once, all agents see the update\n- Useful for rapid iteration and development\n\n**Limitations:**\nSymlinks point directly to source files, so transformations cannot be applied:\n\n- Per-rule hooks and global transforms are skipped (hooks/transforms would modify the source file)\n- Merge rules (`file: string[]`) automatically fall back to copy mode (cannot symlink to multiple files)\n- Agent-specific formatting is not applied (each agent would need a different version)\n\nWhen limitations apply, glooit shows a warning and provides guidance. Use `glooit unlink` to convert symlinks back to regular files.\n\n### File Merging\n\nCombine multiple files into one output:\n\n```typescript\n{\n  file: [\n    '.agents/coding-standards.md',\n    '.agents/testing-guidelines.md'\n  ],\n  to: './',\n  targets: [\n    { name: 'claude', to: './GUIDELINES.md' }\n  ]\n}\n```\n\n### Globs (Cursor)\n\nLimit rule scope to specific files:\n\n```typescript\n{\n  file: '.agents/frontend.md',\n  to: './apps/frontend',\n  globs: 'src/**/*.{ts,tsx}',\n  targets: ['cursor']\n}\n```\n\n### Transforms\n\nTransform content during sync using placeholders in your source files.\n\n**Source file** (`.agents/main.md`):\n\n```markdown\n# Project Guidelines\n\nLast updated: __TIMESTAMP__\n\n## Project Structure\n\n__STRUCTURE__\n\n## Environment\n\n- Node version: __NODE_VERSION__\n- API URL: __API_URL__\n```\n\n**Config** (`glooit.config.ts`):\n\n```typescript\nimport { defineRules, transforms } from 'glooit';\n\nexport default defineRules({\n  rules: [\n    {\n      file: '.agents/main.md',\n      to: './',\n      targets: ['claude'],\n      hooks: ['replaceStructure', 'addTimestamp', 'replaceEnv']\n    }\n  ],\n  transforms: {\n    after: [transforms.compact({ removeFillerWords: true })]\n  }\n});\n```\n\n**Built-in transforms:**\n\n| Transform | Placeholder | Description |\n|-----------|-------------|-------------|\n| `addTimestamp` | `__TIMESTAMP__` | Replaced with current date/time |\n| `replaceEnv` | `__ENV_VAR__` | Replaced with `process.env.ENV_VAR` value |\n| `replaceStructure` | `__STRUCTURE__` | Replaced with project directory tree |\n| `compact` | - | Cleans up markdown (removes filler words, extra newlines) |\n\n**Usage:**\n\n- Per-rule transforms: Add `hooks: ['transformName']` to individual rules\n- Global transforms: Add to `transforms.after` array to run on all rules\n\n### Agent Hooks\n\nConfigure lifecycle hooks that run inside Claude Code and Cursor when the AI uses tools.\n\n```typescript\nexport default defineRules({\n  rules: [...],\n  hooks: [\n    // Run prettier after file edits\n    {\n      event: 'afterFileEdit',\n      command: 'npx prettier --write',\n      targets: ['claude', 'cursor']\n    },\n\n    // Run a TypeScript script before shell commands\n    {\n      event: 'beforeShellExecution',\n      script: '.agents/hooks/check-command.ts',\n      targets: ['claude']\n    },\n\n    // Block writes to sensitive files\n    {\n      event: 'PreToolUse',\n      script: '.agents/hooks/block-env-writes.ts',\n      matcher: 'Edit|Write',  // Claude Code matcher\n      targets: ['claude']\n    }\n  ]\n});\n```\n\n**Supported events:**\n\n| Event | Claude Code | Cursor | Description |\n|-------|-------------|--------|-------------|\n| `PreToolUse` | ✓ | - | Before tool execution (can block) |\n| `PostToolUse` | ✓ | - | After tool completion |\n| `beforeShellExecution` | ✓ | ✓ | Before shell commands |\n| `afterFileEdit` | ✓ | ✓ | After file modifications |\n| `Stop` | ✓ | ✓ | When agent finishes |\n\n**Script types:**\n\n- `.ts` files: Run with `bun run`\n- `.js` files: Run with `node`\n- `.sh` files: Run directly\n\n### Settings Merge\n\nMerge shared settings into provider-native settings files:\n\n```typescript\nexport default defineRules({\n  rules: [...],\n  settings: {\n    targets: ['claude', 'cursor', 'codex', 'opencode'],\n    env: ['GEMINI_API_KEY', 'OPENAI_API_KEY'],\n    envFiles: ['.env.agents', '.env.local', '.env'], // optional (default order shown)\n    permissions: {\n      allow: ['Read', 'Grep']\n    },\n    merge: true // optional; defaults to true\n  }\n});\n```\n\nResolution and precedence rules:\n\n- `merge` defaults to `true` (set `merge: false` to overwrite instead of merge).\n- `envFiles` is optional; default lookup is `['.env.agents', '.env.local', '.env']`.\n- For each key in `settings.env`, the first matching file in `envFiles` order wins.\n- `.env.agents` is checked first, giving you a dedicated file for agent-specific secrets.\n- If a key is not found in any env file, `process.env` is used as a fallback (useful for CI and shell-exported vars).\n- Safety guard: if env values would be written to git-tracked settings files (for `claude`/`codex`), sync fails with a warning to prevent committing secrets.\n\nDefault settings output files:\n\n- `claude` → `.claude/settings.local.json`\n- `cursor` → `.cursor/cli.json`\n- `codex` → `.codex/config.toml`\n- `opencode` → `opencode.json`\n\n### MCP Configuration\n\nConfigure Model Context Protocol servers:\n\n```typescript\nexport default defineRules({\n  rules: [...],\n  mcps: [\n    {\n      name: 'postgres',\n      config: {\n        command: 'uvx',\n        args: ['mcp-server-postgres'],\n        env: { DATABASE_URL: process.env.DATABASE_URL }\n      },\n      targets: ['claude', 'cursor']\n    }\n  ]\n});\n```\n\n### Backup\n\nAutomatic backups before sync:\n\n```typescript\nexport default defineRules({\n  rules: [...],\n  backup: {\n    enabled: true,\n    retention: 10\n  }\n});\n```\n\n## Commands\n\n```bash\nglooit init              # Initialize configuration\nglooit sync              # Sync rules and MCPs\nglooit link              # Zero-config symlink sync (no config file needed)\nglooit unlink            # Replace symlinked outputs with real files\nglooit validate          # Validate configuration\nglooit clean             # Clean .gitignore entries\nglooit reset --force     # Remove all generated files\nglooit upgrade           # Upgrade glooit to latest version\nglooit backup list       # List available backups\nglooit backup restore \u003ctimestamp\u003e  # Restore from backup\n```\n\n### Link Command\n\nThe `link` command provides zero-config symlink-based syncing without requiring a config file:\n\n```bash\nglooit link              # Auto-detect .agents/ or .glooit/ and sync to all agents\nglooit link .my-rules    # Use custom source directory\nglooit link -t claude,cursor  # Sync to specific agents only\n```\n\nIt automatically discovers and symlinks:\n\n- `CLAUDE.md` → Claude Code\n- `AGENTS.md` → Codex, OpenCode, Factory\n- `commands/` → All agents that support commands\n- `skills/` → All agents that support skills\n- `agents/` → All agents that support agents/droids\n\n### Upgrade\n\nThe `upgrade` command auto-detects your package manager and whether glooit is installed locally or globally:\n\n```bash\nglooit upgrade           # Auto-detect and upgrade\nglooit upgrade -g        # Force global upgrade\nglooit upgrade -l        # Force local upgrade\n```\n\nAll commands work with `npx`, `bunx`, or `pnpx`:\n\n```bash\nnpx glooit sync\nbunx glooit sync\npnpx glooit sync\n```\n\n## Examples\n\nSee [examples/full.config.ts](examples/full.config.ts) for a complete configuration with all features.\n\n## Development\n\n```bash\n# Install dependencies\nbun install\n\n# Run tests\nbun run test\n\n# Type check and lint\nbun run check\n\n# Build\nbun run build\n\n# Build local binary\nbun run install:local\n```\n\n### Releasing\n\n```bash\nbun run release\n```\n\nThis runs checks, prompts for version bump, creates a git tag, and pushes. CI handles npm publish and GitHub release automatically.\n\n## Credits\n\nWithout these amazing projects, this project would not be possible.\n\n- [Antfu](https://antfu.me) for the amazing packages\n- [Ruler](https://github.com/intellectronica/ruler) Inspiration for the project \u0026 ideas\n- [Claude](https://claude.ai) for the amazing AI that made this project possible in a few hours.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikuscs%2Fglooit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnikuscs%2Fglooit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikuscs%2Fglooit/lists"}