@exonix/tchat-cli 1.1.9 → 1.1.11

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
@@ -1,88 +1,88 @@
1
- # @exonix/tchat-cli
2
-
3
- TChat platform CLI tool - AI friendly command line interface.
4
-
5
- ## Install
6
-
7
- ```bash
8
- npm install -g @exonix/tchat-cli
9
- ```
10
-
11
- ## Configure
12
-
13
- Token 获取方式(按优先级):
14
-
15
- 1. 容器环境变量 `TCHAT_TOKEN`(若存在则直接使用)
16
- 2. 环境变量 `TCHAT_ACCESSTOKEN`
17
- 3. 配置文件 `~/.tchat-cli/config.yaml` 中的 `access_token` 字段
18
- 4. 通过 `tchat-cli token get --uid <UID>` 获取并自动保存
19
-
20
- ```bash
21
- # 方式一:容器环境变量(最高优先级)
22
- export TCHAT_TOKEN="your_access_token"
23
-
24
- # 方式二:环境变量
25
- export TCHAT_ACCESSTOKEN="your_access_token"
26
-
27
- # 方式三:H5 登录(自动保存到配置文件)
28
- tchat-cli auth login
29
-
30
- # 方式四:通过 IDM 接口获取 token
31
- tchat-cli token get --uid <UID>
32
- ```
33
-
34
- ## Usage
35
-
36
- ```bash
37
- # Show help
38
- tchat-cli --help
39
-
40
- # Authentication
41
- tchat-cli auth login
42
- tchat-cli auth status
43
-
44
- # Token management
45
- tchat-cli token get --uid <UID>
46
-
47
- # Widget categories
48
- tchat-cli widget list
49
- tchat-cli widget list --keyword 考勤
50
-
51
- # Message search
52
- tchat-cli msg search --session "g@10000219039" --sender user001 --type SESSION_RECENT --limit 20
53
-
54
- # Contact search(支持多关键词 OR 关系)
55
- tchat-cli contact search -k "张三"
56
- tchat-cli contact search -k "技术" -k "经理" --page 0 --size 20
57
-
58
- # File management
59
- tchat-cli file list --type 1
60
- tchat-cli file list --type 1 --name "项目"
61
-
62
- # IM
63
- tchat-cli im session-list
64
- tchat-cli im message-search --session "g@10001" --limit 100
65
-
66
- # Schedule
67
- tchat-cli schedule list --uid zhangsan --date 1704067200000 --date2 1706745600000
68
- tchat-cli schedule create -d '{"subject":"会议","startTime":1704182400000,"endTime":1704186000000}'
69
- tchat-cli schedule room-list --start 1704182400000 --end 1704186000000
70
-
71
- # Meeting
72
- tchat-cli meeting create -d '{"type":0,"subject":"评审","startTime":1704182400000,"endTime":1704186000000,"meetingType":0}'
73
- tchat-cli meeting list
74
- tchat-cli meeting history
75
- tchat-cli meeting record-settings -d '{"meetingRecordId":"rec_xxx","meetingId":"mtg_xxx","sharingConfig":{"enableSharing":true,"shareScope":1}}'
76
-
77
- # Atlas - 挑T帖搜索(仅职员)
78
- tchat-cli atlas search --condition "技术创新" --start 1715587200000 --end 1716192000000
79
- tchat-cli atlas search --condition "项目管理" --start 1715587200000 --end 1716192000000 --page 1 --size 20
80
- ```
81
-
82
- ## Docs
83
-
84
- See [USAGE.md](https://github.com/your-org/tchat-cli/blob/main/USAGE.md)
85
-
86
- ## License
87
-
88
- MIT
1
+ # @exonix/tchat-cli
2
+
3
+ TChat platform CLI tool - AI friendly command line interface.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install -g @exonix/tchat-cli
9
+ ```
10
+
11
+ ## Configure
12
+
13
+ Token 获取方式(按优先级):
14
+
15
+ 1. 容器环境变量 `TCHAT_TOKEN`(若存在则直接使用)
16
+ 2. 环境变量 `TCHAT_ACCESSTOKEN`
17
+ 3. 配置文件 `~/.tchat-cli/config.yaml` 中的 `access_token` 字段
18
+ 4. 通过 `tchat-cli token get --uid <UID>` 获取并自动保存
19
+
20
+ ```bash
21
+ # 方式一:容器环境变量(最高优先级)
22
+ export TCHAT_TOKEN="your_access_token"
23
+
24
+ # 方式二:环境变量
25
+ export TCHAT_ACCESSTOKEN="your_access_token"
26
+
27
+ # 方式三:H5 登录(自动保存到配置文件)
28
+ tchat-cli auth login
29
+
30
+ # 方式四:通过 IDM 接口获取 token
31
+ tchat-cli token get --uid <UID>
32
+ ```
33
+
34
+ ## Usage
35
+
36
+ ```bash
37
+ # Show help
38
+ tchat-cli --help
39
+
40
+ # Authentication
41
+ tchat-cli auth login
42
+ tchat-cli auth status
43
+
44
+ # Token management
45
+ tchat-cli token get --uid <UID>
46
+
47
+ # Widget categories
48
+ tchat-cli widget list
49
+ tchat-cli widget list --keyword 考勤
50
+
51
+ # Message search
52
+ tchat-cli msg search --session "g@10000219039" --sender user001 --type SESSION_RECENT --limit 20
53
+
54
+ # Contact search(支持多关键词 OR 关系)
55
+ tchat-cli contact search -k "张三"
56
+ tchat-cli contact search -k "技术" -k "经理" --page 0 --size 20
57
+
58
+ # File management
59
+ tchat-cli file list --type 1
60
+ tchat-cli file list --type 1 --name "项目"
61
+
62
+ # IM
63
+ tchat-cli im session-list
64
+ tchat-cli im message-search --session "g@10001" --limit 100
65
+
66
+ # Schedule
67
+ tchat-cli schedule list --uid zhangsan --date 1704067200000 --date2 1706745600000
68
+ tchat-cli schedule create -d '{"subject":"会议","startTime":1704182400000,"endTime":1704186000000}'
69
+ tchat-cli schedule room-list --start 1704182400000 --end 1704186000000
70
+
71
+ # Meeting
72
+ tchat-cli meeting create -d '{"type":0,"subject":"评审","startTime":1704182400000,"endTime":1704186000000,"meetingType":0}'
73
+ tchat-cli meeting list
74
+ tchat-cli meeting history
75
+ tchat-cli meeting record-settings -d '{"meetingRecordId":"rec_xxx","meetingId":"mtg_xxx","sharingConfig":{"enableSharing":true,"shareScope":1}}'
76
+
77
+ # Atlas - 挑T帖搜索(仅职员)
78
+ tchat-cli atlas search --condition "技术创新" --start 1715587200000 --end 1716192000000
79
+ tchat-cli atlas search --condition "项目管理" --start 1715587200000 --end 1716192000000 --page 1 --size 20
80
+ ```
81
+
82
+ ## Docs
83
+
84
+ See [USAGE.md](https://github.com/your-org/tchat-cli/blob/main/USAGE.md)
85
+
86
+ ## License
87
+
88
+ MIT
package/bin/tchat-cli CHANGED
@@ -1,18 +1,18 @@
1
- #!/usr/bin/env node
2
- "use strict";
3
-
4
- const { execFileSync } = require("child_process");
5
- const path = require("path");
6
- const { findBinary } = require("../scripts/install.js");
7
-
8
- const binPath = findBinary();
9
- const args = process.argv.slice(2);
10
-
11
- try {
12
- execFileSync(binPath, args, { stdio: "inherit" });
13
- } catch (err) {
14
- if (err.status !== undefined) {
15
- process.exit(err.status);
16
- }
17
- throw err;
18
- }
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+
4
+ const { execFileSync } = require("child_process");
5
+ const path = require("path");
6
+ const { findBinary } = require("../scripts/install.js");
7
+
8
+ const binPath = findBinary();
9
+ const args = process.argv.slice(2);
10
+
11
+ try {
12
+ execFileSync(binPath, args, { stdio: "inherit" });
13
+ } catch (err) {
14
+ if (err.status !== undefined) {
15
+ process.exit(err.status);
16
+ }
17
+ throw err;
18
+ }
package/package.json CHANGED
@@ -1,28 +1,28 @@
1
- {
2
- "name": "@exonix/tchat-cli",
3
- "version": "1.1.9",
4
- "description": "TChat CLI - AI friendly command line tool for TChat platform",
5
- "keywords": ["tchat", "cli", "teamwork", "ai"],
6
- "license": "MIT",
7
- "bin": {
8
- "tchat-cli": "bin/tchat-cli"
9
- },
10
- "files": ["bin/", "scripts/"],
11
- "scripts": {
12
- "postinstall": "node scripts/install.js"
13
- },
14
- "optionalDependencies": {
15
- "@exonix/tchat-cli-darwin-arm64": "1.1.9",
16
- "@exonix/tchat-cli-darwin-x64": "1.1.9",
17
- "@exonix/tchat-cli-linux-x64": "1.1.9",
18
- "@exonix/tchat-cli-linux-arm64": "1.1.9",
19
- "@exonix/tchat-cli-win32-x64": "1.1.9"
20
- },
21
- "repository": {
22
- "type": "git",
23
- "url": "https://github.com/your-org/tchat-cli.git"
24
- },
25
- "engines": {
26
- "node": ">=14"
27
- }
28
- }
1
+ {
2
+ "name": "@exonix/tchat-cli",
3
+ "version": "1.1.11",
4
+ "description": "TChat CLI - AI friendly command line tool for TChat platform",
5
+ "keywords": ["tchat", "cli", "teamwork", "ai"],
6
+ "license": "MIT",
7
+ "bin": {
8
+ "tchat-cli": "bin/tchat-cli"
9
+ },
10
+ "files": ["bin/", "scripts/"],
11
+ "scripts": {
12
+ "postinstall": "node scripts/install.js"
13
+ },
14
+ "optionalDependencies": {
15
+ "@exonix/tchat-cli-darwin-arm64": "1.1.11",
16
+ "@exonix/tchat-cli-darwin-x64": "1.1.11",
17
+ "@exonix/tchat-cli-linux-x64": "1.1.11",
18
+ "@exonix/tchat-cli-linux-arm64": "1.1.11",
19
+ "@exonix/tchat-cli-win32-x64": "1.1.11"
20
+ },
21
+ "repository": {
22
+ "type": "git",
23
+ "url": "https://github.com/your-org/tchat-cli.git"
24
+ },
25
+ "engines": {
26
+ "node": ">=14"
27
+ }
28
+ }
@@ -1,63 +1,63 @@
1
- #!/usr/bin/env node
2
- "use strict";
3
-
4
- const fs = require("fs");
5
- const path = require("path");
6
-
7
- const PLATFORM_PACKAGES = {
8
- "darwin-arm64": "@exonix/tchat-cli-darwin-arm64",
9
- "darwin-x64": "@exonix/tchat-cli-darwin-x64",
10
- "linux-x64": "@exonix/tchat-cli-linux-x64",
11
- "linux-arm64": "@exonix/tchat-cli-linux-arm64",
12
- "win32-x64": "@exonix/tchat-cli-win32-x64",
13
- };
14
-
15
- function getPlatformKey() {
16
- const platform = process.platform;
17
- const arch = process.arch;
18
-
19
- // Normalize
20
- const p = platform === "win32" ? "win32" : platform;
21
- const a = arch === "x64" ? "x64" : arch === "arm64" ? "arm64" : arch;
22
-
23
- return `${p}-${a}`;
24
- }
25
-
26
- function findBinary() {
27
- const key = getPlatformKey();
28
- const pkgName = PLATFORM_PACKAGES[key];
29
-
30
- if (!pkgName) {
31
- console.error(
32
- `@exonix/tchat-cli: Unsupported platform: ${process.platform} ${process.arch}`
33
- );
34
- console.error(`@exonix/tchat-cli: Supported: ${Object.keys(PLATFORM_PACKAGES).join(", ")}`);
35
- process.exit(1);
36
- }
37
-
38
- try {
39
- const pkgDir = path.dirname(require.resolve(pkgName + "/package.json"));
40
- const ext = process.platform === "win32" ? ".exe" : "";
41
- const binPath = path.join(pkgDir, "bin", "tchat-cli" + ext);
42
-
43
- if (fs.existsSync(binPath)) {
44
- return binPath;
45
- }
46
- } catch (e) {
47
- // package not found
48
- }
49
-
50
- console.error(
51
- `@exonix/tchat-cli: Could not find ${pkgName} binary. Try reinstalling:`
52
- );
53
- console.error(` npm install -g @exonix/tchat-cli`);
54
- process.exit(1);
55
- }
56
-
57
- // During postinstall, just verify the binary exists
58
- if (require.main === module) {
59
- const binPath = findBinary();
60
- console.log(`@exonix/tchat-cli: Binary found at ${binPath}`);
61
- }
62
-
63
- module.exports = { findBinary };
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+
4
+ const fs = require("fs");
5
+ const path = require("path");
6
+
7
+ const PLATFORM_PACKAGES = {
8
+ "darwin-arm64": "@exonix/tchat-cli-darwin-arm64",
9
+ "darwin-x64": "@exonix/tchat-cli-darwin-x64",
10
+ "linux-x64": "@exonix/tchat-cli-linux-x64",
11
+ "linux-arm64": "@exonix/tchat-cli-linux-arm64",
12
+ "win32-x64": "@exonix/tchat-cli-win32-x64",
13
+ };
14
+
15
+ function getPlatformKey() {
16
+ const platform = process.platform;
17
+ const arch = process.arch;
18
+
19
+ // Normalize
20
+ const p = platform === "win32" ? "win32" : platform;
21
+ const a = arch === "x64" ? "x64" : arch === "arm64" ? "arm64" : arch;
22
+
23
+ return `${p}-${a}`;
24
+ }
25
+
26
+ function findBinary() {
27
+ const key = getPlatformKey();
28
+ const pkgName = PLATFORM_PACKAGES[key];
29
+
30
+ if (!pkgName) {
31
+ console.error(
32
+ `@exonix/tchat-cli: Unsupported platform: ${process.platform} ${process.arch}`
33
+ );
34
+ console.error(`@exonix/tchat-cli: Supported: ${Object.keys(PLATFORM_PACKAGES).join(", ")}`);
35
+ process.exit(1);
36
+ }
37
+
38
+ try {
39
+ const pkgDir = path.dirname(require.resolve(pkgName + "/package.json"));
40
+ const ext = process.platform === "win32" ? ".exe" : "";
41
+ const binPath = path.join(pkgDir, "bin", "tchat-cli" + ext);
42
+
43
+ if (fs.existsSync(binPath)) {
44
+ return binPath;
45
+ }
46
+ } catch (e) {
47
+ // package not found
48
+ }
49
+
50
+ console.error(
51
+ `@exonix/tchat-cli: Could not find ${pkgName} binary. Try reinstalling:`
52
+ );
53
+ console.error(` npm install -g @exonix/tchat-cli`);
54
+ process.exit(1);
55
+ }
56
+
57
+ // During postinstall, just verify the binary exists
58
+ if (require.main === module) {
59
+ const binPath = findBinary();
60
+ console.log(`@exonix/tchat-cli: Binary found at ${binPath}`);
61
+ }
62
+
63
+ module.exports = { findBinary };