Skip to content

Commit 41fbcab

Browse files
committed
feat: add Kilo CLI application support
Add kilo_cli to the application registry for the Kilo Code CLI (terminal-based AI agent, separate from Kilo Code VS Code extension). - Add to Applications type array and application config - Update schema.prisma documentation comments - Add to home page and stats page UI copy - Add seed data with standard model names (not provider-specific) - Update CLAUDE.md documentation - Fix stale comment in seed.ts (period count)
1 parent 68ff7d6 commit 41fbcab

7 files changed

Lines changed: 59 additions & 22 deletions

File tree

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ The platform tracks statistics from multiple agentic AI coding tools, not just C
6060
- `open_code` - OpenCode
6161
- `cline` - Cline (VSCode extension)
6262
- `roo_code`, `kilo_code`, `qwen_code` - Other AI coding assistants
63-
- `codex_cli`, `gemini_cli` - Alternative CLIs
63+
- `codex_cli`, `gemini_cli`, `kilo_cli` - Alternative CLIs
6464
- `copilot` - GitHub Copilot
6565
- `pi_agent` - Pi Agent
6666

prisma/schema.prisma

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ model User {
3535
model MessageStats {
3636
globalHash String @id
3737
userId String
38-
application String @default("claude_code") // "claude_code", "gemini_cli", "codex_cli", "cline", "kilo_code", "roo_code", "qwen_code", "copilot", "open_code", "pi_agent"
38+
application String @default("claude_code") // "claude_code", "gemini_cli", "codex_cli", "cline", "kilo_code", "kilo_cli", "roo_code", "qwen_code", "copilot", "open_code", "pi_agent"
3939
role String // "assistant" or "user"
4040
date DateTime
4141
projectHash String
@@ -92,7 +92,7 @@ model MessageStats {
9292
model UserStats {
9393
id String @id @default(cuid())
9494
userId String
95-
application String // "claude_code", "gemini_cli", "codex_cli", "cline", "kilo_code", "roo_code", "qwen_code", "copilot", "open_code", "pi_agent"
95+
application String // "claude_code", "gemini_cli", "codex_cli", "cline", "kilo_code", "kilo_cli", "roo_code", "qwen_code", "copilot", "open_code", "pi_agent"
9696
period String // "hourly", "daily", "weekly", "monthly", "yearly"
9797
periodStart DateTime // Required for unique constraint - each period bucket is uniquely identified
9898
periodEnd DateTime?

prisma/seed.ts

Lines changed: 43 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,16 @@ function generateStats(baseMultiplier: number, periodMultiplier: number, applica
159159
const avgOutputCost = (0.7 * 0.6 + 0.2 * 10 + 0.1 * 4.4) / 1000;
160160
const avgCachedCost = (0.7 * 0.075 + 0.2 * 1.25 + 0.1 * 0.55) / 1000;
161161

162+
cost = (inputTokensNum / 1000) * avgInputCost +
163+
(outputTokensNum / 1000) * avgOutputCost +
164+
(Number(cachedTokens) / 1000) * avgCachedCost;
165+
} else if (application === "kilo_cli") {
166+
// Kilo CLI — mix of free and paid models via OpenRouter; weighted average
167+
// ~40% glm-5 (paid), ~30% aurora-alpha (free), ~30% trinity (free)
168+
const avgInputCost = (0.4 * 0.6) / 1000;
169+
const avgOutputCost = (0.4 * 0.6) / 1000;
170+
const avgCachedCost = (0.4 * 0.06) / 1000;
171+
162172
cost = (inputTokensNum / 1000) * avgInputCost +
163173
(outputTokensNum / 1000) * avgOutputCost +
164174
(Number(cachedTokens) / 1000) * avgCachedCost;
@@ -256,7 +266,7 @@ async function clearDatabase() {
256266
}
257267

258268
// Helpers to generate realistic message_stats rows for the stats API
259-
const APPLICATIONS = ["claude_code", "gemini_cli", "codex_cli", "copilot"] as const;
269+
const APPLICATIONS = ["claude_code", "gemini_cli", "codex_cli", "copilot", "kilo_cli"] as const;
260270
const MODELS_BY_APP: Record<(typeof APPLICATIONS)[number], string[]> = {
261271
claude_code: [
262272
"claude-3.7-sonnet",
@@ -267,6 +277,7 @@ const MODELS_BY_APP: Record<(typeof APPLICATIONS)[number], string[]> = {
267277
gemini_cli: ["gemini-1.5-pro", "gemini-1.5-flash", "gemini-2.0-flash"],
268278
codex_cli: ["gpt-4o-mini", "gpt-4o", "o3-mini"],
269279
copilot: ["gpt-4o", "gpt-4o-mini"],
280+
kilo_cli: ["claude-3.5-sonnet", "gpt-4o-mini", "gemini-2.0-flash"],
270281
};
271282

272283
function randInt(min: number, max: number) {
@@ -308,10 +319,11 @@ async function createMessageStats(users: Array<{ id: string; multiplier: number
308319

309320
// Per-application usage distribution (sum to 1.0)
310321
const appWeights: Record<(typeof APPLICATIONS)[number], number> = {
311-
claude_code: 0.5,
312-
gemini_cli: 0.25,
322+
claude_code: 0.45,
323+
gemini_cli: 0.22,
313324
codex_cli: 0.1,
314-
copilot: 0.15,
325+
copilot: 0.13,
326+
kilo_cli: 0.1,
315327
};
316328

317329
// Simulate up to this many days of history
@@ -484,6 +496,23 @@ async function createMessageStats(users: Array<{ id: string; multiplier: number
484496
outputCostPerK = 10 / 1000;
485497
cachedCostPerK = 1.25 / 1000;
486498
}
499+
} else if (app === "kilo_cli") {
500+
// Kilo CLI models (free-tier OpenRouter models via Kilo gateway)
501+
if (model === "z-ai/glm-5:free") {
502+
inputCostPerK = 0.6 / 1000;
503+
outputCostPerK = 0.6 / 1000;
504+
cachedCostPerK = 0.06 / 1000;
505+
} else if (model === "openrouter/aurora-alpha") {
506+
// Free model — zero cost
507+
inputCostPerK = 0;
508+
outputCostPerK = 0;
509+
cachedCostPerK = 0;
510+
} else if (model === "arcee-ai/trinity-large-preview:free") {
511+
// Free model — zero cost
512+
inputCostPerK = 0;
513+
outputCostPerK = 0;
514+
cachedCostPerK = 0;
515+
}
487516
}
488517

489518
// Calculate total cost
@@ -599,7 +628,7 @@ async function createPeriodStats(users: Array<{ id: string; multiplier: number }
599628
console.log("📊 Creating period statistics...");
600629

601630
const periods = getPeriodDates();
602-
const applications = ["claude_code", "gemini_cli", "codex_cli"] as const;
631+
const applications = ["claude_code", "gemini_cli", "codex_cli", "kilo_cli"] as const;
603632

604633
// Period multipliers (how much activity in each period)
605634
const periodMultipliers = {
@@ -612,9 +641,10 @@ async function createPeriodStats(users: Array<{ id: string; multiplier: number }
612641

613642
// Application usage distribution for each user
614643
const applicationWeights = {
615-
claude_code: 0.6, // 60% usage
616-
gemini_cli: 0.3, // 30% usage
644+
claude_code: 0.55, // 55% usage
645+
gemini_cli: 0.25, // 25% usage
617646
codex_cli: 0.1, // 10% usage
647+
kilo_cli: 0.1, // 10% usage
618648
};
619649

620650
let processedUsers = 0;
@@ -662,7 +692,7 @@ async function createPeriodStats(users: Array<{ id: string; multiplier: number }
662692
}
663693
}
664694

665-
const totalStats = users.length * 5 * applications.length; // 5 periods, 3 applications
695+
const totalStats = users.length * 5 * applications.length; // 5 periods × ${applications.length} applications
666696
console.log(`✅ Created ${totalStats.toLocaleString()} period statistics for ${users.length} users`);
667697
}
668698

@@ -702,9 +732,9 @@ async function main() {
702732
console.log("");
703733
console.log("📊 Summary:");
704734
console.log(` • ${users.length} users created`);
705-
console.log(` • ${(users.length * 5 * 3).toLocaleString()} total UserStats records`);
735+
console.log(` • ${(users.length * 5 * 4).toLocaleString()} total UserStats records (5 periods × 4 apps)`);
706736
console.log(` • ${users.length} API tokens created`);
707-
console.log(" • MessageStats generated for up to 120 days, 3 applications, multiple conversations/day");
737+
console.log(" • MessageStats generated for up to 120 days, 5 applications, multiple conversations/day");
708738
console.log("");
709739
console.log("📈 Generated data for all time periods:");
710740
console.log(" • Hourly (current hour)");
@@ -714,9 +744,10 @@ async function main() {
714744
console.log(" • Yearly (current year)");
715745
console.log("");
716746
console.log("🚀 Generated data for all applications:");
717-
console.log(" • Claude Code (60% usage)");
718-
console.log(" • Gemini CLI (30% usage)");
747+
console.log(" • Claude Code (55% usage)");
748+
console.log(" • Gemini CLI (25% usage)");
719749
console.log(" • Codex CLI (10% usage)");
750+
console.log(" • Kilo CLI (10% usage)");
720751
console.log("");
721752
console.log("📈 User distribution:");
722753
console.log(" • Most users have multipliers around 1.0 (normal distribution)");

src/app/home-page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ export default function HomePage() {
4343
<p className="text-lg md:text-xl text-muted-foreground mb-1">
4444
Instantly hunt down and aggregate usage stats for all your agentic
4545
AI development tools: Claude Code / Codex CLI* / Gemini CLI* / Qwen
46-
Code / Cline / Roo Code / Kilo Code / GitHub Copilot / OpenCode / Pi
47-
Agent / Piebald.{" "}
46+
Code / Cline / Roo Code / Kilo Code / Kilo CLI / GitHub Copilot /
47+
OpenCode / Pi Agent / Piebald.{" "}
4848
</p>
4949
<p className="text-lg md:text-xl text-muted-foreground mb-4 font-bold">
5050
Sync your data across devices with{" "}

src/app/stats-page.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -580,8 +580,9 @@ export default function StatsPage() {
580580
<h1 className="text-2xl font-bold mb-4">Profile</h1>
581581
<p className="text-muted-foreground">
582582
No profile data found. Start using Claude Code / Codex CLI / Gemini
583-
CLI / Qwen Code / Cline / Roo Code / Kilo Code / GitHub Copilot /
584-
OpenCode / Pi Agent / Piebald with Splitrail to see your stats!
583+
CLI / Qwen Code / Cline / Roo Code / Kilo Code / Kilo CLI / GitHub
584+
Copilot / OpenCode / Pi Agent / Piebald with Splitrail to see your
585+
stats!
585586
</p>
586587
</div>
587588
</div>
@@ -686,9 +687,9 @@ export default function StatsPage() {
686687
<p>
687688
You don&rsquo;t have any agentic development tool data. Once
688689
you start using Claude Code / Codex CLI / Gemini CLI / Qwen
689-
Code / Cline / Roo Code / Kilo Code / GitHub Copilot /
690-
OpenCode / Pi Agent / Piebald, you can get started by
691-
following these steps:
690+
Code / Cline / Roo Code / Kilo Code / Kilo CLI / GitHub
691+
Copilot / OpenCode / Pi Agent / Piebald, you can get started
692+
by following these steps:
692693
</p>
693694
<ol className="list-decimal list-inside space-y-1 ml-2">
694695
<li>

src/lib/application-config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ export const APPLICATION_CONFIG: Record<
4040
id: "kilo_code",
4141
label: "Kilo Code",
4242
},
43+
kilo_cli: {
44+
id: "kilo_cli",
45+
label: "Kilo CLI",
46+
},
4347
copilot: {
4448
id: "copilot",
4549
label: "Copilot",

src/types/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export const Applications = [
1010
"cline",
1111
"roo_code",
1212
"kilo_code",
13+
"kilo_cli",
1314
"copilot",
1415
"open_code",
1516
"pi_agent",

0 commit comments

Comments
 (0)