dev

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Human usage

用户使用方法

After setup, use these commands directly:
  • npm run dev
    /
    npm run dev:start
    — start server in background (detached via nohup)
  • npm run dev:stop
    — stop server (Ctrl+C won't work since it's detached)
  • npm run dev:status
    — check PID and log location
  • npm run dev:restart
    — restart server
  • tail -f logs/dev.log
    — stream live logs
  • PORT=5173 npm run dev
    — override port
PID file:
.dev/dev.pid
— Log file:
logs/dev.log

You are managing the dev server. The argument determines the action.
完成设置后,可直接使用以下命令:
  • npm run dev
    /
    npm run dev:start
    — 在后台启动服务器(通过nohup实现脱离终端)
  • npm run dev:stop
    — 停止服务器(由于已脱离终端,Ctrl+C无法生效)
  • npm run dev:status
    — 查看PID和日志位置
  • npm run dev:restart
    — 重启服务器
  • tail -f logs/dev.log
    — 实时查看日志流
  • PORT=5173 npm run dev
    — 覆盖默认端口
PID文件:
.dev/dev.pid
— 日志文件:
logs/dev.log

你正在管理开发服务器,参数将决定执行的操作。

/dev setup

/dev setup

Only run setup if
dev:raw
is missing from
package.json
.
  1. Read
    package.json
    and config files to detect framework and dev command:
    • nuxt.config.*
      → command
      nuxt dev
      , default port 3000
    • vite.config.*
      → command
      vite
      , default port 5173
    • next.config.*
      → command
      next dev
      , default port 3000
    • Else: inspect existing
      dev
      script for clues; if still unclear, ask the user
  2. Check config files for port overrides (e.g.
    devServer.port
    ,
    server.port
    )
  3. Propose detected command and port to user for confirmation
  4. Write
    dev:raw
    to
    package.json
    with the confirmed command
  5. Add these wrapper scripts to
    package.json
    :
    json
    "dev": ".agents/skills/dev/scripts/dev.sh start",
    "dev:start": ".agents/skills/dev/scripts/dev.sh start",
    "dev:stop": ".agents/skills/dev/scripts/dev.sh stop",
    "dev:restart": ".agents/skills/dev/scripts/dev.sh restart",
    "dev:status": ".agents/skills/dev/scripts/dev.sh status"
    Note:
    dev:raw
    stays as-is (it holds the actual dev command).
仅当
package.json
中缺少
dev:raw
时才执行设置。
  1. 读取
    package.json
    和配置文件以检测框架和开发命令:
    • nuxt.config.*
      → 命令
      nuxt dev
      ,默认端口3000
    • vite.config.*
      → 命令
      vite
      ,默认端口5173
    • next.config.*
      → 命令
      next dev
      ,默认端口3000
    • 其他情况:检查现有
      dev
      脚本以寻找线索;若仍不明确,询问用户
  2. 检查配置文件中的端口覆盖设置(如
    devServer.port
    server.port
  3. 将检测到的命令和端口告知用户以确认
  4. 将确认后的命令写入
    package.json
    dev:raw
    字段
  5. package.json
    中添加以下包装脚本:
    json
    "dev": ".agents/skills/dev/scripts/dev.sh start",
    "dev:start": ".agents/skills/dev/scripts/dev.sh start",
    "dev:stop": ".agents/skills/dev/scripts/dev.sh stop",
    "dev:restart": ".agents/skills/dev/scripts/dev.sh restart",
    "dev:status": ".agents/skills/dev/scripts/dev.sh status"
    注意:
    dev:raw
    保持原样(它存储实际的开发命令)。

/dev start

/dev start

Run:
npm run dev:start
If
dev:raw
is not in
package.json
, tell the user to run
/dev setup
first.
执行:
npm run dev:start
如果
package.json
中没有
dev:raw
,请告知用户先执行
/dev setup

/dev stop

/dev stop

Run:
npm run dev:stop
执行:
npm run dev:stop

/dev restart

/dev restart

Run:
npm run dev:restart
执行:
npm run dev:restart

/dev status

/dev status

Run:
npm run dev:status
执行:
npm run dev:status