myoc / note.md
OpenCode Deployer
update
185978f
|
Raw History Blame Contribute Delete
2.85 kB
增加 上传出发备份功能,见 ima 个人知识库“huggingface space 代码上传出发备份操作“
可能需要将 service 的 install 和 start 分开,在 start 前插入 restore 操作,即:先 restore 再 restart
## 目录结构
### 本地目录结构
|-- .claude
| |-- CLAUDE.md
|
|-- .config
| |-- opencode
| |-- AGENTS.md
|
|-- service
| |-- cron-service.sh
| |-- nodejs-service.sh
| |-- opencode-service.sh
| |-- start-service.sh
|
|-- script
| |-- backup.sh
| |-- exclude_list_system.txt
| |-- exclude_list_root.txt
|
|-- .gitattributes
|-- .gitignore
|-- Dockerfile
|-- note.md
### Docker 目录结构
|-- .backup
|
|-- .system
| |-- service
| | |-- cron-service.sh
| | |-- nodejs-service.sh
| | |-- opencode-service.sh
| | |-- start-service.sh
| |-- script
| |-- backup.sh
| |-- exclude_list_system.txt
| |-- exclude_list_root.txt
|
|-- root
| |-- .config
| | |-- opencode
| | |-- .gitignore
| | |-- AGENTS.md
| | |-- bun.lock
| | |-- node_modules
| | |-- package.json
| |
| |-- .claude
| |-- CLAUDE.md
|
# google drive:
## 下载文件
node download-file.js "文件名.txt" ./downloads/
node download-file.js 1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms
## 上传文件
node upload-file.js ./local-file.txt
node upload-file.js ./document.pdf "云端文档.pdf"
# git 操作
## 创建附注标签
创建附注标签使用 -a 选项指定标签名,-m 选项添加说明信息:
示例:
```bash
git tag -a v1.0.0 -m "版本1.0.0发布"
```
## 推送单个标签
使用以下命令将特定标签推送到远程仓库(通常名为 origin):
git push origin <标签名>
例如,推送标签 v1.0.0:
```bash
git push origin v1.0.0
```
## 删除本地标签
git tag -d <标签名>
示例:
```bash
git tag -d v0.0.1
```
## 删除远程标签
- 首先在本地删除标签:
git tag -d <标签名>
-
然后,将删除操作同步到远程仓库:
git push origin --delete <标签名>
示例:
```bash
git push origin --delete v0.0.1
```
## 使用 token 访问 git 仓库
```bash
git clone https://${git_user}:${git_accesstoken}@huggingface.co/spaces/${git_user}/${git_project}
```
注意:使用 token 访问时,在 当前 huggingface 项目环境变量里添加:
GIT_USER_n
GIT_ACCESSTOKEN_n
GIT_PROJECT_n
其中:n 从 1 开始递增,如:1、2、3...
## 关于oh-my-opencode的安装
通常是使用 npm install -g oh-my-opencode 进行全局安装,将插件功能应用到所有项目。
如果你想在特定项目中启用或配置 oh-my-opencode,主要操作是在项目根目录创建或修改 .opencode/oh-my-opencode.json 配置文件,而非将插件二进制文件本身“安装”到项目目录