@gizai/cli 1.2.1 → 1.3.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.
package/README.md CHANGED
@@ -5,7 +5,7 @@ Connect once in the browser, then use live Giz text and media models, Drive, and
5
5
  ```bash
6
6
  npm install -g @gizai/cli
7
7
  giz auth login
8
- giz chat gpt-5-6-luna "Say hello in Korean"
8
+ giz chat gpt-6-luna "Say hello in Korean"
9
9
  giz generate image "A paper observatory at blue hour"
10
10
  ```
11
11
 
@@ -130,6 +130,7 @@ App 변경은 `giz app list`에서 확인한 `revision`을 명시적으로 전
130
130
  | job get | job.get | job_get | job | giz.read | server job |
131
131
  | job wait | job.get | job_get | job | giz.read | server job |
132
132
  | job cancel | job.cancel | job_cancel | job | giz.destructive | server job |
133
+ | credits | account.credits | account_credits | - | giz.read | account.credits |
133
134
  | drive ls | drive.list | drive_list | - | giz.read | drive.list |
134
135
  | drive list | drive.list | drive_list | - | giz.read | drive.list |
135
136
  | drive search | drive.search | drive_search | query | giz.read | drive.search |
package/cli/giz.mjs CHANGED
@@ -450,7 +450,13 @@ async function runCommand(baseUrl, positionals, options) {
450
450
  const revision = await managedRevision()
451
451
  return { kind: 'message', value: CLI_VERSION + (revision ? ` (region ${revision.trim()})` : '') }
452
452
  }
453
- if (!command || command === 'help' || options.help === true) return { kind: 'help', value: help(command) }
453
+ if (!command || command === 'help' || options.help === true) {
454
+ // A script that asks for help on a command that does not exist must fail, not read the overview as success.
455
+ if (command && command !== 'help' && !help().split('\n').some((line) => line.trim().split(' ')[1] === command && line.startsWith(' giz '))) {
456
+ throw new CliError(`Unknown command "${command}".`, 'Run: giz --help')
457
+ }
458
+ return { kind: 'help', value: help(command) }
459
+ }
454
460
  if (command === 'engine' && subcommand === 'run') {
455
461
  if (rest[0] !== 'claude') throw new CliError('Only Claude Code is an engine connection.')
456
462
  await api(baseUrl, '/api/external/engine/claude/authorization')
@@ -505,6 +511,11 @@ async function runCommand(baseUrl, positionals, options) {
505
511
  }
506
512
  }
507
513
 
514
+ if (command === 'credits') {
515
+ // Batch scripts read the balance before paid work instead of learning it from a refusal (MCP-TOOL-SCHEMA-LIMITS).
516
+ if (subcommand) throw new CliError(`Unknown command "credits ${subcommand}".`, 'Run: giz credits')
517
+ return { kind: 'result', value: await invoke(baseUrl, 'account.credits', {}) }
518
+ }
508
519
  if (command === 'model' && subcommand === 'list') {
509
520
  return {
510
521
  kind: 'models',
@@ -897,6 +908,11 @@ Progress and the final diff, files and summary are returned. Interrupting stops
897
908
  giz api-key revoke KEY_ID
898
909
 
899
910
  The secret is shown only when the key is created.`
911
+ if (command === 'credits') return `Usage
912
+ giz credits
913
+
914
+ Prints your remaining credit (purchased and plan), when plan credit resets, and this month's spend and charges.
915
+ In a workspace it prints the workspace's monthly budget. Read it before paid batch work.`
900
916
  if (command === 'chat') return `Usage
901
917
  giz chat MODEL "your prompt"
902
918
  giz chat MODEL --input '{"messages":[{"role":"user","content":"Hello"}]}'`
@@ -987,6 +1003,7 @@ Usage
987
1003
  giz generate image|video|music|talking-head "PROMPT" [--model MODEL]
988
1004
  giz generate audio --input JSON [--model MODEL]
989
1005
  giz job list|get|wait|cancel [JOB]
1006
+ giz credits
990
1007
  giz drive ls|list|search|read|write|mkdir|move|delete
991
1008
  giz table list|get|read|write|action
992
1009
  giz upload LOCAL_PATH
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gizai/cli",
3
- "version": "1.2.1",
3
+ "version": "1.3.0",
4
4
  "description": "Giz CLI, MCP installer, OpenAI-compatible models, Drive, and Computer",
5
5
  "type": "module",
6
6
  "bin": {
@@ -36,7 +36,7 @@ giz model run MODEL_ID --input '{"prompt":"..."}'
36
36
  Use the OpenAI-compatible chat boundary:
37
37
 
38
38
  ```bash
39
- giz chat gpt-5-6-luna "..."
39
+ giz chat gpt-6-luna "..."
40
40
  ```
41
41
 
42
42
  Upload local media into an exact model field:
@@ -88,6 +88,7 @@ App 변경은 `giz app list`에서 확인한 `revision`을 명시적으로 전
88
88
  | job get | job.get | job_get | job | giz.read | server job |
89
89
  | job wait | job.get | job_get | job | giz.read | server job |
90
90
  | job cancel | job.cancel | job_cancel | job | giz.destructive | server job |
91
+ | credits | account.credits | account_credits | - | giz.read | account.credits |
91
92
  | drive ls | drive.list | drive_list | - | giz.read | drive.list |
92
93
  | drive list | drive.list | drive_list | - | giz.read | drive.list |
93
94
  | drive search | drive.search | drive_search | query | giz.read | drive.search |