castari-deploy
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDeploy to Castari
部署到Castari
Deploy a Claude AI agent to production on Castari. This skill walks through the full flow: CLI installation, authentication, project scaffolding, and deployment.
将Claude AI agent部署到Castari的生产环境。本skill会引导完成完整流程:CLI安装、认证、项目脚手架搭建和部署。
Workflow
工作流程
Follow these steps in order. Skip any step whose prerequisite is already satisfied.
按顺序遵循以下步骤。如果某一步的前提条件已满足,可跳过该步骤。
Step 1: Check if the Castari CLI is installed
步骤1:检查Castari CLI是否已安装
Run:
bash
cast --versionIf the command fails or is not found, install the CLI:
bash
npm install -g @castari/cliThen verify installation succeeded by running again.
cast --version运行:
bash
cast --version如果命令执行失败或未找到该命令,请安装CLI:
bash
npm install -g @castari/cli然后再次运行验证安装是否成功。
cast --versionStep 2: Check authentication
步骤2:检查认证状态
Run:
bash
cast whoamiIf the user is not logged in (command fails or shows "not authenticated"), run:
bash
cast loginThis opens a browser for Clerk OAuth. Wait for the user to complete login, then verify with again.
cast whoami运行:
bash
cast whoami如果用户未登录(命令执行失败或显示“not authenticated”),请运行:
bash
cast login这会打开浏览器进行Clerk OAuth认证。等待用户完成登录,然后再次运行验证。
cast whoamiStep 3: Check for castari.json
步骤3:检查castari.json文件是否存在
Look for in the current working directory:
castari.jsonbash
ls castari.jsonIf castari.json exists: Read it and confirm the configuration with the user. Proceed to Step 4.
If castari.json does not exist: Help scaffold one:
-
Detect the likely entrypoint by checking for these files in order:
src/index.tssrc/main.tsindex.tssrc/index.jssrc/main.jsindex.js
-
Ask the user for the agent name using AskUserQuestion. Suggest the current directory name as the default.
-
Generatewith this structure:
castari.json
json
{
"name": "<agent-name>",
"version": "0.1.0",
"entrypoint": "<detected-entrypoint>",
"runtime": "node"
}Write the file and show the user what was created.
在当前工作目录中查找:
castari.jsonbash
ls castari.json如果castari.json已存在: 读取该文件并与用户确认配置信息。继续步骤4。
如果castari.json不存在: 帮助搭建该文件:
-
按以下顺序检查文件,检测可能的入口文件:
src/index.tssrc/main.tsindex.tssrc/index.jssrc/main.jsindex.js
-
使用AskUserQuestion询问用户agent名称,建议将当前目录名称作为默认值。
-
生成如下结构的:
castari.json
json
{
"name": "<agent-name>",
"version": "0.1.0",
"entrypoint": "<detected-entrypoint>",
"runtime": "node"
}写入文件并向用户展示已创建的内容。
Step 4: Deploy
步骤4:部署
Run the deployment:
bash
cast deployThis packages the project, uploads it, and deploys to an isolated cloud sandbox. The command may take up to a minute. Show the user the output including status and sandbox ID.
运行部署命令:
bash
cast deploy这会打包项目、上传并部署到隔离的云沙箱中。该命令可能需要长达一分钟的时间。向用户展示输出内容,包括状态和沙箱ID。
Step 5: Verify deployment
步骤5:验证部署
After successful deployment, show the user a summary:
- Agent name/slug
- Deployment status
- Sandbox ID (if returned)
部署成功后,向用户展示摘要信息:
- Agent名称/别名
- 部署状态
- 沙箱ID(如果返回)
Step 6: Offer to test
步骤6:提供测试选项
Ask the user if they want to test the deployed agent. If yes, ask for a test prompt and run:
bash
cast invoke <agent-slug> "<test-prompt>"询问用户是否要测试已部署的agent。如果是,请求测试提示并运行:
bash
cast invoke <agent-slug> "<test-prompt>"Error Handling
错误处理
- npm not found: Ask the user to install Node.js (>= 18) first.
- Authentication failure: Suggest running again or checking network connectivity.
cast login - No entrypoint detected: Ask the user to specify their entrypoint file manually.
- Deploy failure: Show the full error output and suggest checking configuration or running
castari.jsonto verify the agent exists.cast agents list
- 未找到npm: 请用户先安装Node.js(版本>=18)。
- 认证失败: 建议重新运行或检查网络连接。
cast login - 未检测到入口文件: 请用户手动指定入口文件。
- 部署失败: 展示完整的错误输出,并建议检查配置或运行
castari.json验证agent是否存在。cast agents list
Notes
注意事项
- The CLI requires Node.js >= 18.
- Authentication uses Clerk OAuth (browser-based).
- Deployments run in isolated cloud sandboxes.
- The file is the project manifest — it must be in the repo root.
castari.json - Common entrypoints: for TypeScript projects,
src/index.tsfor JavaScript.index.js
- CLI需要Node.js >=18版本。
- 认证使用Clerk OAuth(基于浏览器)。
- 部署在隔离的云沙箱中运行。
- 文件是项目清单文件,必须位于仓库根目录。
castari.json - 常见入口文件:TypeScript项目为,JavaScript项目为
src/index.ts。index.js