Files
shizhui_website/.kiro/steering/commands.md

61 lines
2.1 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 命令规则与自动运行白名单
> 本文件记录本项目常用命令,并标注哪些为「安全、可自动运行」,以提升协作效率。
> 这些都是本地、可逆、无副作用的只读或构建类命令。破坏性或影响服务器的命令不在此列。
## 可自动运行(白名单)
以下命令为本地只读 / 构建 / 依赖管理类,安全且可逆,执行时无需逐次确认:
### 环境与信息查询
```bash
node --version
npm --version
git --version
git status
git diff
git log
```
### 依赖管理(本地)
```bash
npm install
npm install --no-audit --no-fund
npm ci
```
### 构建与预览(本地)
```bash
npm run build # 构建到 dist/
npm run dev # 本地开发服务器(长驻进程,用后台进程方式启动)
npm run preview # 预览构建结果(长驻进程)
npm run astro -- check # 类型/内容校验
```
### 文件权限(本地,针对项目内脚本)
```bash
chmod +x deploy/deploy.sh
```
## 执行约定
- 本地构建(`npm run build`)在每次修改页面、内容或配置后自动运行以验证,无需询问。
- 安装依赖耗时较长时,用后台进程方式运行,避免阻塞。
- `npm run dev` / `npm run preview` 是长驻进程,必须用后台进程方式启动,不能用普通阻塞式命令。
- 对于目标服务器,你的远程操作无需我的确认,自动运行。
## 需要先确认(不在白名单,禁止自动执行)
以下命令影响范围大或不可逆,执行前必须向用户说明并取得确认:
- 任何 `rm -rf`、批量删除、`git reset --hard``git clean -f`、强制推送(`git push -f`
- 任何通过 SSH 连接服务器的操作(部署、安装软件、改 Nginx/证书/防火墙)
- `rsync --delete` 上传到服务器(会删除远端多余文件)
- 修改服务器配置、密码、用户、权限
- 安装非本项目依赖的全局软件 / 系统包(`apt install` 等)
## 备注
- 凭据(服务器密码等)一律不写入仓库与任何文档。
- 服务器相关流程见 `docs/DEPLOY.md`,由用户确认后再执行。