Skip to main content

OpenAI Codex CLI Setup Guide

After setup, you can operate CloudBase services directly from OpenAI Codex CLI’s chat.

Examples:

  • "Build a WeChat Mini Program ordering system with CloudBase" — AI scaffolds pages, creates the cloud database, writes cloud functions, and guides preview
  • "Build a reservation management system that lets users place orders and admins update status" — AI models it with CloudBase PostgreSQL, configures permissions, and wires up frontend and backend
  • "Add phone-number login to a Web app" — AI enables the auth method and integrates the CloudBase SDK

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.


The plugin marketplace installs both MCP tools and AI Skills. You can also install from the Codex App UI.

Add the CloudBase plugin marketplace and install the plugin via the Codex App graphical interface.

1
Open Plugin Directory

Click the + button in the top-right corner of Codex App.

2
Add Plugin Marketplace

Select Add Plugin Marketplace from the menu.

3
Fill in Marketplace Info

Enter the following information in the dialog:

Source:TencentCloudBase/CloudBase-MCP
Git Ref:main
Sparse Path:Leave empty
4
Click Add Marketplace

Once added, find the Tencent CloudBase marketplace in the plugin list.

5
Install CloudBase Plugin

Click the install button next to the cloudbase plugin.

6
Start a New Thread to Verify

After installation, start a new Codex thread to let the plugin, skills, and MCP tools fully load.

Method 2: Connect via MCP Configuration

If you only need MCP tool connectivity, you can also configure it manually:

Client

Configure your AI tool to connect with CloudBase capabilities. Supports local and hosted connection. See connection modes.

Step 1: Install / Configure CloudBase

前置步骤:

bash
npm i @cloudbase/cloudbase-mcp -g

根据运行系统在终端中运行指令:

MacOS, Linux, WSL:

bash
codex mcp add cloudbase --env INTEGRATION_IDE=CodeX -- cloudbase-mcp

Windows Powershell:

bash
codex mcp add cloudbase --env INTEGRATION_IDE=CodeX -- cmd /c cloudbase-mcp

Step 2: Chat with AI

Enter the following in your AI chat in order:

prompt
Read https://docs.cloudbase.net/skill.md and tell me what it can do
Use CloudBase Skills: 设计一个博客系统的数据模型

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 questions: Full FAQ

相关资源