@kevisual/cli 0.0.72 → 0.0.74

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/dist/assistant.js CHANGED
@@ -71518,7 +71518,7 @@ program.addCommand(pageListCommand);
71518
71518
 
71519
71519
  // src/command/asst-server/index.ts
71520
71520
  import { spawnSync as spawnSync4 } from "node:child_process";
71521
- var command = new Command("server").description("启动服务").option("-d, --daemon", "是否以守护进程方式运行").option("-n, --name <name>", "服务名称").option("-p, --port <port>", "服务端口").option("-s, --start", "是否启动服务").option("-i, --home", "是否以home方式运行").action((options) => {
71521
+ var command = new Command("server").description("启动服务").option("-d, --daemon", "是否以守护进程方式运行").option("-n, --name <name>", "服务名称", "assistant-server").option("-p, --port <port>", "服务端口").option("-s, --start", "是否启动服务").option("-e, --interpreter <interpreter>", "指定使用的解释器", "bun").action((options) => {
71522
71522
  const { port } = options;
71523
71523
  const [_interpreter, execPath] = process.argv;
71524
71524
  const shellCommands = [];
@@ -71534,8 +71534,8 @@ var command = new Command("server").description("启动服务").option("-d, --da
71534
71534
  if (port) {
71535
71535
  shellCommands.push(`-p ${port}`);
71536
71536
  }
71537
- if (options.home) {
71538
- shellCommands.push("--home");
71537
+ if (options.interpreter) {
71538
+ shellCommands.push(`-e ${options.interpreter}`);
71539
71539
  }
71540
71540
  const basename = _interpreter.split("/").pop();
71541
71541
  if (basename.includes("bun")) {
package/dist/envision.js CHANGED
@@ -40664,8 +40664,8 @@ InitEnv.init();
40664
40664
  var version = useContextKey("version", () => {
40665
40665
  let version2 = "0.0.64";
40666
40666
  try {
40667
- if ("0.0.71")
40668
- version2 = "0.0.71";
40667
+ if ("0.0.73")
40668
+ version2 = "0.0.73";
40669
40669
  } catch (e) {}
40670
40670
  return version2;
40671
40671
  });
@@ -47645,7 +47645,7 @@ var publishCommand = new Command("publish").description("发布应用").option("
47645
47645
  const config2 = await getConfig();
47646
47646
  console.log("发布逻辑实现", { key, version: version2, config: config2 });
47647
47647
  });
47648
- var deployLoadFn2 = async (id, fileKey, force = false, install2 = false) => {
47648
+ var deployLoadFn2 = async (id, fileKey, force = true, install2 = false) => {
47649
47649
  if (!id) {
47650
47650
  console.error(chalk2.red("id is required"));
47651
47651
  return;
@@ -47753,9 +47753,9 @@ var packCommand = new Command("pack").description("打包应用, 使用 package.
47753
47753
  program.parse(deployCommand);
47754
47754
  }
47755
47755
  });
47756
- var packDeployCommand = new Command("pack-deploy").argument("<id>", "id").option("-k, --key <key>", "fileKey, 服务器的部署文件夹的列表").option("-f --force", "force").option("-i, --install ", "install dependencies").action(async (id, opts) => {
47757
- let { force, key, install: install2 } = opts || {};
47758
- const res = await deployLoadFn2(id, key, force, install2);
47756
+ var packDeployCommand = new Command("pack-deploy").argument("<id>", "id").option("-k, --key <key>", "fileKey, 服务器的部署文件夹的列表").option("-i, --install ", "install dependencies").action(async (id, opts) => {
47757
+ let { key, install: install2 } = opts || {};
47758
+ const res = await deployLoadFn2(id, key, true, install2);
47759
47759
  });
47760
47760
  program.addCommand(packDeployCommand);
47761
47761
  program.addCommand(publishCommand);
@@ -48933,6 +48933,99 @@ command9.addCommand(updateCommand);
48933
48933
  command9.addCommand(deleteCommand);
48934
48934
  program.addCommand(command9);
48935
48935
 
48936
+ // src/query/query-secret/query-secret.ts
48937
+ class QueryConfig2 {
48938
+ query;
48939
+ constructor(opts) {
48940
+ this.query = opts?.query || new Query2;
48941
+ }
48942
+ async post(data) {
48943
+ return this.query.post({ path: "secret", ...data });
48944
+ }
48945
+ async getItem({ id, key }, opts) {
48946
+ return this.post({
48947
+ key: "get",
48948
+ data: {
48949
+ id,
48950
+ key
48951
+ },
48952
+ ...opts
48953
+ });
48954
+ }
48955
+ async updateItem(data, opts) {
48956
+ return this.post({
48957
+ key: "update",
48958
+ data,
48959
+ ...opts
48960
+ });
48961
+ }
48962
+ async deleteItem(data, opts) {
48963
+ return this.post({
48964
+ key: "delete",
48965
+ data
48966
+ });
48967
+ }
48968
+ async listItems(opts) {
48969
+ return this.post({
48970
+ key: "list",
48971
+ ...opts
48972
+ });
48973
+ }
48974
+ }
48975
+
48976
+ // src/command/config-secret-remote.ts
48977
+ var queryConfig2 = new QueryConfig2({ query });
48978
+ var command10 = new Command("remote-secret").alias("rs").description("获取或设置远程配置");
48979
+ var getCommand3 = new Command("get").option("-k, --key <key>", "配置键名").action(async (options) => {
48980
+ const { key } = options || {};
48981
+ if (!key) {
48982
+ console.log("Please provide a key using -k or --key option.");
48983
+ return;
48984
+ }
48985
+ const res = await queryConfig2.getItem({ id: key });
48986
+ console.log("res Config Result:", showMore(res.data));
48987
+ });
48988
+ var listCommand2 = new Command("list").description("列出所有配置").action(async () => {
48989
+ const res = await queryConfig2.listItems();
48990
+ if (res.code === 200) {
48991
+ const list2 = res.data?.list || [];
48992
+ list2.forEach((item) => {
48993
+ console.log(item.id, item.key, showMore(item));
48994
+ });
48995
+ } else {
48996
+ console.log("获取错误:", res.message);
48997
+ }
48998
+ });
48999
+ var updateCommand2 = new Command("update").description("更新远程配置").option("-i, --id <id>", "配置ID").option("-t, --title <title>", "配置值").option("-d, --description <description>", "配置数据,JSON格式").action(async (options) => {
49000
+ const { id, title, description } = options || {};
49001
+ let updateData = {};
49002
+ if (title) {
49003
+ updateData.title = title;
49004
+ }
49005
+ if (description) {
49006
+ updateData.description = description;
49007
+ }
49008
+ if (id) {
49009
+ updateData.id = id;
49010
+ }
49011
+ const res = await queryConfig2.updateItem(updateData);
49012
+ console.log("修改结果:", showMore(res));
49013
+ });
49014
+ var deleteCommand2 = new Command("delete").description("删除远程配置").option("-i, --id <id>", "配置ID").option("-k, --key <key>", "配置键名").action(async (options) => {
49015
+ const { key, id } = options || {};
49016
+ if (!key && !id) {
49017
+ console.log("请提供配置键名或配置ID,使用 -k 或 --key 选项,或 -i 或 --id 选项。");
49018
+ return;
49019
+ }
49020
+ const res = await queryConfig2.deleteItem({ key, id });
49021
+ console.log("Delete Config Result:", showMore(res));
49022
+ });
49023
+ command10.addCommand(listCommand2);
49024
+ command10.addCommand(getCommand3);
49025
+ command10.addCommand(updateCommand2);
49026
+ command10.addCommand(deleteCommand2);
49027
+ program.addCommand(command10);
49028
+
48936
49029
  // src/index.ts
48937
49030
  var runParser = async (argv) => {
48938
49031
  program.parse(argv);
package/package.json CHANGED
@@ -1,79 +1,85 @@
1
- {
2
- "name": "@kevisual/cli",
3
- "version": "0.0.72",
4
- "description": "envision 命令行工具",
5
- "type": "module",
6
- "basename": "/root/cli",
7
- "app": {
8
- "key": "cli",
9
- "entry": "dist/app.mjs",
10
- "type": "pm2-system-app",
11
- "runtime": [
12
- "cli"
13
- ]
14
- },
15
- "bin": {
16
- "envision": "bin/envision.js",
17
- "ev": "bin/envision.js",
18
- "assistant": "bin/assistant.js",
19
- "assistant-server": "bin/assistant-server.js",
20
- "asst": "bin/assistant.js",
21
- "asst-server": "bin/assistant-server.js"
22
- },
23
- "files": [
24
- "dist",
25
- "bin",
26
- "bun.config.mjs"
27
- ],
28
- "scripts": {
29
- "dev": "bun src/run.ts ",
30
- "dev:tsx": "tsx src/run.ts ",
31
- "dev:server": "cd assistant && bun --watch src/run-server.ts ",
32
- "build": "rimraf dist && bun run bun.config.mjs",
33
- "deploy": "ev pack -u -p -m no",
34
- "pub:me": "npm publish --registry https://npm.xiongxiao.me --tag beta",
35
- "postbuild": "cd assistant && pnpm build ",
36
- "dts": "dts-bundle-generator --external-inlines=@types/jsonwebtoken src/index.ts -o dist/index.d.ts "
37
- },
38
- "keywords": [
39
- "kevisual",
40
- "cli"
41
- ],
42
- "author": "abearxiong",
43
- "dependencies": {
44
- "@kevisual/context": "^0.0.4",
45
- "micromatch": "^4.0.8",
46
- "pm2": "^6.0.14",
47
- "semver": "^7.7.3"
48
- },
49
- "devDependencies": {
50
- "@kevisual/dts": "^0.0.3",
51
- "@kevisual/load": "^0.0.6",
52
- "@kevisual/logger": "^0.0.4",
53
- "@kevisual/query": "0.0.31",
54
- "@kevisual/query-login": "0.0.7",
55
- "@types/bun": "^1.3.3",
56
- "@types/crypto-js": "^4.2.2",
57
- "@types/jsonwebtoken": "^9.0.10",
58
- "@types/micromatch": "^4.0.10",
59
- "@types/node": "^24.10.1",
60
- "@types/semver": "^7.7.1",
61
- "chalk": "^5.6.2",
62
- "commander": "^14.0.2",
63
- "crypto-js": "^4.2.0",
64
- "fast-glob": "^3.3.3",
65
- "filesize": "^11.0.13",
66
- "form-data": "^4.0.5",
67
- "ignore": "^7.0.5",
68
- "inquirer": "^13.0.2",
69
- "jsonwebtoken": "^9.0.3",
70
- "tar": "^7.5.2",
71
- "zustand": "^5.0.9"
72
- },
73
- "engines": {
74
- "node": ">=22.0.0"
75
- },
76
- "publishConfig": {
77
- "access": "public"
78
- }
1
+ {
2
+ "name": "@kevisual/cli",
3
+ "version": "0.0.74",
4
+ "description": "envision 命令行工具",
5
+ "type": "module",
6
+ "basename": "/root/cli",
7
+ "app": {
8
+ "key": "cli",
9
+ "entry": "dist/app.mjs",
10
+ "type": "pm2-system-app",
11
+ "runtime": [
12
+ "cli"
13
+ ]
14
+ },
15
+ "bin": {
16
+ "envision": "bin/envision.js",
17
+ "ev": "bin/envision.js",
18
+ "assistant": "bin/assistant.js",
19
+ "assistant-server": "bin/assistant-server.js",
20
+ "asst": "bin/assistant.js",
21
+ "asst-server": "bin/assistant-server.js"
22
+ },
23
+ "files": [
24
+ "dist",
25
+ "bin",
26
+ "bun.config.mjs"
27
+ ],
28
+ "scripts": {
29
+ "dev": "bun src/run.ts ",
30
+ "dev:tsx": "tsx src/run.ts ",
31
+ "dev:server": "cd assistant && bun --watch src/run-server.ts ",
32
+ "build": "rimraf dist && bun run bun.config.mjs",
33
+ "deploy": "ev pack -u -p -m no",
34
+ "pub:me": "npm publish --registry https://npm.xiongxiao.me --tag beta",
35
+ "postbuild": "cd assistant && pnpm build ",
36
+ "dts": "dts-bundle-generator --external-inlines=@types/jsonwebtoken src/index.ts -o dist/index.d.ts "
37
+ },
38
+ "keywords": [
39
+ "kevisual",
40
+ "cli"
41
+ ],
42
+ "author": "abearxiong",
43
+ "dependencies": {
44
+ "@kevisual/context": "^0.0.4",
45
+ "@kevisual/hot-api": "^0.0.3",
46
+ "@nut-tree-fork/nut-js": "^4.2.6",
47
+ "eventemitter3": "^5.0.1",
48
+ "lowdb": "^7.0.1",
49
+ "lru-cache": "^11.2.4",
50
+ "micromatch": "^4.0.8",
51
+ "pm2": "^6.0.14",
52
+ "semver": "^7.7.3",
53
+ "unstorage": "^1.17.3"
54
+ },
55
+ "devDependencies": {
56
+ "@kevisual/dts": "^0.0.3",
57
+ "@kevisual/load": "^0.0.6",
58
+ "@kevisual/logger": "^0.0.4",
59
+ "@kevisual/query": "0.0.31",
60
+ "@kevisual/query-login": "0.0.7",
61
+ "@types/bun": "^1.3.3",
62
+ "@types/crypto-js": "^4.2.2",
63
+ "@types/jsonwebtoken": "^9.0.10",
64
+ "@types/micromatch": "^4.0.10",
65
+ "@types/node": "^24.10.1",
66
+ "@types/semver": "^7.7.1",
67
+ "chalk": "^5.6.2",
68
+ "commander": "^14.0.2",
69
+ "crypto-js": "^4.2.0",
70
+ "fast-glob": "^3.3.3",
71
+ "filesize": "^11.0.13",
72
+ "form-data": "^4.0.5",
73
+ "ignore": "^7.0.5",
74
+ "inquirer": "^13.0.2",
75
+ "jsonwebtoken": "^9.0.3",
76
+ "tar": "^7.5.2",
77
+ "zustand": "^5.0.9"
78
+ },
79
+ "engines": {
80
+ "node": ">=22.0.0"
81
+ },
82
+ "publishConfig": {
83
+ "access": "public"
84
+ }
79
85
  }
package/readme.md CHANGED
@@ -1,8 +1,8 @@
1
- # 可视化控制台工具
2
-
3
- ## 1. 上传文件
4
-
5
- ## 2. 下载文件
6
-
7
- ## 3. 同步模板
8
-
1
+ # 可视化控制台工具
2
+
3
+ ## 1. 上传文件
4
+
5
+ ## 2. 下载文件
6
+
7
+ ## 3. 同步模板
8
+