@intactfile/cli 0.1.1 → 0.2.0

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 +25 -2
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -7,13 +7,13 @@ import { mkdirSync, writeFileSync } from "node:fs";
7
7
  import { basename, dirname, extname, join, parse } from "node:path";
8
8
  import { createInterface } from "node:readline";
9
9
  import { Command } from "commander";
10
- import { ApiError, balance, clearAuth, consume, EntitlementError, getToken, login as apiLogin, magic as apiMagic, recover as apiRecover, repairPath, diagnosePath, requireBusiness, setToken, UnsupportedError, } from "@intactfile/node-core";
10
+ import { ApiError, balance, clearAuth, consume, EntitlementError, ensureLicense, getLicenseStatus, getToken, login as apiLogin, magic as apiMagic, recover as apiRecover, repairPath, diagnosePath, requireBusiness, setToken, UnsupportedError, } from "@intactfile/node-core";
11
11
  import { generateRepairReportPdf } from "@intactfile/report";
12
12
  const program = new Command();
13
13
  program
14
14
  .name("intactfile")
15
15
  .description("Repair corrupted files locally — your files never leave your machine.")
16
- .version("0.1.0");
16
+ .version("0.2.0");
17
17
  /* ------------------------------- helpers ------------------------------- */
18
18
  function ask(query) {
19
19
  const rl = createInterface({ input: process.stdin, output: process.stdout });
@@ -43,6 +43,8 @@ const OUT_EXT = {
43
43
  png: ".png",
44
44
  sqlite: ".sqlite",
45
45
  archive: "",
46
+ audio: ".wav",
47
+ avi: ".avi",
46
48
  };
47
49
  function defaultOut(input, family) {
48
50
  const p = parse(input);
@@ -176,6 +178,27 @@ program
176
178
  handle(e);
177
179
  }
178
180
  });
181
+ program
182
+ .command("license")
183
+ .description("Fetch and apply your offline Business license (used by repair and the SDK).")
184
+ .option("--refresh", "force a fresh license even if the cached one is still valid")
185
+ .action(async (opts) => {
186
+ try {
187
+ await requireBusiness();
188
+ const token = getToken();
189
+ if (token)
190
+ await ensureLicense(token, { force: !!opts.refresh });
191
+ const status = await getLicenseStatus();
192
+ if (!status.licensed) {
193
+ return die(`Couldn't apply a license (${status.reason ?? "unknown"}).`);
194
+ }
195
+ console.log(`✓ License active (${status.tier}) — valid until ${status.expiresAt?.slice(0, 10)}.`);
196
+ console.log(" The CLI, MCP server, and SDK use it automatically; it works offline until then.");
197
+ }
198
+ catch (e) {
199
+ handle(e);
200
+ }
201
+ });
179
202
  function summarize(sub) {
180
203
  if (!sub)
181
204
  return console.log("Plan: none (no active subscription).");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intactfile/cli",
3
- "version": "0.1.1",
3
+ "version": "0.2.0",
4
4
  "description": "IntactFile CLI — repair corrupted files locally (video, ZIP/Office, PDF, JPEG, PNG, SQLite, RAR/7z). Your files never leave your machine. Business plan for repairs; diagnosis is free.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
@@ -15,7 +15,7 @@
15
15
  },
16
16
  "dependencies": {
17
17
  "commander": "^12.1.0",
18
- "@intactfile/node-core": "0.1.0",
18
+ "@intactfile/node-core": "0.2.0",
19
19
  "@intactfile/report": "0.1.0"
20
20
  },
21
21
  "devDependencies": {