OpenAI 推出了 OpenAI CLI,这是一款官方的 REST API 命令行界面工具 1。该工具采用基于资源的命令结构,使用户能够通过命令行访问 OpenAI API 的各项功能 1。
用户可以通过 Homebrew 或 Go 进行安装,具体命令为 brew install openai/tools/openai 或 go install 'github.com/openai/openai-cli/cmd/openai@latest',需要 Go 版本 1.26 或更高版本 1。使用前需要设置环境变量 export OPENAI_API_KEY="sk-..." 来配置 API 密钥 1。
OpenAI CLI 支持多种认证方式,包括管理员端点和标准 API 端点 1。在功能方面,该工具支持文件上传下载、图像生成、Tab 完成等操作 1,并提供 text、json、jsonl、yaml 等多种输出格式 1。此外,该工具还支持 mTLS 客户端证书认证(测试版功能)1。OpenAI CLI 采用 Apache License 2.0 许可证发布 1。
OpenAI has released an official command-line interface tool for its REST API, enabling developers to interact with OpenAI's services directly from the terminal.1 The tool, called OpenAI CLI, can be installed via Homebrew using brew install openai/tools/openai or through Go with go install 'github.com/openai/openai-cli/cmd/openai@latest', and requires Go version 1.26 or higher.1
To use the CLI, users must configure authentication by setting the OPENAI_API_KEY environment variable with their API key.1 The tool supports both administrator endpoints and standard API endpoints for authentication purposes.1 OpenAI CLI offers a resource-based command structure that provides access to various API functionalities, including file management and image generation.1 Additional features include tab completion for commands, file upload and download capabilities, and support for multiple output formats such as text, JSON, JSONL, and YAML.1 The tool also includes mTLS client certificate authentication in beta version.1 The project is distributed under the Apache License 2.0.1
评论
还没有评论,欢迎留下第一条。