oh-my-imagicma 0.1.13 → 0.1.14

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
@@ -485,7 +485,7 @@ bun test
485
485
  - `--tag beta` 用于发预发布 dist-tag
486
486
  - `--skip-git-check` 只建议在明确知道风险时使用
487
487
  - `--dry-run` 只做 build 和打包预演,不改版本、不发包
488
- - `--deploy helper|main|all` 会在发布成功后立刻更新目标服务器
488
+ - `--deploy helper` 会在发布成功后立刻更新目标服务器
489
489
  - `--otp` 只在你的包设置为“必须交互式 2FA”时才需要
490
490
 
491
491
  5. **一键发布并更新服务器**
@@ -498,19 +498,28 @@ bun test
498
498
  ```bash
499
499
  npm run release -- patch --deploy helper
500
500
  ```
501
- 如果要一起更新两台机器:
501
+
502
+ 6. **不发 npm,直接把本地代码更新到 helper**
503
+ 适合内部联调或先验证服务器效果,不走 npm registry:
502
504
  ```bash
503
- npm run ship:all -- patch
504
- # 等价于
505
- npm run release -- patch --deploy all
505
+ npm run deploy:local
506
506
  ```
507
-
508
- 6. **只更新服务器,不重新发布**
507
+ 先本地预演但不真的发服务器:
508
+ ```bash
509
+ npm run deploy:local -- --dry-run
510
+ ```
511
+ 这个命令会:
512
+ - 先执行 `npm run build`
513
+ - 在本地执行 `npm pack` 生成临时 tgz
514
+ - 通过 SSH 把 tgz 传到 helper
515
+ - 在 helper 上执行 `npm install -g /tmp/<tgz>`
516
+ - 重启 `opencode` 并检查 `/config`、`/skill`
517
+
518
+ 7. **只更新服务器,不重新发布**
509
519
  如果包已经发到 npm,只想把线上机器切到最新版本:
510
520
  ```bash
521
+ npm run deploy:server
511
522
  npm run deploy:helper
512
- npm run deploy:main
513
- npm run deploy:all
514
523
  ```
515
524
  也可以指定版本或先预演:
516
525
  ```bash
@@ -518,15 +527,14 @@ bun test
518
527
  npm run deploy:server -- --target helper --dry-run
519
528
  ```
520
529
  说明:
521
- - `helper` 默认通过 `ssh-aliyun` 登录,按“全局 npm 包 + systemd restart”处理
522
- - `main` 默认通过 `ssh-ma.cn` 登录,按 `~/.config/opencode/package.json` 本地依赖处理
523
- - 如果你的本机没有这两个 alias,可用环境变量覆盖:
530
+ - 默认目标是 `helper`
531
+ - `helper` 会优先使用 `OH_MY_IMAGICMA_HELPER_SSH`;未设置时,会按 `ssh-aliyun`、`ssh-ma.cn`、`ssh-ma-cn` 的顺序查找你本地 shell 里已配置的命令/alias,并优先选择能直接连通的那个
532
+ - 如果这些本地命令都没有,再用环境变量显式覆盖:
524
533
  ```bash
525
534
  export OH_MY_IMAGICMA_HELPER_SSH='ssh -i /path/to/key root@8.155.152.179'
526
- export OH_MY_IMAGICMA_MAIN_SSH='ssh user@host'
527
535
  ```
528
536
 
529
- 7. **服务器刷新旧版本插件**
537
+ 8. **服务器刷新旧版本插件**
530
538
  如果你仍想手工处理,优先不要只重启进程,先明确重装目标版本:
531
539
  ```bash
532
540
  npm cache clean --force
@@ -535,7 +543,7 @@ bun test
535
543
  ```
536
544
  然后再重启 `opencode` / `opencode web` 相关进程。
537
545
 
538
- 8. **长期更优方案**
546
+ 9. **长期更优方案**
539
547
  - npm 官方更推荐 CI/CD 的 Trusted Publishing,这样可以彻底去掉本地 token、`npm login` 和浏览器确认
540
548
  - 但它依赖受支持的代码托管/CI 平台;如果后续把这个仓库镜像到 GitHub Actions 或 GitLab CI,可以再把发布迁到远端
541
549