deepminer-cli 0.1.15 → 0.1.16

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepminer-cli",
3
- "version": "0.1.15",
3
+ "version": "0.1.16",
4
4
  "description": "DeepMiner CLI - Command-line tool for DM system with cross-platform support, JWT authentication, and workspace management",
5
5
  "keywords": [
6
6
  "deepminer",
@@ -11,14 +11,7 @@
11
11
  "jwt",
12
12
  "api-client"
13
13
  ],
14
- "homepage": "https://www.npmjs.com/package/deepMiner-cli",
15
- "repository": {
16
- "type": "git",
17
- "url": "https://github.com/xmingai/deepMiner-cli.git"
18
- },
19
- "bugs": {
20
- "url": "https://code.mlamp.cn/dm/packages/-/issues"
21
- },
14
+ "homepage": "https://www.npmjs.com/package/deepminer-cli",
22
15
  "license": "MIT",
23
16
  "author": "XMingAI",
24
17
  "bin": {
@@ -30,10 +23,13 @@
30
23
  "bin/dm-cli-linux-amd64",
31
24
  "bin/dm-cli-windows-amd64.exe",
32
25
  "scripts/run.js",
26
+ "scripts/install-completion.js",
27
+ "scripts/_dm-cli",
33
28
  "README.md",
34
29
  "LICENSE"
35
30
  ],
36
31
  "scripts": {
32
+ "postinstall": "node scripts/install-completion.js",
37
33
  "build": "make build-all",
38
34
  "test": "go test ./..."
39
35
  },
@@ -0,0 +1,29 @@
1
+ #compdef dm-cli
2
+
3
+ _dm_cli() {
4
+ local -a commands
5
+
6
+ commands=(
7
+ 'config:管理配置'
8
+ 'auth:用户认证'
9
+ 'agent:AI 助手相关命令'
10
+ 'version:显示版本号'
11
+ '--help:显示帮助信息'
12
+ )
13
+
14
+ _describe 'command' commands
15
+
16
+ case $words[2] in
17
+ config)
18
+ _describe 'config' '(init show)'
19
+ ;;
20
+ auth)
21
+ _describe 'auth' '(login logout status switch)'
22
+ ;;
23
+ agent)
24
+ _describe 'agent' '(start_thread)'
25
+ ;;
26
+ esac
27
+ }
28
+
29
+ _dm_cli
@@ -0,0 +1,31 @@
1
+ #!/usr/bin/env node
2
+
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+ const os = require('os');
6
+ const { execSync } = require('child_process');
7
+
8
+ // Only for zsh users
9
+ if (process.env.SHELL && !process.env.SHELL.includes('zsh')) {
10
+ process.exit(0);
11
+ }
12
+
13
+ const homeDir = os.homedir();
14
+ const completionDir = path.join(homeDir, '.zsh', 'completions');
15
+ const completionFile = path.join(completionDir, '_dm-cli');
16
+ const sourceFile = path.join(__dirname, '_dm-cli');
17
+
18
+ try {
19
+ // Create completion directory if it doesn't exist
20
+ if (!fs.existsSync(completionDir)) {
21
+ fs.mkdirSync(completionDir, { recursive: true });
22
+ }
23
+
24
+ // Copy completion script
25
+ if (fs.existsSync(sourceFile)) {
26
+ fs.copyFileSync(sourceFile, completionFile);
27
+ fs.chmodSync(completionFile, 0o644);
28
+ }
29
+ } catch (err) {
30
+ // Silent fail - completion is optional
31
+ }