@2kw/ai 7.0.0-dev.7 → 7.0.0-dev.8

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.
@@ -4,6 +4,8 @@ import { isJsonOutput } from "../lib/config.js";
4
4
  import { CliUsageError } from "../lib/errors.js";
5
5
  import { formatDetail, formatList } from "../lib/output.js";
6
6
  import chalk from "chalk";
7
+ /** What human output shows for a null tier: an organisation without a plan (#1356). */
8
+ const NO_PLAN = "no plan";
7
9
  export function makeBillingCommand() {
8
10
  const cmd = new Command("billing").description("Billing and subscription management");
9
11
  cmd
@@ -23,7 +25,9 @@ export function makeBillingCommand() {
23
25
  await runAction(command, async () => {
24
26
  const client = getClient(command);
25
27
  const { data } = await client.GET("/v1/billing/tier");
26
- formatDetail(data, command);
28
+ // A null name is an organisation without a plan (#1356); --json keeps the raw null.
29
+ const shown = data && data.name == null && !isJsonOutput(command) ? { ...data, name: NO_PLAN } : data;
30
+ formatDetail(shown, command);
27
31
  });
28
32
  });
29
33
  cmd
@@ -37,7 +41,7 @@ export function makeBillingCommand() {
37
41
  console.log(JSON.stringify(data, null, 2));
38
42
  }
39
43
  else {
40
- console.log(chalk.cyan(`Tier: ${data?.tier ?? "unknown"}`));
44
+ console.log(chalk.cyan(`Tier: ${data?.tier ?? NO_PLAN}`));
41
45
  console.log();
42
46
  if (data?.resources?.length) {
43
47
  console.log(chalk.bold("Resources:"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@2kw/ai",
3
- "version": "7.0.0-dev.7",
3
+ "version": "7.0.0-dev.8",
4
4
  "description": "CLI for 2kw.ai — schema-driven document extraction, an OpenAI-compatible EU LLM gateway, transcription, prompts, datasets, and experiments from your terminal or agentic workflows. Ships as 2kw, backbone, and bb.",
5
5
  "keywords": [
6
6
  "cli",