CometAPI CLI는 TOML config 파일, 환경 변수, 명령줄 플래그에서 설정을 읽습니다. 동일한 설정을 여러 소스에서 제공할 수 있는 경우 우선순위는 다음과 같습니다: CLI flags > config file > environment variables > defaultsDocumentation Index
Fetch the complete documentation index at: https://apidoc.cometapi.com/llms.txt
Use this file to discover all available pages before exploring further.
Config file
위치:~/.config/cometapi/config.toml
설정 마법사를 실행하여 대화형으로 config 파일을 생성합니다:
config 하위 명령으로 개별 설정을 관리할 수 있습니다:
사용 가능한 설정
| Config key | Environment variable | Description |
|---|---|---|
api_key | COMETAPI_KEY | API 키(모든 명령에 필요) |
access_token | COMETAPI_ACCESS_TOKEN | 계정 수준 명령용 access token |
base_url | COMETAPI_BASE_URL | API 기본 URL(기본값: https://api.cometapi.com/v1) |
default_model | COMETAPI_DEFAULT_MODEL | chat용 기본 model(fallback: gpt-5.4) |
output_format | — | 기본 출력 형식: table, json, yaml, csv, 또는 markdown |
자격 증명
CLI는 두 가지 유형의 자격 증명을 사용합니다:API key
모든 명령에 필요합니다. API key는 CometAPI model 엔드포인트에 대한 요청을 인증합니다. CometAPI Console → API Keys에서 API key를 생성하세요. 다음 방법 중 하나로 설정합니다:Access token
선택 사항입니다. access token은 계정 수준 명령인account, stats, tokens, logs, tasks에 필요합니다.
CometAPI Console → Personal Settings에서 access token을 생성하세요.
다음 방법 중 하나로 설정합니다:
보안
CLI는 다음 보안 관행을 적용합니다:- API key와 access token은 전체가 기록되거나 표시되지 않습니다. 진단 출력에는 마지막 4자만 표시됩니다.
- config 파일은 제한적인 권한(
0600)으로 생성되며, 파일 소유자만 읽을 수 있습니다. - 자격 증명은 버전 관리에 절대 커밋하면 안 됩니다. 해당되는 경우 config 파일 경로를
.gitignore에 추가하세요.
문제 해결
| Error | Solution |
|---|---|
API key not configured | cometapi init을 실행하거나 COMETAPI_KEY 환경 변수를 설정하세요 |
Connection failed | 연결 문제를 진단하려면 cometapi doctor를 실행하세요 |
Access token not configured | account/stats/tokens/logs/tasks에만 필요합니다. 추가하려면 cometapi init을 실행하세요 |