# Packages
# README
openai-orgs - CLI for OpenAI Platform Management API
openai-orgs
is a command-line interface (CLI) tool for interacting with the OpenAI Platform Administration APIs. It provides various commands to manage projects, users, API keys, service accounts, invites, and more.
Installation
To install openai-orgs
, make sure you have Go installed on your system, then run:
go install github.com/klauern/openai-orgs/cmd/openai-orgs@latest
Configuration
Before using openai-orgs
, you need to set up your OpenAI API key:
- Log in to your OpenAI account at https://platform.openai.com/
- Navigate to the API keys section
- Create a new API key
- Set the API key as an environment variable:
export OPENAI_API_KEY=your_api_key_here
Usage
openai-orgs
uses subcommands to organize its functionality. Here are the main commands:
audit-logs
: Manage audit logsinvites
: Manage organization invitesusers
: Manage organization usersprojects
: Manage organization projectsproject-users
: Manage project usersproject-service-accounts
: Manage project service accountsproject-api-keys
: Manage project API keys
To see available subcommands and options for each command, use the --help
flag:
openai-orgs --help
openai-orgs <command> --help
Examples
- List all users in the organization:
openai-orgs users list
- Create a new project:
openai-orgs projects create --name "My New Project"
- List project API keys:
openai-orgs project-api-keys list --project-id <project_id>
- Create an invite:
openai-orgs invites create --email [email protected] --role member
Default Settings
- The CLI uses the OpenAI API base URL:
https://api.openai.com/v1
- Authentication is handled using the
OPENAI_API_KEY
environment variable - List commands typically have optional
--limit
and--after
flags to control pagination
Error Handling
If an error occurs during command execution, the CLI will display an error message and exit with a non-zero status code.
Contributing
Contributions to openai-orgs
are welcome! Please submit issues and pull requests on the GitHub repository.
License
This project is licensed under the MIT License - see the LICENSE file for details.