@rely-ai/caliber 0.4.3 → 0.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +76 -113
  2. package/dist/bin.js +16 -2
  3. package/package.json +9 -9
package/README.md CHANGED
@@ -1,155 +1,118 @@
1
1
  # Caliber
2
2
 
3
- Open-source CLI that analyzes your project and generates optimized configuration files for AI coding agents (Claude Code, Cursor). Use your **current seat** (Claude Code Pro/Max/Team or Cursor subscription, no API key) or bring your own API key — supports Claude Code CLI (`claude -p`), Cursor (ACP), Anthropic, OpenAI, Google Vertex AI, and any OpenAI-compatible endpoint.
3
+ [![npm version](https://img.shields.io/npm/v/@rely-ai/caliber)](https://www.npmjs.com/package/@rely-ai/caliber)
4
+ [![license](https://img.shields.io/npm/l/@rely-ai/caliber)](./LICENSE)
5
+ [![node](https://img.shields.io/node/v/@rely-ai/caliber)](https://nodejs.org)
4
6
 
5
- ## Installation
7
+ **Analyze your codebase. Generate optimized AI agent configs. One command.**
6
8
 
7
- ```bash
8
- npm install -g @rely-ai/caliber
9
- ```
9
+ Caliber scans your project — languages, frameworks, dependencies, file structure — and generates tailored config files for Claude Code and Cursor. If configs already exist, it audits them and suggests improvements.
10
+
11
+ **No API key required** — use your existing Claude Code or Cursor subscription. Or bring your own key (Anthropic, OpenAI, Vertex AI, any OpenAI-compatible endpoint).
10
12
 
11
13
  ## Quick Start
12
14
 
13
15
  ```bash
14
- # Option 1: Use your current seat — no API key
15
- caliber config # choose "Claude Code" (Pro/Max/Team) or "Cursor"
16
- # Or: export CALIBER_USE_CLAUDE_CLI=1 or CALIBER_USE_CURSOR_SEAT=1
17
-
18
- # Option 2: Set an API key
19
- export ANTHROPIC_API_KEY=sk-ant-...
20
-
21
- # Then run
22
- caliber init
16
+ npx @rely-ai/caliber init
23
17
  ```
24
18
 
25
- ## What It Does
26
-
27
- Caliber scans your codebase — languages, frameworks, file structure, existing configs — and generates tailored configuration files:
28
-
29
- - **CLAUDE.md** — Project context for Claude Code (commands, architecture, conventions)
30
- - **.cursorrules** / **.cursor/rules/** — Rules for Cursor
31
- - **Skills** — Reusable skill files following the [OpenSkills](https://agentskills.io) standard
32
-
33
- If you already have these files, Caliber audits them against your actual codebase and suggests targeted improvements — keeping what works, fixing what's stale, adding what's missing.
34
-
35
- ## Commands
36
-
37
- | Command | Description |
38
- |---------|-------------|
39
- | `caliber init` | Scan project and generate agent config |
40
- | `caliber update` | Re-analyze and regenerate (alias: `regenerate`, `regen`) |
41
- | `caliber config` | Configure LLM: Cursor (your seat), API key, and model |
42
- | `caliber refresh` | Update docs based on recent git changes |
43
- | `caliber score` | Score your config quality (deterministic, no LLM). Supports `--agent claude\|cursor\|both` |
44
- | `caliber recommend` | Discover skills from [skills.sh](https://skills.sh) |
45
- | `caliber undo` | Revert all changes made by Caliber |
46
- | `caliber status` | Show current setup status |
47
- | `caliber hooks install` | Install Claude Code auto-refresh hook |
48
- | `caliber hooks remove` | Remove Claude Code auto-refresh hook |
49
- | `caliber hooks install-precommit` | Install git pre-commit hook for auto-refresh |
50
- | `caliber hooks remove-precommit` | Remove git pre-commit hook |
51
- | `caliber hooks status` | Show installed hooks |
52
- | `caliber learn install` | Install session learning hooks |
53
- | `caliber learn status` | Show learned insights from sessions |
54
- | `caliber learn observe` | Manually feed a tool event for analysis |
55
- | `caliber learn finalize` | Analyze captured events and extract patterns |
56
- | `caliber learn remove` | Remove learning hooks |
57
-
58
- ## Supported LLM Providers
59
-
60
- | Provider | How to use | Notes |
61
- |----------|------------|-------|
62
- | **Claude Code (current seat)** | `caliber config` → "Claude Code", or `CALIBER_USE_CLAUDE_CLI=1` | Uses your Pro/Max/Team login via `claude -p`. No API key; install [Claude Code CLI](https://claude.ai/install) and run `claude` once to log in. |
63
- | **Cursor (current seat)** | `caliber config` → "Cursor", or `CALIBER_USE_CURSOR_SEAT=1` | Uses your Cursor subscription via [Cursor Agent (ACP)](https://cursor.com/docs/cli/acp). No API key; run `agent login` once if needed. |
64
- | **Anthropic (Claude)** | `ANTHROPIC_API_KEY` | Claude Sonnet 4.6 default. Get an API key at [console.anthropic.com](https://console.anthropic.com) (same company as Claude Pro/Team/Max; API is separate billing). |
65
- | **Google Vertex AI** | `VERTEX_PROJECT_ID` or `GCP_PROJECT_ID` | Uses ADC by default. Region `us-east5`. Set `VERTEX_REGION`, `VERTEX_SA_CREDENTIALS` as needed. |
66
- | **OpenAI** | `OPENAI_API_KEY` | GPT-4.1 default. |
67
- | **Custom endpoint** | `OPENAI_API_KEY` + `OPENAI_BASE_URL` | Any OpenAI-compatible API (Ollama, vLLM, Together, etc.) |
68
-
69
- Override the model with `CALIBER_MODEL=<model-name>` or via `caliber config`.
19
+ That's it. On first run, Caliber walks you through provider setup interactively.
70
20
 
71
- ### Vertex AI Setup
21
+ Or install globally:
72
22
 
73
23
  ```bash
74
- # Minimal uses gcloud ADC and defaults
75
- export VERTEX_PROJECT_ID=my-gcp-project
24
+ npm install -g @rely-ai/caliber
76
25
  caliber init
26
+ ```
77
27
 
78
- # With custom region
79
- export VERTEX_PROJECT_ID=my-gcp-project
80
- export VERTEX_REGION=europe-west1
81
- caliber init
28
+ > **Already have an API key?** Skip the interactive setup:
29
+ > ```bash
30
+ > export ANTHROPIC_API_KEY=sk-ant-...
31
+ > npx @rely-ai/caliber init
32
+ > ```
82
33
 
83
- # With service account credentials (inline JSON)
84
- export VERTEX_PROJECT_ID=my-gcp-project
85
- export VERTEX_SA_CREDENTIALS='{"type":"service_account",...}'
86
- caliber init
34
+ ## How It Works
87
35
 
88
- # With service account credentials (file path via GOOGLE_APPLICATION_CREDENTIALS)
89
- export VERTEX_PROJECT_ID=my-gcp-project
90
- export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json
36
+ ```
91
37
  caliber init
38
+
39
+ ├─ 1. Scan Analyze languages, frameworks, dependencies, file structure,
40
+ │ and existing agent configs in your project
41
+
42
+ ├─ 2. Generate LLM creates tailored config files based on your codebase
43
+ │ (or audits existing ones and suggests improvements)
44
+
45
+ ├─ 3. Review You see a diff of proposed changes — accept, refine via
46
+ │ chat, or decline
47
+
48
+ └─ 4. Apply Files are written with automatic backups, before/after
49
+ score is displayed
92
50
  ```
93
51
 
94
- ## Flow: install and init
52
+ ### What It Generates
95
53
 
96
- - **Install:** `npm install -g @caliber-ai/caliber` runs the postinstall script and prints the "Get started" message. With **npx** (`npx @caliber-ai/caliber init`), there is no install step; the binary runs from cache.
97
- - **Config:** User runs `caliber config` (or sets env vars). Config is stored in `~/.caliber/config.json` or taken from `ANTHROPIC_API_KEY` / `OPENAI_API_KEY` / `VERTEX_PROJECT_ID` / `CALIBER_USE_CLAUDE_CLI` / `CALIBER_USE_CURSOR_SEAT`.
98
- - **Init:** `caliber init` calls `loadConfig()`: env vars override; if none, it reads `~/.caliber/config.json`. If no config, init prints the options and exits. Otherwise it scans the project, generates config with the chosen LLM (**Claude Code CLI**, Cursor ACP, Anthropic, OpenAI, or Vertex), then review and apply.
54
+ | File | Purpose |
55
+ |------|---------|
56
+ | `CLAUDE.md` | Project context for Claude Code commands, architecture, conventions |
57
+ | `.cursorrules` / `.cursor/rules/` | Rules for Cursor |
58
+ | Skills (`.claude/skills/`, `.cursor/skills/`) | Reusable skill files following the [OpenSkills](https://agentskills.io) standard |
59
+ | `AGENTS.md` | Agent collaboration guide |
99
60
 
100
- See [docs/FLOW.md](docs/FLOW.md) for the full step-by-step.
61
+ If these files already exist, Caliber audits them against your actual codebase and suggests targeted improvements — keeping what works, fixing what's stale, adding what's missing.
101
62
 
102
- ## How It Works
103
-
104
- 1. **Scan** — Analyzes your code, dependencies, file structure, and existing agent configs
105
- 2. **Generate** — LLM creates config files tailored to your project
106
- 3. **Review** — You accept, refine via chat, or decline the proposed changes
107
- 4. **Apply** — Config files are written to your project with backups, and a before/after score is displayed
108
-
109
- Caliber also auto-generates `AGENTS.md` and configures `.claude/settings.json` permissions during init.
110
-
111
- ### Scoring
63
+ ## Commands
112
64
 
113
- Caliber includes a deterministic scoring system (no LLM needed) that evaluates your agent config across 6 categories: existence, quality, coverage, accuracy, freshness, and bonus. Scoring is target-aware — it only checks what's relevant to your chosen platform:
65
+ | Command | Description |
66
+ |---------|-------------|
67
+ | `caliber init` | Scan project, generate/audit agent configs, review and apply |
68
+ | `caliber score` | Score your config quality (deterministic, no LLM needed) |
69
+ | `caliber recommend` | Discover and install skills from [skills.sh](https://skills.sh) |
70
+ | `caliber config` | Configure LLM provider, API key, and model |
114
71
 
115
72
  ```bash
116
- caliber score # Auto-detect target from existing files
117
- caliber score --agent claude # Score for Claude Code only
118
- caliber score --agent both # Score for Claude Code + Cursor
73
+ caliber init --agent claude # Target Claude Code only
74
+ caliber init --agent cursor # Target Cursor only
75
+ caliber init --agent both # Target both
76
+ caliber init --dry-run # Preview without writing files
77
+ caliber score --json # Machine-readable output
119
78
  ```
120
79
 
121
- During `caliber init`, a before/after score is displayed so you can see the improvement.
80
+ ## LLM Providers
122
81
 
123
- ### Auto-refresh
82
+ | Provider | Setup | Notes |
83
+ |----------|-------|-------|
84
+ | **Claude Code** (your seat) | `caliber config` → Claude Code | No API key. Uses your Pro/Max/Team login via `claude -p`. |
85
+ | **Cursor** (your seat) | `caliber config` → Cursor | No API key. Uses your subscription via Cursor Agent (ACP). |
86
+ | **Anthropic** | `export ANTHROPIC_API_KEY=sk-ant-...` | Claude Sonnet 4.6 default. [Get key](https://console.anthropic.com). |
87
+ | **OpenAI** | `export OPENAI_API_KEY=sk-...` | GPT-4.1 default. |
88
+ | **Vertex AI** | `export VERTEX_PROJECT_ID=my-project` | Uses ADC. Region `us-east5`. |
89
+ | **Custom endpoint** | `OPENAI_API_KEY` + `OPENAI_BASE_URL` | Any OpenAI-compatible API (Ollama, vLLM, Together, etc.) |
124
90
 
125
- During `caliber init`, you'll be prompted to choose how docs auto-refresh:
91
+ Override the model for any provider: `export CALIBER_MODEL=<model-name>` or use `caliber config`.
126
92
 
127
- - **Claude Code hook** — refreshes docs when Claude Code sessions end
128
- - **Git pre-commit hook** — refreshes docs before each commit
129
- - **Both** — enables both hooks
130
- - **Skip** — install later with `caliber hooks install` or `caliber hooks install-precommit`
93
+ <details>
94
+ <summary>Vertex AI advanced setup</summary>
131
95
 
132
96
  ```bash
133
- caliber hooks install # Install Claude Code hook
134
- caliber hooks install-precommit # Install git pre-commit hook
135
- caliber hooks remove # Remove Claude Code hook
136
- caliber hooks remove-precommit # Remove pre-commit hook
137
- caliber hooks status # Show installed hooks
138
- ```
139
-
140
- ### Session Learning
97
+ # Custom region
98
+ export VERTEX_PROJECT_ID=my-gcp-project
99
+ export VERTEX_REGION=europe-west1
141
100
 
142
- Caliber can observe your Claude Code sessions and extract reusable instructions:
101
+ # Service account credentials (inline JSON)
102
+ export VERTEX_PROJECT_ID=my-gcp-project
103
+ export VERTEX_SA_CREDENTIALS='{"type":"service_account",...}'
143
104
 
144
- ```bash
145
- caliber learn install # Install learning hooks
146
- caliber learn status # Check what's been captured
105
+ # Service account credentials (file path)
106
+ export VERTEX_PROJECT_ID=my-gcp-project
107
+ export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json
147
108
  ```
148
109
 
110
+ </details>
111
+
149
112
  ## Requirements
150
113
 
151
114
  - Node.js >= 20
152
- - An LLM: use your **Claude Code** or **Cursor** subscription (run `caliber config` → Claude Code or Cursor; for Claude Code run `claude` once to log in), or set an API key for Anthropic, OpenAI, or Vertex
115
+ - One LLM provider: your **Claude Code** or **Cursor** subscription (no API key), or an API key for Anthropic / OpenAI / Vertex AI
153
116
 
154
117
  ## Contributing
155
118
 
@@ -162,7 +125,7 @@ npm run test # Run tests
162
125
  npm run build # Compile
163
126
  ```
164
127
 
165
- This project uses [conventional commits](https://www.conventionalcommits.org/) — `feat:` for features, `fix:` for bug fixes. See the [CLAUDE.md](./CLAUDE.md) for architecture details.
128
+ Uses [conventional commits](https://www.conventionalcommits.org/) — `feat:` for features, `fix:` for bug fixes.
166
129
 
167
130
  ## License
168
131
 
package/dist/bin.js CHANGED
@@ -2744,9 +2744,22 @@ function extractNpmDeps(dir) {
2744
2744
  "rimraf",
2745
2745
  "cross-env",
2746
2746
  "dotenv",
2747
- "nodemon"
2747
+ "nodemon",
2748
+ "husky",
2749
+ "lint-staged",
2750
+ "commitlint",
2751
+ "@commitlint/cli",
2752
+ "@commitlint/config-conventional"
2748
2753
  ]);
2749
- return Object.keys(deps).filter((d) => !trivial.has(d) && !d.startsWith("@types/")).slice(0, 30);
2754
+ const trivialPatterns = [
2755
+ /^@rely-ai\//,
2756
+ /^@caliber-ai\//,
2757
+ /^eslint-/,
2758
+ /^@eslint\//,
2759
+ /^prettier-/,
2760
+ /^@typescript-eslint\//
2761
+ ];
2762
+ return Object.keys(deps).filter((d) => !trivial.has(d) && !d.startsWith("@types/") && !trivialPatterns.some((p) => p.test(d))).slice(0, 30);
2750
2763
  }
2751
2764
  function extractPythonDeps(dir) {
2752
2765
  const reqTxt = readFileOrNull(join(dir, "requirements.txt"));
@@ -3834,6 +3847,7 @@ async function initCommand(options) {
3834
3847
  `));
3835
3848
  const targetAgent = options.agent || await promptAgent();
3836
3849
  const baselineScore = computeLocalScore(process.cwd(), targetAgent);
3850
+ console.log(chalk4.hex("#6366f1").bold(" Current project score\n"));
3837
3851
  displayScore(baselineScore);
3838
3852
  const hasExistingConfig = !!(fingerprint.existingConfigs.claudeMd || fingerprint.existingConfigs.claudeSettings || fingerprint.existingConfigs.claudeSkills?.length || fingerprint.existingConfigs.cursorrules || fingerprint.existingConfigs.cursorRules?.length);
3839
3853
  if (hasExistingConfig && baselineScore.score === 100) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rely-ai/caliber",
3
- "version": "0.4.3",
4
- "description": "Open-source CLI for configuring coding agent environments (CLAUDE.md, .cursorrules, skills). Bring your own LLM.",
3
+ "version": "0.4.5",
4
+ "description": "Analyze your codebase and generate optimized AI agent configs (CLAUDE.md, .cursorrules, skills) no API key needed",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "caliber": "./dist/bin.js"
@@ -34,16 +34,16 @@
34
34
  "license": "MIT",
35
35
  "author": "Rely AI",
36
36
  "keywords": [
37
- "caliber",
38
- "cli",
39
- "coding-agent",
40
- "claude",
37
+ "ai-agent",
41
38
  "claude-code",
42
- "cursor",
43
- "ai",
44
- "developer-tools",
45
39
  "claude-md",
40
+ "cursor",
46
41
  "cursorrules",
42
+ "coding-agent",
43
+ "developer-tools",
44
+ "ai-config",
45
+ "skills",
46
+ "cli",
47
47
  "open-source"
48
48
  ],
49
49
  "engines": {