@newbeebox/newbeebox-app-engine-cli 1.2.0 → 1.4.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
@@ -61,6 +61,7 @@ nae apps
61
61
  |------|------|
62
62
  | `nae whoami` | 当前身份(uid/用户名/角色/命名空间) |
63
63
  | `nae quota` | 配额用量(CPU/内存/存储/应用数 的 已用/上限) |
64
+ | `nae llm` | 内置 LLM 网关状态:月度额度/本月用量/令牌前缀/内置环境变量名/按模型明细 |
64
65
  | `nae config` | 查看本地配置(密钥脱敏) |
65
66
 
66
67
  ### 应用
@@ -79,6 +80,7 @@ nae apps
79
80
  nae create --app-id myweb --tag latest --port 8080 \
80
81
  --cpu 500m --mem 512Mi --env '{"FOO":"bar"}'
81
82
  # 自带 basePath 的框架(如 Next.js)加 --keep-path-prefix
83
+ # 仅内部访问(不导出外链,只在集群内经 DNS+端口调用)加 --internal-only(创建后不可改)
82
84
  ```
83
85
 
84
86
  创建模板应用:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newbeebox/newbeebox-app-engine-cli",
3
- "version": "1.2.0",
3
+ "version": "1.4.0",
4
4
  "description": "NewBee App Engine 命令行客户端(nae)——参数直达、默认人类可读(加 -o json 出 JSON),便于在终端使用与脚本/管道里解析。",
5
5
  "type": "module",
6
6
  "bin": {
package/src/index.js CHANGED
@@ -15,7 +15,7 @@ const program = new Command()
15
15
  program
16
16
  .name('nae')
17
17
  .description('NewBee App Engine CLI —— 默认人类可读,-o json 输出 JSON 供脚本解析')
18
- .version('1.2.0')
18
+ .version('1.4.0')
19
19
  .option('--base-url <url>', '覆盖平台地址(也可用环境变量 NAE_BASE_URL)')
20
20
  .option('--token <token>', '覆盖访问密钥(也可用环境变量 NAE_TOKEN)')
21
21
  .option('-o, --output <format>', '输出格式:text(默认,人类可读)| json', 'text')
@@ -149,6 +149,15 @@ program
149
149
  })
150
150
  )
151
151
 
152
+ program
153
+ .command('llm')
154
+ .description('查询内置 LLM 网关状态:月度额度/本月用量/令牌前缀/内置环境变量名/按模型用量明细')
155
+ .action(
156
+ run(async () => {
157
+ emit(await request(cfg(), 'GET', '/me/llm'))
158
+ })
159
+ )
160
+
152
161
  // --- 应用 ---
153
162
 
154
163
  program
@@ -190,6 +199,7 @@ program
190
199
  .option('--mem <limit>', '内存上限,如 512Mi / 1Gi')
191
200
  .option('--max-restarts <n>', '失败重启上限,0=不封顶', (v) => parseInt(v, 10))
192
201
  .option('--keep-path-prefix', '不剥离 /apps/<appid> 前缀(自带 basePath 的框架用)')
202
+ .option('--internal-only', '普通应用:不导出外部链接,只在集群内经 DNS+端口访问(创建后不可改)')
193
203
  .option('--template <key>', '模板应用:模板 key')
194
204
  .option('--storage <size>', '模板应用:持久卷大小,如 10Gi')
195
205
  .option('--replicas <n>', '副本数', (v) => parseInt(v, 10))
@@ -210,6 +220,9 @@ program
210
220
  # 自带 basePath 的框架(Next.js Node server 等):保留 /apps/<appid> 前缀
211
221
  nae create --app-id mynext --tag latest --port 3000 --keep-path-prefix
212
222
 
223
+ # 仅内部访问:不导出外部链接,只在集群内经 DNS+端口被其它应用调用(如后端 API)
224
+ nae create --app-id myapi --tag latest --port 8080 --internal-only
225
+
213
226
  # 模板应用 Redis:--config 取该模板的服务特性参数(见 nae templates)
214
227
  nae create --kind template --app-id myredis --template redis --storage 2Gi \\
215
228
  --config '{"password":"s3cret","persistence":"rdb"}'
@@ -235,6 +248,7 @@ program
235
248
  mem_limit: opts.mem,
236
249
  max_restarts: opts.maxRestarts,
237
250
  keep_path_prefix: opts.keepPathPrefix || undefined,
251
+ internal_only: opts.internalOnly || undefined,
238
252
  template_key: opts.template,
239
253
  storage_size: opts.storage,
240
254
  replicas: opts.replicas,