@agentskit/cli 0.5.0 → 0.5.2

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.
package/README.md CHANGED
@@ -1,14 +1,22 @@
1
1
  # @agentskit/cli
2
2
 
3
- ![stability: stable](https://img.shields.io/badge/stability-stable-brightgreen)
4
-
5
3
  Chat with any LLM, scaffold projects, and run agents — all from your terminal.
6
4
 
7
- ## Why
5
+ [![npm version](https://img.shields.io/npm/v/@agentskit/cli?color=blue)](https://www.npmjs.com/package/@agentskit/cli)
6
+ [![npm downloads](https://img.shields.io/npm/dm/@agentskit/cli)](https://www.npmjs.com/package/@agentskit/cli)
7
+ [![bundle size](https://img.shields.io/bundlephobia/minzip/@agentskit/cli)](https://bundlephobia.com/package/@agentskit/cli)
8
+ [![license](https://img.shields.io/npm/l/@agentskit/cli)](../../LICENSE)
9
+ [![stability](https://img.shields.io/badge/stability-stable-brightgreen)](../../docs/STABILITY.md)
10
+ [![GitHub stars](https://img.shields.io/github/stars/AgentsKit-io/agentskit?style=social)](https://github.com/AgentsKit-io/agentskit)
11
+
12
+ **Tags:** `ai` · `agents` · `llm` · `agentskit` · `openai` · `anthropic` · `claude` · `gemini` · `chatgpt` · `cli` · `command-line` · `scaffolding` · `ai-agents` · `autonomous-agents`
13
+
14
+ ## Why cli
8
15
 
9
16
  - **Zero setup for prototyping** — go from idea to running conversation in under a minute; no boilerplate, no config files to write
10
17
  - **Scaffold production-ready projects** — generate a React chat app or terminal agent with the right structure so you skip the boring setup
11
18
  - **Script and automate** — pipe inputs, use env vars for keys, and compose with other Unix tools for lightweight agent scripting
19
+ - **Every provider, one command** — switch between OpenAI, Anthropic, Ollama (local), and more with a single flag
12
20
 
13
21
  ## Install
14
22
 
@@ -35,9 +43,13 @@ agentskit init --template ink --dir my-cli
35
43
  agentskit run --help
36
44
  ```
37
45
 
38
- ## Next steps
46
+ ## Features
39
47
 
40
- - Generated apps use [`@agentskit/react`](https://www.npmjs.com/package/@agentskit/react) or [`@agentskit/ink`](https://www.npmjs.com/package/@agentskit/ink)extend with [`@agentskit/tools`](https://www.npmjs.com/package/@agentskit/tools), [`@agentskit/skills`](https://www.npmjs.com/package/@agentskit/skills), and [`@agentskit/runtime`](https://www.npmjs.com/package/@agentskit/runtime) for programmatic agents
48
+ - `agentskit chat` — interactive streaming chat in the terminal powered by `@agentskit/ink`
49
+ - `agentskit init` — interactive project generator (React or Ink templates, production-ready structure)
50
+ - `agentskit run` — execute headless runtime agents from the terminal
51
+ - Provider flags: `--provider`, `--model`, `--system`, `--skill`, `--memory`
52
+ - Env-var based key injection — works seamlessly in CI and scripts
41
53
 
42
54
  ## Ecosystem
43
55
 
@@ -48,6 +60,16 @@ agentskit run --help
48
60
  | [@agentskit/ink](https://www.npmjs.com/package/@agentskit/ink) | Ink UI used by interactive `chat` |
49
61
  | [@agentskit/core](https://www.npmjs.com/package/@agentskit/core) | Shared types and contracts |
50
62
 
63
+ ## Contributors
64
+
65
+ <a href="https://github.com/AgentsKit-io/agentskit/graphs/contributors">
66
+ <img src="https://contrib.rocks/image?repo=AgentsKit-io/agentskit" alt="AgentsKit contributors" />
67
+ </a>
68
+
69
+ ## License
70
+
71
+ MIT — see [LICENSE](../../LICENSE).
72
+
51
73
  ## Docs
52
74
 
53
- [Full documentation](https://emersonbraun.github.io/agentskit/)
75
+ [Full documentation](https://www.agentskit.io) · [GitHub](https://github.com/AgentsKit-io/agentskit)
package/dist/bin.cjs CHANGED
@@ -386,6 +386,8 @@ function reactStarter(ctx) {
386
386
  },
387
387
  dependencies: deps,
388
388
  devDependencies: {
389
+ "@types/react": "^19.0.0",
390
+ "@types/react-dom": "^19.0.0",
389
391
  "@vitejs/plugin-react": "^5.0.0",
390
392
  typescript: "^5.5.0",
391
393
  vite: "^7.0.0"
@@ -491,6 +493,7 @@ function inkStarter(ctx) {
491
493
  dependencies: deps,
492
494
  devDependencies: {
493
495
  "@types/react": "^19.0.0",
496
+ "@types/react-dom": "^19.0.0",
494
497
  tsx: "^4.20.0",
495
498
  typescript: "^5.5.0"
496
499
  }
@@ -715,9 +718,9 @@ ${runCmd}
715
718
 
716
719
  ## Next steps
717
720
 
718
- - Open the AgentsKit docs at https://agentskit.io/docs
719
- - Add a custom skill: https://agentskit.io/docs/concepts/skill
720
- - Wire up RAG: https://agentskit.io/docs/recipes/rag-chat
721
+ - Open the AgentsKit docs at https://www.agentskit.io/docs
722
+ - Add a custom skill: https://www.agentskit.io/docs/concepts/skill
723
+ - Wire up RAG: https://www.agentskit.io/docs/recipes/rag-chat
721
724
 
722
725
  ## License
723
726
 
@@ -873,7 +876,7 @@ function printNextSteps(options) {
873
876
  process.stdout.write(` ${kleur__default.default.cyan(runCmd)}
874
877
 
875
878
  `);
876
- process.stdout.write(kleur__default.default.dim(" Docs: https://agentskit.io/docs\n\n"));
879
+ process.stdout.write(kleur__default.default.dim(" Docs: https://www.agentskit.io/docs\n\n"));
877
880
  }
878
881
  function formatEvent(event) {
879
882
  switch (event.type) {
@@ -1039,8 +1042,8 @@ var PROVIDER_ENV_KEYS = {
1039
1042
  };
1040
1043
  var PROVIDER_REACH_URLS = {
1041
1044
  openai: "https://api.openai.com/v1/models",
1042
- anthropic: "https://api.anthropic.com",
1043
- gemini: "https://generativelanguage.googleapis.com",
1045
+ anthropic: "https://api.anthropic.com/v1/messages",
1046
+ gemini: "https://generativelanguage.googleapis.com/v1beta/models",
1044
1047
  ollama: "http://localhost:11434/api/tags"
1045
1048
  };
1046
1049
  async function checkNodeVersion() {
@@ -1128,10 +1131,10 @@ async function checkProviderEnv(provider) {
1128
1131
  const value = process.env[envKey];
1129
1132
  if (!value) {
1130
1133
  return {
1131
- status: "fail",
1134
+ status: "skip",
1132
1135
  name: `${provider} API key`,
1133
- detail: `${envKey} is not set`,
1134
- fix: `export ${envKey}=...`
1136
+ detail: `${envKey} not set`,
1137
+ fix: `export ${envKey}=... (only needed if you use ${provider})`
1135
1138
  };
1136
1139
  }
1137
1140
  if (value.length < 16) {
@@ -1147,7 +1150,11 @@ async function checkProviderEnv(provider) {
1147
1150
  async function checkProviderReachable(provider, fetchImpl = fetch, timeoutMs = 4e3) {
1148
1151
  const url = PROVIDER_REACH_URLS[provider];
1149
1152
  if (!url) {
1150
- return { status: "skip", name: `${provider} reachable`, detail: "No reachability check for this provider" };
1153
+ return { status: "skip", name: `${provider} reachable`, detail: "No reachability check configured" };
1154
+ }
1155
+ const envKey = PROVIDER_ENV_KEYS[provider];
1156
+ if (envKey && !process.env[envKey]) {
1157
+ return { status: "skip", name: `${provider} reachable`, detail: "Skipped \u2014 no API key configured" };
1151
1158
  }
1152
1159
  const controller = new AbortController();
1153
1160
  const timer = setTimeout(() => controller.abort(), timeoutMs);
@@ -1155,12 +1162,18 @@ async function checkProviderReachable(provider, fetchImpl = fetch, timeoutMs = 4
1155
1162
  const res = await fetchImpl(url, {
1156
1163
  method: "GET",
1157
1164
  signal: controller.signal
1158
- // No auth — we just want to confirm DNS + network reach.
1159
1165
  });
1166
+ if (res.status >= 200 && res.status < 400) {
1167
+ return { status: "pass", name: `${provider} reachable`, detail: `${url} \u2192 ${res.status} OK` };
1168
+ }
1169
+ if (res.status === 401 || res.status === 403 || res.status === 405) {
1170
+ return { status: "pass", name: `${provider} reachable`, detail: `${url} \u2192 ${res.status} (host reachable)` };
1171
+ }
1160
1172
  return {
1161
- status: "pass",
1173
+ status: "warn",
1162
1174
  name: `${provider} reachable`,
1163
- detail: `${url} \u2192 HTTP ${res.status}`
1175
+ detail: `${url} \u2192 HTTP ${res.status}`,
1176
+ fix: "Host reachable but returned unexpected status \u2014 check provider docs"
1164
1177
  };
1165
1178
  } catch (err) {
1166
1179
  const reason = err.name === "AbortError" ? `timeout after ${timeoutMs}ms` : err.message;
@@ -1218,41 +1231,69 @@ async function runDoctor(options = {}) {
1218
1231
  };
1219
1232
  }
1220
1233
  var ICON = {
1221
- pass: "\u2713",
1222
- warn: "!",
1223
- fail: "\u2717",
1224
- skip: "\xB7"
1234
+ pass: "\u2714",
1235
+ warn: "\u26A0",
1236
+ fail: "\u2718",
1237
+ skip: "\u25CB"
1225
1238
  };
1226
1239
  function renderReport(report, opts = {}) {
1227
1240
  const color = opts.color ?? true;
1228
1241
  const c = (code, text) => color ? `\x1B[${code}m${text}\x1B[0m` : text;
1229
1242
  const colorFor = {
1230
1243
  pass: (t) => c("32", t),
1244
+ // green
1231
1245
  warn: (t) => c("33", t),
1246
+ // yellow
1232
1247
  fail: (t) => c("31", t),
1248
+ // red
1233
1249
  skip: (t) => c("90", t)
1250
+ // dim
1234
1251
  };
1235
1252
  const lines = [];
1236
1253
  lines.push("");
1237
- lines.push(c("1", "agentskit doctor"));
1254
+ lines.push(` ${c("1;36", "\u26A1 AgentsKit Doctor")}`);
1255
+ lines.push(` ${c("90", "\u2500".repeat(50))}`);
1238
1256
  lines.push("");
1257
+ const groups = {
1258
+ "Environment": [],
1259
+ "Providers": [],
1260
+ "Network": []
1261
+ };
1239
1262
  for (const r of report.results) {
1240
- const icon = colorFor[r.status](ICON[r.status]);
1241
- const name = r.name.padEnd(28);
1242
- const detail = r.detail ? c("90", r.detail) : "";
1243
- lines.push(` ${icon} ${name} ${detail}`);
1244
- if (r.fix && (r.status === "fail" || r.status === "warn")) {
1245
- lines.push(` ${c("90", "\u21B3 " + r.fix)}`);
1263
+ if (r.name.includes("reachable")) {
1264
+ groups["Network"].push(r);
1265
+ } else if (r.name.includes("API key")) {
1266
+ groups["Providers"].push(r);
1267
+ } else {
1268
+ groups["Environment"].push(r);
1246
1269
  }
1247
1270
  }
1248
- lines.push("");
1249
- const summary = [
1250
- `${report.pass} pass`,
1251
- report.warn > 0 ? colorFor.warn(`${report.warn} warn`) : `${report.warn} warn`,
1252
- report.fail > 0 ? colorFor.fail(`${report.fail} fail`) : `${report.fail} fail`,
1253
- `${report.skip} skip`
1254
- ].join(" \xB7 ");
1255
- lines.push(` ${c("1", "Summary:")} ${summary}`);
1271
+ for (const [group, results] of Object.entries(groups)) {
1272
+ if (results.length === 0) continue;
1273
+ lines.push(` ${c("1", group)}`);
1274
+ for (const r of results) {
1275
+ const icon = colorFor[r.status](ICON[r.status]);
1276
+ const name = r.name.padEnd(28);
1277
+ const detail = r.detail ? c("90", r.detail) : "";
1278
+ lines.push(` ${icon} ${name} ${detail}`);
1279
+ if (r.fix && r.status !== "pass") {
1280
+ lines.push(` ${c("90", "\u21B3 " + r.fix)}`);
1281
+ }
1282
+ }
1283
+ lines.push("");
1284
+ }
1285
+ lines.push(` ${c("90", "\u2500".repeat(50))}`);
1286
+ const parts = [];
1287
+ if (report.pass > 0) parts.push(colorFor.pass(`${report.pass} passed`));
1288
+ if (report.warn > 0) parts.push(colorFor.warn(`${report.warn} warnings`));
1289
+ if (report.fail > 0) parts.push(colorFor.fail(`${report.fail} failed`));
1290
+ if (report.skip > 0) parts.push(colorFor.skip(`${report.skip} skipped`));
1291
+ lines.push(` ${parts.join(" \xB7 ")}`);
1292
+ if (report.fail === 0) {
1293
+ lines.push(` ${c("32", "\u2714 Ready to build agents.")}`);
1294
+ } else {
1295
+ lines.push(` ${c("31", "\u2718 Fix the issues above before continuing.")}`);
1296
+ }
1256
1297
  lines.push("");
1257
1298
  return lines.join("\n");
1258
1299
  }