{"_id":"@codehabits/cli","_rev":"4-666c32dbad9e43d666cb15d44645798a","name":"@codehabits/cli","dist-tags":{"latest":"0.2.5"},"versions":{"0.2.2":{"name":"@codehabits/cli","version":"0.2.2","keywords":["ai","code-review","conventions","cursor","agent-skill","mcp","cli","team-intelligence"],"license":"MIT","_id":"@codehabits/cli@0.2.2","maintainers":[{"name":"sriramfullstack","email":"thefrontendarchitect@gmail.com"}],"homepage":"https://codehabits.dev","bugs":{"url":"https://github.com/codehabits-dev/codehabits/issues"},"bin":{"codehabits":"dist/bin/codehabits.js"},"dist":{"shasum":"9ead6c6d9bd2c7a38f529187145a1159a8c0952c","tarball":"https://registry.npmjs.org/@codehabits/cli/-/cli-0.2.2.tgz","fileCount":11,"integrity":"sha512-I8lVd16oc8y54bROigERxuy4qVIucWq6+sasAkeNHtgN3dnXXrMt+HzBnq2zHI5frNKGE+vwW7j8Fl3raqqv5w==","signatures":[{"sig":"MEUCIQC+n6KiCGV9ZZKxtr62op/f8nqvueaauixZ5WtVjQfZgwIgPaZo93JjzPxvgObQL13JGBEh96XJEYduyQEspReyzfg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":684099},"type":"module","_from":"file:codehabits-cli-0.2.2.tgz","engines":{"node":">=20"},"exports":{".":"./dist/src/index.js","./mcp-proposals":"./dist/src/intelligence/mcp-proposals.js"},"scripts":{"dev":"tsup --watch","build":"tsup","clean":"rm -rf dist","type-check":"tsc --noEmit"},"_npmUser":{"name":"sriramfullstack","email":"thefrontendarchitect@gmail.com"},"_resolved":"/private/var/folders/r6/9gsbygsd14n5cd86bk1wfffw0000gn/T/3a5623463905f6b5a31f9a94857ea73e/codehabits-cli-0.2.2.tgz","_integrity":"sha512-I8lVd16oc8y54bROigERxuy4qVIucWq6+sasAkeNHtgN3dnXXrMt+HzBnq2zHI5frNKGE+vwW7j8Fl3raqqv5w==","repository":{"url":"git+https://github.com/codehabits-dev/codehabits.git","type":"git","directory":"packages/cli"},"_npmVersion":"10.8.2","description":"Team intelligence for AI coding agents. Extract conventions, anti-patterns, and domain knowledge from your codebase and PR history.","directories":{},"_nodeVersion":"20.10.0","dependencies":{"ora":"^9.3.0","conf":"^15.1.0","open":"^11.0.0","chalk":"^5.6.2","commander":"^14.0.3","posthog-node":"^5.24.17","@octokit/rest":"^22.0.1"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","typescript":"^5","@types/node":"^22","@codehabits/shared":"0.1.0"},"_npmOperationalInternal":{"tmp":"tmp/cli_0.2.2_1776562380518_0.747429216653094","host":"s3://npm-registry-packages-npm-production"}},"0.2.3":{"name":"@codehabits/cli","version":"0.2.3","keywords":["ai","code-review","conventions","cursor","claude-code","copilot","agent-skills","agents-md","github","pull-requests","mcp","cli","team-intelligence","codehabits"],"license":"MIT","_id":"@codehabits/cli@0.2.3","maintainers":[{"name":"sriramfullstack","email":"thefrontendarchitect@gmail.com"}],"homepage":"https://codehabits.dev","bugs":{"url":"https://github.com/codehabits-dev/codehabits/issues"},"bin":{"codehabits":"dist/bin/codehabits.js"},"dist":{"shasum":"65e26f430c65882b20e1670cdfed1654c70408b3","tarball":"https://registry.npmjs.org/@codehabits/cli/-/cli-0.2.3.tgz","fileCount":11,"integrity":"sha512-66NUZX4YFSuyZZ6197bgVAsAl6nmh4NYMlcjvT6pRBaaC4qOM24vg3vKwzoMufVEX1jIth51NrczlGwfD7e2dQ==","signatures":[{"sig":"MEUCIHEHjLH9hJpJiAdRZoeNI3CNvLpm9FmB9Dr2yA4NuigFAiEAzycl+N0EawCD/Q8ZxOeBaCmVm+gPgsyFtMi19utGGZ8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":703016},"type":"module","_from":"file:codehabits-cli-0.2.3.tgz","engines":{"node":">=20"},"exports":{".":"./dist/src/index.js","./mcp-proposals":"./dist/src/intelligence/mcp-proposals.js"},"scripts":{"dev":"tsup --watch","build":"tsup","clean":"rm -rf dist","type-check":"tsc --noEmit"},"_npmUser":{"name":"sriramfullstack","email":"thefrontendarchitect@gmail.com"},"_resolved":"/private/var/folders/r6/9gsbygsd14n5cd86bk1wfffw0000gn/T/20fae49cafa1fe5419da70ef6abcbed0/codehabits-cli-0.2.3.tgz","_integrity":"sha512-66NUZX4YFSuyZZ6197bgVAsAl6nmh4NYMlcjvT6pRBaaC4qOM24vg3vKwzoMufVEX1jIth51NrczlGwfD7e2dQ==","repository":{"url":"git+https://github.com/codehabits-dev/codehabits.git","type":"git","directory":"packages/cli"},"_npmVersion":"10.8.2","description":"CLI for codehabits: analyze GitHub PRs and your codebase, then generate AGENTS.md, Agent Skills, and .codehabits/ team intelligence for Cursor, Claude Code, and Copilot.","directories":{},"_nodeVersion":"20.10.0","dependencies":{"ora":"^9.3.0","conf":"^15.1.0","open":"^11.0.0","chalk":"^5.6.2","commander":"^14.0.3","posthog-node":"^5.24.17","@octokit/rest":"^22.0.1","@clack/prompts":"^0.10.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","typescript":"^5","@types/node":"^22","@codehabits/shared":"0.1.0"},"_npmOperationalInternal":{"tmp":"tmp/cli_0.2.3_1778953584692_0.7323737434497566","host":"s3://npm-registry-packages-npm-production"}},"0.2.4":{"name":"@codehabits/cli","version":"0.2.4","keywords":["ai","code-review","conventions","cursor","claude-code","copilot","agent-skills","agents-md","github","pull-requests","mcp","cli","team-intelligence","codehabits"],"license":"MIT","_id":"@codehabits/cli@0.2.4","maintainers":[{"name":"sriramfullstack","email":"thefrontendarchitect@gmail.com"}],"homepage":"https://codehabits.dev","bugs":{"url":"https://github.com/codehabits-dev/codehabits/issues"},"bin":{"codehabits":"dist/bin/codehabits.js"},"dist":{"shasum":"b837a9e16331129c4035ea4ef0ba98f4d02babdc","tarball":"https://registry.npmjs.org/@codehabits/cli/-/cli-0.2.4.tgz","fileCount":11,"integrity":"sha512-7an4lw3xnwixwsfWsPH+Z5pxMCsd0+mFWzvLm5KRrKkouvtkKojBNH2dFos4YHbpmsZuo8fwtHESiCPdOZ5P/w==","signatures":[{"sig":"MEQCIElPwJ8R73N1zf5+Dgxuj3OeBVZrcljQBvW+9tIJQRWfAiA2Z6I9UBl+5X+Mkms6SOFb+Zzr3i7kyqkuD/nNLr/IsQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":713797},"type":"module","engines":{"node":">=20"},"exports":{".":"./dist/src/index.js","./mcp-proposals":"./dist/src/intelligence/mcp-proposals.js"},"gitHead":"1602358880137b99b4e767b5ea144165e92ebcc8","scripts":{"dev":"tsup --watch","build":"tsup","clean":"rm -rf dist","type-check":"tsc --noEmit"},"_npmUser":{"name":"sriramfullstack","email":"thefrontendarchitect@gmail.com"},"repository":{"url":"git+https://github.com/codehabits-dev/codehabits.git","type":"git","directory":"packages/cli"},"_npmVersion":"10.9.8","description":"CLI for codehabits: analyze GitHub PRs and your codebase, then generate AGENTS.md, Agent Skills, and .codehabits/ team intelligence for Cursor, Claude Code, and Copilot.","directories":{},"_nodeVersion":"22.22.3","dependencies":{"ora":"^9.3.0","conf":"^15.1.0","open":"^11.0.0","chalk":"^5.6.2","commander":"^14.0.3","posthog-node":"^5.24.17","@octokit/rest":"^22.0.1","@clack/prompts":"^0.10.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","typescript":"^5","@types/node":"^22","@codehabits/shared":"workspace:*"},"_npmOperationalInternal":{"tmp":"tmp/cli_0.2.4_1785377922554_0.45059957248330584","host":"s3://npm-registry-packages-npm-production"}},"0.2.5":{"_id":"@codehabits/cli@0.2.5","bin":{"codehabits":"dist/bin/codehabits.js"},"bugs":{"url":"https://github.com/codehabits-dev/codehabits/issues"},"dist":{"shasum":"fa0fb429c7be4cc59209106c5bdc1ddb8f97ed32","tarball":"https://registry.npmjs.org/@codehabits/cli/-/cli-0.2.5.tgz","fileCount":14,"integrity":"sha512-VgwERK7Uw9JH4XMgqi8EsIC/Hr5vA8Bdlih7pqvi3p6/h7UMpRb8L2lCr85ZeNoNtoZ1cTT4I53rBv++z16wXg==","signatures":[{"sig":"MEUCIDhw4CcNH/KnhndtF2vPVrYbCWzVg1cZr7Htz/8yJilYAiEAzG41oHoIF1gNYkI3wZdc5sYx+4k8NWLU7YtWxAZAVcc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIFv4Pi1X3bfiLZTJJL5wR8VcKhFl6t1oJa0EzbQyG/tbAiBlLvJnvydNXiAkhhnfO3csZcjz9DRqipp30fuJ5FnHWQ=="}],"unpackedSize":719707},"name":"@codehabits/cli","type":"module","_from":"file:codehabits-cli-0.2.5.tgz","engines":{"node":">=20"},"exports":{".":"./dist/src/index.js","./telemetry":"./dist/src/telemetry/index.js","./mcp-proposals":"./dist/src/intelligence/mcp-proposals.js"},"license":"MIT","scripts":{"dev":"tsup --watch","build":"tsup","clean":"rm -rf dist","type-check":"tsc --noEmit"},"version":"0.2.5","_npmUser":{"name":"sriramfullstack","email":"thefrontendarchitect@gmail.com"},"homepage":"https://codehabits.dev","keywords":["ai","code-review","conventions","cursor","claude-code","copilot","agent-skills","agents-md","github","pull-requests","mcp","cli","team-intelligence","codehabits"],"_resolved":"/private/var/folders/r6/9gsbygsd14n5cd86bk1wfffw0000gn/T/8322d31e3df5d900fecda86ef45fa55d/codehabits-cli-0.2.5.tgz","_integrity":"sha512-VgwERK7Uw9JH4XMgqi8EsIC/Hr5vA8Bdlih7pqvi3p6/h7UMpRb8L2lCr85ZeNoNtoZ1cTT4I53rBv++z16wXg==","repository":{"url":"git+https://github.com/codehabits-dev/codehabits.git","type":"git","directory":"packages/cli"},"_npmVersion":"10.9.8","description":"CLI for codehabits: analyze GitHub PRs and your codebase, then generate AGENTS.md, Agent Skills, and .codehabits/ team intelligence for Cursor, Claude Code, and Copilot.","directories":{},"maintainers":[{"name":"sriramfullstack","email":"thefrontendarchitect@gmail.com"}],"_nodeVersion":"22.22.3","dependencies":{"ora":"^9.3.0","conf":"^15.1.0","open":"^11.0.0","chalk":"^5.6.2","commander":"^14.0.3","posthog-node":"^5.24.17","@octokit/rest":"^22.0.1","@clack/prompts":"^0.10.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","typescript":"^5","@types/node":"^22","@codehabits/shared":"0.1.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/cli_0.2.5_1789225774618_0.8976140095691882"}}},"time":{"created":"2026-04-19T01:33:00.394Z","modified":"2026-09-12T15:09:34.880Z","0.2.2":"2026-04-19T01:33:00.688Z","0.2.3":"2026-05-16T17:46:24.846Z","0.2.4":"2026-07-30T02:18:42.694Z","0.2.5":"2026-09-12T15:09:34.719Z"},"bugs":{"url":"https://github.com/codehabits-dev/codehabits/issues"},"license":"MIT","homepage":"https://codehabits.dev","keywords":["ai","code-review","conventions","cursor","claude-code","copilot","agent-skills","agents-md","github","pull-requests","mcp","cli","team-intelligence","codehabits"],"repository":{"url":"git+https://github.com/codehabits-dev/codehabits.git","type":"git","directory":"packages/cli"},"description":"CLI for codehabits: analyze GitHub PRs and your codebase, then generate AGENTS.md, Agent Skills, and .codehabits/ team intelligence for Cursor, Claude Code, and Copilot.","maintainers":[{"name":"sriramfullstack","email":"thefrontendarchitect@gmail.com"}],"readme":"# @codehabits/cli\n\n[![npm version](https://img.shields.io/npm/v/@codehabits/cli.svg)](https://www.npmjs.com/package/@codehabits/cli)\n[![license](https://img.shields.io/npm/l/@codehabits/cli.svg)](https://github.com/codehabits-dev/codehabits/blob/main/LICENSE)\n\n**Team intelligence for AI coding agents.** Extract conventions, anti-patterns, and domain knowledge from your codebase and pull-request history, then deliver it to **Cursor**, **Claude Code**, **VS Code Copilot**, and other agents.\n\n- **Website:** [codehabits.dev](https://codehabits.dev)\n- **Docs:** [codehabits.dev/docs](https://codehabits.dev/docs)\n- **MCP server (IDE tools):** [@codehabits/mcp](https://www.npmjs.com/package/@codehabits/mcp)\n\n---\n\n## Why codehabits?\n\nGeneric AI assistants do not know how *your* team writes code. codehabits analyzes your repository and merged PRs, then writes structured intelligence your agents can load automatically, without manual rule files to maintain.\n\n| You get | From |\n| --- | --- |\n| Coding conventions & anti-patterns | PR review comments + codebase scan |\n| Domain knowledge graph | Repeated patterns across PRs |\n| Reviewer expertise map | Who owns which areas |\n| Agent-ready outputs | `AGENTS.md`, Agent Skills, optional MCP tools |\n\n**Requires:** Node.js 20+, a GitHub repository, and a free [codehabits](https://codehabits.dev) account (`codehabits login`).\n\n---\n\n## Quick start\n\n```bash\nnpx @codehabits/cli login\nnpx @codehabits/cli enable\n```\n\nTypical flow:\n\n1. **Register** the repo with codehabits (GitHub OAuth).\n2. **Scan** the codebase and **fetch** PR history.\n3. **Analyze** patterns with AI (cloud).\n4. **Write** `.codehabits/` intelligence, then `AGENTS.md` and skill files for your agents.\n\nCheck everything with:\n\n```bash\nnpx @codehabits/cli status\n```\n\nOptional: give agents **live** access to conventions in the IDE:\n\n```bash\nnpx @codehabits/cli mcp-install\n```\n\nSee [@codehabits/mcp](https://www.npmjs.com/package/@codehabits/mcp) for MCP tool details.\n\n---\n\n## What gets generated\n\nCommitted to your repo (safe to review in PR):\n\n| Output | Purpose |\n| --- | --- |\n| `.codehabits/conventions.json` | Team coding rules |\n| `.codehabits/anti-patterns.json` | Patterns to avoid |\n| `.codehabits/knowledge.json` | Domain topics & facts |\n| `.codehabits/reviewers.json` | Expertise by path/area |\n| `.codehabits/meta.json` | Maturity, sync metadata |\n| `.codehabits/config.json` | Lookback, ignores, `emit_targets` (editable) |\n| `AGENTS.md` | Universal entry point for agents that read it |\n| `.claude/skills/codehabits-team-intel/` | Agent Skill (Claude Code; **Cursor** discovers this path) |\n| `.agents/skills/codehabits-team-intel/` | Cross-client skill layout (VS Code Copilot, installers) |\n\n**Not committed** (local / MCP workflow only):\n\n| Output | Purpose |\n| --- | --- |\n| `.codehabits/proposals.json` | Draft convention changes from MCP `record_feedback` |\n\nAfter enable, commit the tracked files and open a PR so the team adopts the intelligence together.\n\n---\n\n## Multi-tool agent outputs\n\nBy default, `enable` writes **three** emit targets: `agents-md`, `claude-skills`, and `agents-skills`.\n\n```bash\n# Non-interactive defaults (CI-friendly)\nnpx @codehabits/cli enable -y --team your-team-slug\n\n# Pick outputs interactively (after analysis completes)\nnpx @codehabits/cli enable --configure-targets\n\n# Explicit CSV\nnpx @codehabits/cli enable --targets agents-md,claude-skills,agents-skills\n\n# Legacy Cursor-only skill path (optional)\nnpx @codehabits/cli enable --targets agents-md,cursor-skills\n```\n\nChange targets later in `.codehabits/config.json` (`emit_targets`) and re-run `sync`, or run `enable --configure-targets` again.\n\n---\n\n## Commands\n\n| Command | Description |\n| --- | --- |\n| `codehabits login` | Sign in with GitHub OAuth |\n| `codehabits logout` | Clear stored credentials |\n| `codehabits whoami` | Show current user |\n| `codehabits enable` | Full setup: register, analyze, write intelligence & agent files |\n| `codehabits sync` | Incremental update from latest PRs (merges with cloud) |\n| `codehabits status` | Auth, intelligence, config, emit targets, MCP wiring |\n| `codehabits show <type>` | Print `conventions`, `anti-patterns`, `knowledge`, or `reviewers` |\n| `codehabits check <file>` | Validate a file against team conventions |\n| `codehabits mcp-install` | Add `@codehabits/mcp` to Cursor MCP config |\n| `codehabits setup-action` | Scaffold GitHub Actions workflow for auto-sync |\n| `codehabits token create` | Create API token for CI (`--name` required) |\n| `codehabits team assign` | Assign current repo to a team workspace |\n\n### `enable` options\n\n| Flag | Description |\n| --- | --- |\n| `--path <dir>` | Repository path (default `.`) |\n| `--skip-prs` | Local codebase scan only (no PR fetch) |\n| `--team <ref>` | Team id or slug (required for **org** repos in CI) |\n| `--personal` | Leave repo unassigned (user-owned repos only) |\n| `--targets <csv>` | `agents-md`, `claude-skills`, `agents-skills`, `cursor-skills` |\n| `-y, --yes` | Non-interactive; default emit targets |\n| `--configure-targets` | Multiselect agent outputs after analysis |\n\n### Organization repositories\n\nRepos under a **GitHub organization** must be assigned to a **team workspace** on first enable:\n\n- Interactive: `codehabits enable` prompts for a team.\n- Non-interactive: `codehabits enable --team <team-id-or-slug>`.\n- `--personal` is only for user-owned repositories.\n\n---\n\n## CI/CD\n\n**Ongoing sync** (repo already enabled; run on merge to `main`):\n\n```yaml\n- name: Sync codehabits intelligence\n  run: npx @codehabits/cli@latest sync --ci\n  env:\n    CODEHABITS_TOKEN: ${{ secrets.CODEHABITS_TOKEN }}\n    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n```\n\nCreate a token once:\n\n```bash\nnpx @codehabits/cli token create --name \"GitHub Actions\"\n```\n\nAdd the secret as `CODEHABITS_TOKEN` in the repository.\n\n**First-time enable in CI** (organization repo):\n\n```bash\nnpx @codehabits/cli@latest enable -y --team your-team-slug\n```\n\n`setup-action` can generate a workflow stub:\n\n```bash\nnpx @codehabits/cli setup-action\n```\n\n---\n\n## Install globally\n\n```bash\nnpm install -g @codehabits/cli\ncodehabits enable\n```\n\nGlobal install uses the `codehabits` command (not `npx @codehabits/cli`).\n\n---\n\n## How it fits together\n\n```mermaid\nflowchart LR\n  subgraph cli [\"@codehabits/cli\"]\n    login[login]\n    enable[enable / sync]\n  end\n  subgraph repo [\"Your repository\"]\n    ch[\".codehabits/*.json\"]\n    agents[AGENTS.md + skills]\n  end\n  subgraph agents_layer [\"AI tools\"]\n    cursor[Cursor]\n    claude[Claude Code]\n    copilot[VS Code Copilot]\n  end\n  subgraph mcp [\"@codehabits/mcp optional\"]\n    tools[get_team_context / check_code / ...]\n  end\n  login --> enable\n  enable --> ch\n  enable --> agents\n  ch --> cursor\n  ch --> claude\n  ch --> copilot\n  agents --> cursor\n  agents --> claude\n  agents --> copilot\n  ch --> tools\n  mcp-install[mcp-install] --> mcp\n```\n\n- **Passive context:** agents read `AGENTS.md` and skill files on their own.\n- **Active tools:** MCP server reads `.codehabits/` from the project `cwd` and exposes lookup, check, and feedback tools.\n\n---\n\n## Environment variables\n\n| Variable | Description |\n| --- | --- |\n| `CODEHABITS_TOKEN` | API token for CI (`sync --ci`) |\n| `CODEHABITS_API_URL` | API base URL (default `https://codehabits.dev`) |\n\n---\n\n## FAQ\n\n**Do I need MCP?**  \nNo. Skills and `AGENTS.md` work without MCP. MCP adds on-demand tools (`get_team_context`, `check_code`, etc.) inside supported IDEs.\n\n**Is my code sent to the cloud?**  \nEnable/sync sends codebase **signals** (patterns, stack, file stats) and PR metadata to the codehabits API for analysis, not your full source tree as a zip. See [codehabits.dev/docs](https://codehabits.dev/docs) for privacy details.\n\n**How often should we sync?**  \nAfter meaningful PR volume (e.g. weekly) or on every merge via GitHub Actions.\n\n**Can I edit conventions?**  \nEdit JSON under `.codehabits/` or use MCP `record_feedback` → `approve_proposal` for a guided workflow.\n\n---\n\n## Related packages\n\n| Package | Role |\n| --- | --- |\n| [@codehabits/mcp](https://www.npmjs.com/package/@codehabits/mcp) | Model Context Protocol server for IDE agents |\n\n---\n\n## License\n\nMIT © [codehabits](https://codehabits.dev)\n","readmeFilename":"README.md"}