vibe-coding

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Vibe Coding

Vibe 编码

Use the shared
vibe
CLI instead of repo-specific scripts.
使用共享的
vibe
CLI替代仓库专属脚本。

Install

安装

From the skill directory:
bash
npm link
Or call directly:
node scripts/vibe.js <command>
.
在技能目录下执行:
bash
npm link
或者直接调用:
node scripts/vibe.js <command>

Workflow

工作流

  1. Run
    vibe setup --committer-name "..." --committer-email "..."
    inside the repo.
  2. Define repo preview defaults with
    vibe repo init --preview-cmd ... --preview-port ...
    .
  3. Create a task worktree with
    vibe worktree create <branch> --author-name ... --author-email ...
    .
  4. Work inside the worktree.
  5. Commit with
    vibe commit ...
    , never plain
    git commit
    .
  6. Launch previews with
    vibe preview start
    .
  1. 在仓库内运行
    vibe setup --committer-name "..." --committer-email "..."
  2. 使用
    vibe repo init --preview-cmd ... --preview-port ...
    定义仓库预览默认配置。
  3. 执行
    vibe worktree create <branch> --author-name ... --author-email ...
    创建任务工作树。
  4. 在工作树内开展工作。
  5. 使用
    vibe commit ...
    提交代码,绝对不要使用普通的
    git commit
  6. 执行
    vibe preview start
    启动预览。

Commands

命令

vibe setup                          Configure repo for vibe coding
  --committer-name <name>            Bot/agent name (required on first setup)
  --committer-email <email>          Bot/agent email (required on first setup)
  --worktrees-root <path>            Base dir for worktrees (default: /root/projects/.worktrees)
  --preview-base-domain <domain>     Base domain (default: ondomain.dev)
vibe repo init                      Set preview defaults in .vibe.json
  --preview-cmd <command>             App start command (required)
  --preview-port <port>               App port (required)
  --preview-base-domain <domain>      Base domain (default: ondomain.dev)
vibe worktree create <name>         Create a new worktree
  --author-name <name>                Git author name (required)
  --author-email <email>              Git author email (required)
  --base <branch>                     Base branch (default: main)
vibe commit [git-commit-args...]    Commit with enforced author/committer
vibe preview start                  Start app + ngrok preview
  --port <port>                       Override preview port
  --cmd <command>                     Override preview command
  --base-domain <domain>              Override base domain
vibe hook pre-commit                Pre-commit hook (installed by setup)
vibe setup                          为Vibe编码配置仓库
  --committer-name <name>            机器人/Agent名称(首次设置时必填)
  --committer-email <email>          机器人/Agent邮箱(首次设置时必填)
  --worktrees-root <path>            工作树的基础目录(默认值:/root/projects/.worktrees)
  --preview-base-domain <domain>     基础域名(默认值:ondomain.dev)
vibe repo init                      在.vibe.json中设置预览默认值
  --preview-cmd <command>             应用启动命令(必填)
  --preview-port <port>               应用端口(必填)
  --preview-base-domain <domain>      基础域名(默认值:ondomain.dev)
vibe worktree create <name>         创建新的工作树
  --author-name <name>                Git作者名称(必填)
  --author-email <email>              Git作者邮箱(必填)
  --base <branch>                     基础分支(默认值:main)
vibe commit [git-commit-args...]    以强制的作者/提交者身份提交代码
vibe preview start                  启动应用 + ngrok预览
  --port <port>                       覆盖预览端口
  --cmd <command>                     覆盖启动命令
  --base-domain <domain>              覆盖基础域名
vibe hook pre-commit                提交前钩子(由setup命令安装)

Contract

约定

  • Committer is the bot/agent doing the work — set its name and email during
    vibe setup
    .
  • Author is the human who directed the work — set per worktree via
    vibe worktree create
    .
  • Worktree metadata lives in git worktree config:
    vibe.worktreeName
    and
    vibe.previewSlug
    .
  • Repos declare preview defaults in
    .vibe.json
    .
  • Preview URL is always
    https://<preview-slug>.<base-domain>
    .
  • 提交者是执行工作的机器人/Agent —— 在
    vibe setup
    期间设置其名称和邮箱。
  • 作者是指导工作的人员 —— 通过
    vibe worktree create
    为每个工作树单独设置。
  • 工作树元数据存储在git工作树配置中:
    vibe.worktreeName
    vibe.previewSlug
  • 仓库在
    .vibe.json
    中声明预览默认配置。
  • 预览URL始终为
    https://<preview-slug>.<base-domain>

Configuration

配置

Git config keys (set via
git config
):
KeyScopeDefaultDescription
vibe.committerName
repo— (required)Bot/agent name
vibe.committerEmail
repo— (required)Bot/agent email
vibe.worktreesRoot
repo
/root/projects/.worktrees
Base directory for worktrees
vibe.previewBaseDomain
repo
ondomain.dev
Default preview domain
vibe.worktreeName
worktreebranch nameWorktree display name
vibe.authorName
worktreeAuthor name for commits
vibe.authorEmail
worktreeAuthor email for commits
vibe.previewSlug
worktreeslugified nameSubdomain for preview URL
Git配置项(通过
git config
设置):
配置项作用域默认值描述
vibe.committerName
仓库—(必填)机器人/Agent名称
vibe.committerEmail
仓库—(必填)机器人/Agent邮箱
vibe.worktreesRoot
仓库
/root/projects/.worktrees
工作树的基础目录
vibe.previewBaseDomain
仓库
ondomain.dev
默认预览域名
vibe.worktreeName
工作树分支名称工作树显示名称
vibe.authorName
工作树提交的作者名称
vibe.authorEmail
工作树提交的作者邮箱
vibe.previewSlug
工作树别名化的名称预览URL的子域名

Repo Manifest

仓库清单

Create a tracked
.vibe.json
file with preview defaults:
json
{
  "preview": {
    "command": "cd feed && bun run server.ts",
    "port": 4000,
    "baseDomain": "ondomain.dev"
  }
}
Only put repo-specific behavior in the manifest. Keep the author/committer and worktree policy in the shared CLI.
创建一个被追踪的
.vibe.json
文件,配置预览默认值:
json
{
  "preview": {
    "command": "cd feed && bun run server.ts",
    "port": 4000,
    "baseDomain": "ondomain.dev"
  }
}
仅将仓库专属行为放入清单中。将作者/提交者和工作树策略保留在共享CLI中。

Resources

资源

  • scripts/vibe.js
    — shared cross-repo CLI
  • scripts/vibe.js
    —— 跨仓库共享CLI