@earntori/cli 0.2.12 → 0.2.14

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 (2) hide show
  1. package/dist/index.js +18 -5
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -241,13 +241,18 @@ const HARNESSES = [
241
241
  after: "Codex: trust the project, then /mcp to confirm tori and /hooks once to trust the two hooks.",
242
242
  },
243
243
  ];
244
- function init() {
244
+ async function init() {
245
245
  const pin = flag("base");
246
246
  if (pin)
247
247
  writeJson(join(".tori", "project.json"), { base: pin.replace(/\/$/, "") });
248
- const cfg = loadCfg();
249
- if (!cfg)
250
- die(pin ? `Not signed in for ${pin} \u2014 run: tori login --base ${pin}` : "Not signed in \u2014 run: tori login");
248
+ let cfg = loadCfg();
249
+ if (!cfg) {
250
+ console.log(pin ? `Not signed in for ${pin} \u2014 signing in first` : "Not signed in \u2014 signing in first");
251
+ await login();
252
+ cfg = loadCfg();
253
+ if (!cfg)
254
+ die("Sign-in did not return a session");
255
+ }
251
256
  const local = has("local");
252
257
  const cliBin = resolve(process.argv[1] ?? "");
253
258
  const mcpBin = resolve(dirname(cliBin), "..", "..", "mcp", "dist", "index.js");
@@ -263,11 +268,19 @@ function init() {
263
268
  wrote.push(...h.install(ctx));
264
269
  if (pin)
265
270
  wrote.push(join(".tori", "project.json"));
271
+ let next = "\n\nNext\n Give your agent a task. When it finishes, Tori's checks run.\n Guide: https://github.com/GAishZOEish/tori-examples#readme\n tori ledger the signed record of every check and fix";
272
+ try {
273
+ const r = await api(cfg, "GET", `/api/v1/standards?project=${encodeURIComponent(targetProject())}`);
274
+ const avail = r.standards.filter((s) => !s.enabled && s.rules > 0);
275
+ if (avail.length)
276
+ next += `\n Standards you can turn on for this project:\n ${avail.map((s) => `${s.id} (${s.rules} checks)`).join(" ")}\n tori standards enable ${avail.map((s) => s.id).join(" ")}`;
277
+ }
278
+ catch { }
266
279
  out({ ok: true, harnesses: set.map((h) => h.id), wrote, local }, `\u2713 Tori installed in this project for ${set.map((h) => h.label).join(", ")}${local ? " (local builds)" : ""}${pin ? ` \u2014 pinned to ${pin}` : ""}\n` +
267
280
  wrote.map((w) => ` ${w}`).join("\n") +
268
281
  `\n\n${set.map((h) => h.after).join(" ")}\nTori's checks now run when the agent finishes a turn; findings are shown to the agent before it stops.` +
269
282
  (local ? "" : `\nPinned to @earntori/cli@${ver} and @earntori/mcp@${TORI_MCP_VERSION}; re-run tori init after upgrading.`) +
270
- (set.length === HARNESSES.length ? "" : "\n(Not detected: " + HARNESSES.filter((h) => !set.includes(h)).map((h) => `${h.label} \u2014 tori init --${h.id === "claude-code" ? "claude" : h.id}`).join("; ") + ".)"));
283
+ (set.length === HARNESSES.length ? "" : "\n(Not detected: " + HARNESSES.filter((h) => !set.includes(h)).map((h) => `${h.label} \u2014 tori init --${h.id === "claude-code" ? "claude" : h.id}`).join("; ") + ".)") + next);
271
284
  }
272
285
  function repoIndex() { try {
273
286
  const out = execSync("git ls-files", { encoding: "utf8", stdio: ["ignore", "pipe", "ignore"] }).split("\n").filter(Boolean);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@earntori/cli",
3
- "version": "0.2.12",
4
- "description": "Tori CLI \u2014 sign in with GitHub, check your credits, mint a capped AI key into your tools.",
3
+ "version": "0.2.14",
4
+ "description": "Tori CLI — sign in with GitHub, check your credits, mint a capped AI key into your tools.",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "bin": {
@@ -20,8 +20,8 @@
20
20
  "test": "echo no tests"
21
21
  },
22
22
  "devDependencies": {
23
- "typescript": "^5.6.0",
24
- "@types/node": "^20.0.0"
23
+ "@types/node": "^20.19.43",
24
+ "typescript": "^5.9.3"
25
25
  },
26
26
  "publishConfig": {
27
27
  "access": "public"