stackone-cli
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseStackOne CLI — Connector Development
StackOne CLI — 连接器开发
Important
重要说明
The CLI is actively developed and commands change between versions. Before providing CLI guidance:
- Fetch for the current command reference
https://docs.stackone.com/guides/connector-engine/cli-reference - Fetch for the latest version
https://www.npmjs.com/package/@stackone/cli
Do not guess CLI commands or flags — always verify against live docs.
该CLI正处于活跃开发阶段,不同版本间的命令会有所变化。在提供CLI指导之前:
- 获取以获取当前的命令参考文档
https://docs.stackone.com/guides/connector-engine/cli-reference - 获取以查看最新版本
https://www.npmjs.com/package/@stackone/cli
请勿猜测CLI命令或参数——始终对照实时文档进行验证。
Instructions
操作步骤
Step 1: Install the CLI
步骤1:安装CLI
bash
npm install -g @stackone/cliThis installs the global command. Verify with .
stackonestackone --versionbash
npm install -g @stackone/cli此命令会安装全局的命令。可通过验证安装是否成功。
stackonestackone --versionStep 2: Understand when to build a custom connector
步骤2:了解何时需要构建自定义连接器
Custom connectors are for platforms that StackOne doesn't natively support. Before building one:
- Check if the provider already exists: use the skill or browse https://docs.stackone.com/connectors/introduction
stackone-connectors - If the provider exists but is missing specific actions, you may not need a full custom connector — check the Actions RPC endpoint first
自定义连接器适用于StackOne未原生支持的平台。在构建之前:
- 检查该提供商是否已存在:使用技能或浏览https://docs.stackone.com/connectors/introduction
stackone-connectors - 如果该提供商已存在,但缺少特定操作,则可能不需要完整的自定义连接器——请先检查Actions RPC端点
Step 3: Initialize a connector project
步骤3:初始化连接器项目
Fetch the connector structure guide for the current project layout:
https://docs.stackone.com/guides/connector-engine/connector-structureThe Connector Engine provides:
- Project scaffolding
- Local development server for testing
- Type-safe action definitions
- Deployment tooling
获取连接器结构指南以了解当前的项目布局:
https://docs.stackone.com/guides/connector-engine/connector-structureConnector Engine提供以下功能:
- 项目脚手架
- 用于测试的本地开发服务器
- 类型安全的操作定义
- 部署工具
Step 4: Use the AI Builder (optional)
步骤4:使用AI构建器(可选)
The AI Builder can generate connector scaffolding from API documentation. Fetch the guide:
https://docs.stackone.com/guides/connector-engine/ai-builderThis accelerates development by generating boilerplate from an OpenAPI spec or API docs URL.
AI构建器可以根据API文档生成连接器脚手架。获取相关指南:
https://docs.stackone.com/guides/connector-engine/ai-builder通过从OpenAPI规范或API文档URL生成样板代码,这可以加速开发进程。
Step 5: Test locally
步骤5:本地测试
Run the connector locally to test against the target API before deploying. Fetch the CLI reference for the exact test commands:
https://docs.stackone.com/guides/connector-engine/cli-reference在部署之前,先在本地运行连接器以针对目标API进行测试。获取CLI参考文档以了解确切的测试命令:
https://docs.stackone.com/guides/connector-engine/cli-referenceStep 6: Deploy
步骤6:部署
Deploy to StackOne's infrastructure. For automated deployments, set up CI/CD:
https://docs.stackone.com/guides/connector-engine/github-workflow将连接器部署到StackOne的基础设施中。如需自动化部署,请设置CI/CD:
https://docs.stackone.com/guides/connector-engine/github-workflowExamples
示例
Example 1: User wants to build a connector for an internal API
示例1:用户想要为内部API构建连接器
User says: "We have an internal HR system. Can I connect it to StackOne?"
Actions:
- Confirm the internal API has a REST/GraphQL endpoint
- Install the CLI:
npm install -g @stackone/cli - Fetch the connector structure guide for the scaffolding command
- If they have an OpenAPI spec, suggest the AI Builder for faster scaffolding
- Walk through the init → develop → test → deploy flow
Result: Custom connector project initialized with the right structure.
用户提问:“我们有一个内部HR系统,能否将其连接到StackOne?”
操作步骤:
- 确认内部API具有REST/GraphQL端点
- 安装CLI:
npm install -g @stackone/cli - 获取连接器结构指南以了解脚手架命令
- 如果他们有OpenAPI规范,建议使用AI构建器以更快地生成脚手架
- 引导完成初始化→开发→测试→部署的流程
结果:初始化具有正确结构的自定义连接器项目。
Example 2: User wants to set up CI/CD for connector deployment
示例2:用户想要为连接器部署设置CI/CD
User says: "How do I auto-deploy connectors from GitHub?"
Actions:
- Fetch
https://docs.stackone.com/guides/connector-engine/github-workflow - Walk through the GitHub Actions workflow configuration
- Explain the deployment stages (dev → staging → production)
Result: Working GitHub Actions pipeline for connector deployment.
用户提问:“如何从GitHub自动部署连接器?”
操作步骤:
- 获取
https://docs.stackone.com/guides/connector-engine/github-workflow - 引导完成GitHub Actions工作流的配置
- 解释部署阶段(开发→预发布→生产)
结果:用于连接器部署的可用GitHub Actions流水线。
Troubleshooting
故障排除
CLI command not found after install
安装后找不到CLI命令
Cause: Global npm bin directory not in PATH.
- Run to find the install location
npm config get prefix - Add to your PATH
{prefix}/bin - Alternatively, use instead of the global command
npx @stackone/cli
原因:全局npm bin目录未在PATH中。
- 运行以找到安装位置
npm config get prefix - 将添加到你的PATH中
{prefix}/bin - 或者,使用代替全局命令
npx @stackone/cli
Authentication failures in CLI
CLI中的身份验证失败
Cause: Missing or invalid credentials.
- The CLI requires a StackOne API key
- Fetch the CLI reference for the current auth setup command
- Verify the key is active at https://app.stackone.com
原因:缺少或无效的凭据。
- CLI需要StackOne API密钥
- 获取CLI参考文档以了解当前的身份验证设置命令
- 在https://app.stackone.com验证密钥是否处于活跃状态
Connector deployment fails
连接器部署失败
Cause: Various — check the error message.
- Fetch the CLI reference for deployment troubleshooting
- Common issues: missing required fields in connector config, network timeouts
- For CI/CD failures, check that secrets are correctly configured in GitHub Actions
原因:多种情况——请查看错误消息。
- 获取CLI参考文档以了解部署故障排除方法
- 常见问题:连接器配置中缺少必填字段、网络超时
- 对于CI/CD失败,请检查GitHub Actions中的密钥是否配置正确