@teammy/cli 0.0.1 → 0.0.3

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,48 +1,24 @@
1
- # Teammy
1
+ # Teammy client
2
2
 
3
- 团队 AI 协作共享和内容分发中枢。
4
-
5
- **当前版本是用于建立 npm 包和 CLI 入口的最小骨架,只提供帮助与版本查询。以下产品能力尚未实现。**
6
-
7
- ## 安装
8
-
9
- 需要 Node.js 22 或更新版本。
3
+ 成员设备上的 Teammy 命令行客户端,需要 Node.js 22.13 或更新版本。
10
4
 
11
5
  ```sh
12
- npm install -g @teammy/cli
6
+ npm install -g @teammy/cli@0.0.3
13
7
  teammy --help
14
8
  teammy --version
9
+ teammy server-info --url http://127.0.0.1:4317
15
10
  ```
16
11
 
17
- 也可以直接运行:
18
-
19
- ```sh
20
- npx @teammy/cli --help
21
- ```
22
-
23
- ## 产品方向
24
-
25
- 在 Git 项目目录注册并绑定项目,为团队提供:
26
-
27
- - **文件同步**:按项目约定同步 `spec/`、`plan/`、`review/` 等自定义目录,让进展及时共享。
28
- - **Session 共享**:通过项目级 hook 自动收集协作会话,支持检索、互相查阅和接力。
29
- - **AI 进展摘要**:由中枢连接的 LLM 为会话打标、汇总进度。
30
- - **简要看板**:集中展示文件同步信息、AI 工作摘要和团队进展。
12
+ `server-info` 查询服务器版本与协议能力,以 JSON 输出结果;协议不兼容或连接失败时返回非零退出码。此命令不保存配置或绑定工作区。
31
13
 
32
- 同步独立于 Git 提交和推送。交互以自动化为主,减少用户操作、上下文注入和对 skill 的依赖。后续接入以项目绑定时约定的共享范围为边界。
14
+ 管理员在网页建立成员 ID 后,运行 `connect --url URL --member ID`,再运行 `sync`。默认共享根为 `./workspaces`。支持旧 `--token-file FILE` 接入和 `status --root DIR`;绑定与设备身份保存在本地 SQLite。默认状态目录为 `~/.teammy/client`,可通过 `--state-dir DIR` 指定。
33
15
 
34
- ## 本地开发
16
+ 连接后运行 `teammy sync --root DIR` 持续同步文件,默认约一分钟检查一次并逐文件等待一分钟稳定。`sync --once` 执行一轮,`--settle-ms 0` 显式允许立即处理已保存内容。上传自己的成员目录,下载其他成员目录;本地镜像冲突会保留并报告。运行 `teammy sync --help` 查看恢复与调度选项。会话来源可通过 `teammy session discover --agent AGENT --project-dir DIR` 或 `session track --agent AGENT --file PATH --project-dir DIR` 登记,之后由 sync 采集上传。支持 Claude Code、Codex、Cursor CLI SQLite、Pi v3、DSH v0;DSH 压缩日志需要 Node.js 22.15+ 或 24+。`session hook` 提供不等待网络的本地线索入口,不自动修改宿主配置。
35
17
 
36
- 当前使用原生 JavaScript ESM,无运行时依赖,无需构建。
37
-
38
- ```sh
39
- npm install
40
- npm run check
41
- node bin/teammy.js --help
42
- ```
18
+ 使用 `session list`、`session search --query TEXT`、`session read --owner MEMBER --key KEY` 查看团队会话,`session sources` 查看来源与错误,`sync --sessions-only` 只运行会话链路。所有命令支持 `--root DIR` 和 `--state-dir DIR`。`teammy session --help` 查看完整参数。
43
19
 
44
- 需要本地全局命令时运行 `npm link`。发布前使用 `npm pack` 生成 `.tgz`,完成包内容、安装和命令验收后,通过 `npm publish ./包名-版本号.tgz --access public --auth-type=web --registry=https://registry.npmjs.org` 发布同一份产物。
20
+ 服务器单独安装 `@teammy/server`,启动命令为 `teammy-server`。原有 `teammy server` 命令会提示迁移方式。
45
21
 
46
- ## License
22
+ 许可证随包附于 `dist/LICENSE`。
47
23
 
48
- MIT
24
+ 公共配置位于共享根 `.teammy.json`,凭证仅留在本机状态库。网页设置约每 30 秒热应用,显式 `--interval-ms` / `--settle-ms` 仍优先并显示为覆盖。网页重置设备后,使用原 connect 命令加 `--reconnect` 重新接入,保留已有同步基线。
package/bin/teammy.js CHANGED
@@ -1,30 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  import { readFileSync } from 'node:fs';
4
+ import { runCli } from '../dist/main.js';
4
5
 
5
- const { version } = JSON.parse(
6
- readFileSync(new URL('../package.json', import.meta.url), 'utf8'),
7
- );
6
+ const { version } = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8'));
8
7
 
9
- const help = `teammy — a shared hub for team AI collaboration
10
-
11
- Usage:
12
- teammy Show this help
13
- teammy --help Show this help
14
- teammy --version Show the installed version
15
-
16
- This is an early scaffold. Project binding, file sync, session sharing,
17
- and the dashboard are planned and are not available yet.
18
- `;
19
-
20
- const args = process.argv.slice(2);
21
- const command = args[0];
22
-
23
- if (args.length === 0 || (args.length === 1 && ['--help', '-h', 'help'].includes(command))) {
24
- process.stdout.write(help);
25
- } else if (args.length === 1 && ['--version', '-v', 'version'].includes(command)) {
26
- process.stdout.write(`${version}\n`);
27
- } else {
28
- process.stderr.write('Unknown command or arguments. Run "teammy --help" for usage.\n');
29
- process.exitCode = 1;
30
- }
8
+ process.exitCode = await runCli(process.argv.slice(2), version);