Neon CLI(命令名 neonctl)用于管理 Neon 无服务器 Postgres,涵盖项目、分支、数据库、角色和连接字符串等资源的操作。文档地址:https://neon.com/docs/reference/neon-cli。
主要用途:面向需要在命令行或自动化流程中操作 Neon 数据库资源的场景,适合智能体创建数据库分支、管理项目与数据库、获取连接串等任务。
安装与认证:
npm i -g neonctl neonctl auth
常用命令:
neonctl projects list neonctl branches list --project-id <id> neonctl branches create --project-id <id> --name feature-branch neonctl databases list --branch <branch-id> neonctl connection-string --project-id <id> neonctl roles list --project-id <id>
面向智能体的特性:支持 --output json 获得结构化输出;可通过环境变量 NEON_API_KEY 使用 API 密钥认证;支持数据库分支,便于为预览环境创建隔离分支。
限制:资料未提供更详细的参数说明、权限要求、配额或收费信息,暂未提供具体使用步骤之外的扩展说明。