OpenAI Codex CLI Setup Guide
After setup, you can operate CloudBase services directly from OpenAI Codex CLI’s chat.
Examples:
- "Create a users collection" - AI creates database collections automatically
- "Deploy this function" - AI uploads and configures cloud functions
- "Deploy the frontend to CDN" - AI uploads files and configures hosting
No need to switch to the Cloud console — you can do everything from the CLI with natural language.
Prerequisites
Before you start, make sure you have:
Node.js and a CloudBase environment ready
Node.js: Install Node.js v18.15.0 or later:
node --version
If you don’t have it installed, download it from the Node.js website.
CloudBase environment: See Create a CloudBase environment. New users can start for free.
Configure your AI tool to connect with CloudBase capabilities. Supports local and hosted connection. See connection modes.
Step 1: Install / Configure CloudBase
前置步骤:
npm i @cloudbase/cloudbase-mcp -g根据运行系统在终端中运行指令:
MacOS, Linux, WSL:
codex mcp add cloudbase --env INTEGRATION_IDE=CodeX -- cloudbase-mcpWindows Powershell:
codex mcp add cloudbase --env INTEGRATION_IDE=CodeX -- cmd /c cloudbase-mcpStep 2: Chat with AI
Enter the following in your AI chat in order:
Install CloudBase Skills: run npx skills add tencentcloudbase/cloudbase-skills -yUse CloudBase Skills: 帮我通过 HTTP API 调用 CloudBase 服务FAQ
Q: MCP connection failed?
A: Confirm the command runs correctly, restart OpenAI Codex CLI, and check your network.
Q: Tool count shows 0?
A: See the FAQ.
More: FAQ