cometapi-cli 0.1.0__tar.gz → 0.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cometapi_cli-0.2.1/.github/ISSUE_TEMPLATE/bug_report.yml +46 -0
- cometapi_cli-0.2.1/.github/ISSUE_TEMPLATE/feature_request.yml +25 -0
- cometapi_cli-0.2.1/.github/PULL_REQUEST_TEMPLATE.md +14 -0
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/.github/workflows/publish.yml +7 -1
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/AGENTS.md +19 -7
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/CHANGELOG.md +11 -3
- cometapi_cli-0.2.1/CODE_OF_CONDUCT.md +54 -0
- cometapi_cli-0.2.1/CONTRIBUTING.md +48 -0
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/PKG-INFO +31 -13
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/README.md +26 -8
- cometapi_cli-0.2.1/SECURITY.md +27 -0
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/docs/commands/init.md +29 -8
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/docs/commands/models.md +1 -2
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/pyproject.toml +5 -5
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/src/cometapi_cli/__init__.py +1 -1
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/src/cometapi_cli/app.py +2 -2
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/src/cometapi_cli/commands/account.py +1 -1
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/src/cometapi_cli/commands/balance.py +1 -1
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/src/cometapi_cli/commands/chat.py +3 -3
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/src/cometapi_cli/commands/config_cmd.py +77 -11
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/src/cometapi_cli/commands/doctor.py +1 -1
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/src/cometapi_cli/commands/logs.py +19 -48
- cometapi_cli-0.2.1/src/cometapi_cli/commands/models.py +95 -0
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/src/cometapi_cli/commands/repl.py +1 -1
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/src/cometapi_cli/commands/stats.py +1 -1
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/src/cometapi_cli/commands/tasks.py +2 -2
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/src/cometapi_cli/commands/tokens.py +1 -1
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/tests/test_logs.py +0 -14
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/tests/test_models.py +15 -4
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/uv.lock +1 -1
- cometapi_cli-0.1.0/src/cometapi_cli/commands/models.py +0 -44
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/.github/workflows/ci.yml +0 -0
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/.gitignore +0 -0
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/LICENSE +0 -0
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/SKILL.md +0 -0
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/docs/README.md +0 -0
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/docs/authentication.md +0 -0
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/docs/commands/account.md +0 -0
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/docs/commands/balance.md +0 -0
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/docs/commands/chat.md +0 -0
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/docs/commands/config.md +0 -0
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/docs/commands/doctor.md +0 -0
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/docs/commands/logs.md +0 -0
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/docs/commands/repl.md +0 -0
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/docs/commands/stats.md +0 -0
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/docs/commands/tasks.md +0 -0
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/docs/commands/tokens.md +0 -0
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/docs/configuration.md +0 -0
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/docs/errors.md +0 -0
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/docs/installation.md +0 -0
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/docs/output-formats.md +0 -0
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/skills/live-test/SKILL.md +0 -0
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/src/cometapi_cli/client.py +0 -0
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/src/cometapi_cli/commands/__init__.py +0 -0
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/src/cometapi_cli/commands/chat_repl.py +0 -0
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/src/cometapi_cli/config.py +0 -0
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/src/cometapi_cli/console.py +0 -0
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/src/cometapi_cli/constants.py +0 -0
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/src/cometapi_cli/errors.py +0 -0
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/src/cometapi_cli/formatters.py +0 -0
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/src/cometapi_cli/main.py +0 -0
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/tests/__init__.py +0 -0
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/tests/conftest.py +0 -0
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/tests/test_account.py +0 -0
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/tests/test_balance.py +0 -0
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/tests/test_chat.py +0 -0
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/tests/test_config.py +0 -0
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/tests/test_doctor.py +0 -0
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/tests/test_errors.py +0 -0
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/tests/test_formatters.py +0 -0
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/tests/test_help.py +0 -0
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/tests/test_stats.py +0 -0
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/tests/test_tasks.py +0 -0
- {cometapi_cli-0.1.0 → cometapi_cli-0.2.1}/tests/test_tokens.py +0 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
name: Bug Report
|
|
2
|
+
description: Report a bug in CometAPI CLI
|
|
3
|
+
labels: ["bug"]
|
|
4
|
+
body:
|
|
5
|
+
- type: textarea
|
|
6
|
+
id: description
|
|
7
|
+
attributes:
|
|
8
|
+
label: Description
|
|
9
|
+
description: A clear description of the bug.
|
|
10
|
+
validations:
|
|
11
|
+
required: true
|
|
12
|
+
- type: textarea
|
|
13
|
+
id: steps
|
|
14
|
+
attributes:
|
|
15
|
+
label: Steps to Reproduce
|
|
16
|
+
description: How can we reproduce this?
|
|
17
|
+
placeholder: |
|
|
18
|
+
1. Run `cometapi ...`
|
|
19
|
+
2. ...
|
|
20
|
+
validations:
|
|
21
|
+
required: true
|
|
22
|
+
- type: textarea
|
|
23
|
+
id: expected
|
|
24
|
+
attributes:
|
|
25
|
+
label: Expected Behavior
|
|
26
|
+
description: What did you expect to happen?
|
|
27
|
+
validations:
|
|
28
|
+
required: true
|
|
29
|
+
- type: textarea
|
|
30
|
+
id: actual
|
|
31
|
+
attributes:
|
|
32
|
+
label: Actual Behavior
|
|
33
|
+
description: What actually happened? Include any error output.
|
|
34
|
+
validations:
|
|
35
|
+
required: true
|
|
36
|
+
- type: textarea
|
|
37
|
+
id: environment
|
|
38
|
+
attributes:
|
|
39
|
+
label: Environment
|
|
40
|
+
description: Version and platform info.
|
|
41
|
+
placeholder: |
|
|
42
|
+
- CLI version: (cometapi --version)
|
|
43
|
+
- Python version:
|
|
44
|
+
- OS:
|
|
45
|
+
validations:
|
|
46
|
+
required: true
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
name: Feature Request
|
|
2
|
+
description: Suggest a new feature or improvement
|
|
3
|
+
labels: ["enhancement"]
|
|
4
|
+
body:
|
|
5
|
+
- type: textarea
|
|
6
|
+
id: problem
|
|
7
|
+
attributes:
|
|
8
|
+
label: Problem
|
|
9
|
+
description: What problem does this feature solve?
|
|
10
|
+
validations:
|
|
11
|
+
required: true
|
|
12
|
+
- type: textarea
|
|
13
|
+
id: solution
|
|
14
|
+
attributes:
|
|
15
|
+
label: Proposed Solution
|
|
16
|
+
description: How should this work?
|
|
17
|
+
validations:
|
|
18
|
+
required: true
|
|
19
|
+
- type: textarea
|
|
20
|
+
id: alternatives
|
|
21
|
+
attributes:
|
|
22
|
+
label: Alternatives Considered
|
|
23
|
+
description: Any other approaches you've considered?
|
|
24
|
+
validations:
|
|
25
|
+
required: false
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
## Description
|
|
2
|
+
|
|
3
|
+
<!-- What does this PR do? -->
|
|
4
|
+
|
|
5
|
+
## Related Issues
|
|
6
|
+
|
|
7
|
+
<!-- Link related issues: Fixes #123, Closes #456 -->
|
|
8
|
+
|
|
9
|
+
## Checklist
|
|
10
|
+
|
|
11
|
+
- [ ] Tests pass (`uv run pytest -v`)
|
|
12
|
+
- [ ] Lint passes (`uv run ruff check src/ tests/`)
|
|
13
|
+
- [ ] CHANGELOG.md updated (if user-facing change)
|
|
14
|
+
- [ ] Documentation updated (if applicable)
|
|
@@ -6,7 +6,7 @@ on:
|
|
|
6
6
|
- "v*"
|
|
7
7
|
|
|
8
8
|
permissions:
|
|
9
|
-
contents:
|
|
9
|
+
contents: write
|
|
10
10
|
id-token: write
|
|
11
11
|
|
|
12
12
|
jobs:
|
|
@@ -28,3 +28,9 @@ jobs:
|
|
|
28
28
|
|
|
29
29
|
- name: Publish to PyPI
|
|
30
30
|
uses: pypa/gh-action-pypi-publish@release/v1
|
|
31
|
+
|
|
32
|
+
- name: Create GitHub Release
|
|
33
|
+
uses: softprops/action-gh-release@v2
|
|
34
|
+
with:
|
|
35
|
+
generate_release_notes: true
|
|
36
|
+
files: dist/*
|
|
@@ -82,24 +82,36 @@ Package name: `cometapi-cli`. Triggered automatically by pushing a `v*` tag to G
|
|
|
82
82
|
### Release SOP
|
|
83
83
|
|
|
84
84
|
```bash
|
|
85
|
-
# 1.
|
|
85
|
+
# 1. Update CHANGELOG.md with the new version section
|
|
86
|
+
|
|
87
|
+
# 2. Bump version in TWO places (must match):
|
|
86
88
|
# - pyproject.toml: version = "X.Y.Z"
|
|
87
89
|
# - src/cometapi_cli/__init__.py: __version__ = "X.Y.Z"
|
|
88
90
|
|
|
89
|
-
#
|
|
90
|
-
git
|
|
91
|
-
git
|
|
91
|
+
# 3. Merge dev → main
|
|
92
|
+
git checkout main
|
|
93
|
+
git merge dev
|
|
92
94
|
git push origin main
|
|
93
95
|
|
|
94
|
-
#
|
|
96
|
+
# 4. Tag and push — triggers publish.yml automatically
|
|
97
|
+
# (publishes to PyPI + creates GitHub Release with auto-generated notes)
|
|
95
98
|
git tag vX.Y.Z
|
|
96
99
|
git push origin vX.Y.Z
|
|
100
|
+
|
|
101
|
+
# 5. Switch back to dev
|
|
102
|
+
git checkout dev
|
|
97
103
|
```
|
|
98
104
|
|
|
99
105
|
### Verify
|
|
100
106
|
|
|
101
107
|
```bash
|
|
108
|
+
# Check PyPI
|
|
102
109
|
open https://pypi.org/project/cometapi-cli/
|
|
110
|
+
|
|
111
|
+
# Check GitHub Release
|
|
112
|
+
open https://github.com/cometapi-dev/cometapi-cli/releases
|
|
113
|
+
|
|
114
|
+
# Install and test
|
|
103
115
|
pip install cometapi-cli==X.Y.Z
|
|
104
116
|
cometapi --version
|
|
105
117
|
```
|
|
@@ -177,9 +189,9 @@ These options apply to **every** command via the root Typer callback.
|
|
|
177
189
|
| `--format` | `-f` | `OutputFormat` | inherits global | Per-command output format override |
|
|
178
190
|
| `--json` | — | flag | `false` | Output as JSON |
|
|
179
191
|
|
|
180
|
-
**Behavior:** Fetches all models via `client.models.list()`, sorts
|
|
192
|
+
**Behavior:** Fetches all models via `client.models.list()`, applies `--search`, sorts model IDs in descending natural/version-aware order so newer variants surface first, then applies `--limit`.
|
|
181
193
|
|
|
182
|
-
**Table columns:** `id` (cyan)
|
|
194
|
+
**Table columns:** `id` (cyan).
|
|
183
195
|
|
|
184
196
|
---
|
|
185
197
|
|
|
@@ -5,7 +5,15 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
-
## [0.2.
|
|
8
|
+
## [0.2.1] — 2026-04-14
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- `models` now sorts model IDs in descending natural/version-aware order so newer GPT variants appear first in filtered output.
|
|
13
|
+
- `models` output now only includes the model `id`; the unrelated `owned_by` field is no longer shown in table, JSON, YAML, CSV, or Markdown output.
|
|
14
|
+
- README links were cleaned up for the next PyPI publish: duplicate License heading removed, homepage link kept on `www`, and tracked credential links use UTM parameters.
|
|
15
|
+
|
|
16
|
+
## [0.2.0] — 2026-04-13
|
|
9
17
|
|
|
10
18
|
### Added
|
|
11
19
|
|
|
@@ -18,11 +26,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
18
26
|
- **Config management**: `config show/set/unset/path` subcommands, TOML config at `~/.config/cometapi/config.toml`
|
|
19
27
|
- **Persistent output_format**: set default output format in `config.toml`
|
|
20
28
|
- **Doctor diagnostics**: connectivity, auth, SDK, and config health checks
|
|
21
|
-
- **Setup wizard**: `cometapi init` with API key validation
|
|
29
|
+
- **Setup wizard**: `cometapi init` with API key validation, existing config detection, and reconfiguration flow
|
|
22
30
|
- **Shell completion**: bash, zsh, fish, powershell
|
|
23
31
|
- **Error handling**: structured exit codes (sysexits.h compatible), user-friendly messages
|
|
24
32
|
- **Security**: credential masking, 0600 file permissions, creation URL guidance
|
|
25
|
-
- **CI/CD**: GitHub Actions for testing (Python 3.10–3.13) and
|
|
33
|
+
- **CI/CD**: GitHub Actions for testing (Python 3.10–3.13), PyPI publishing, and GitHub Releases
|
|
26
34
|
|
|
27
35
|
### Changed
|
|
28
36
|
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our
|
|
6
|
+
community a harassment-free experience for everyone, regardless of age, body
|
|
7
|
+
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
|
8
|
+
identity and expression, level of experience, education, socio-economic status,
|
|
9
|
+
nationality, personal appearance, race, caste, color, religion, or sexual
|
|
10
|
+
identity and orientation.
|
|
11
|
+
|
|
12
|
+
## Our Standards
|
|
13
|
+
|
|
14
|
+
Examples of behavior that contributes to a positive environment:
|
|
15
|
+
|
|
16
|
+
- Using welcoming and inclusive language
|
|
17
|
+
- Being respectful of differing viewpoints and experiences
|
|
18
|
+
- Gracefully accepting constructive criticism
|
|
19
|
+
- Focusing on what is best for the community
|
|
20
|
+
- Showing empathy towards other community members
|
|
21
|
+
|
|
22
|
+
Examples of unacceptable behavior:
|
|
23
|
+
|
|
24
|
+
- The use of sexualized language or imagery, and sexual attention or advances of any kind
|
|
25
|
+
- Trolling, insulting or derogatory comments, and personal or political attacks
|
|
26
|
+
- Public or private harassment
|
|
27
|
+
- Publishing others' private information without explicit permission
|
|
28
|
+
- Other conduct which could reasonably be considered inappropriate in a professional setting
|
|
29
|
+
|
|
30
|
+
## Enforcement Responsibilities
|
|
31
|
+
|
|
32
|
+
Community leaders are responsible for clarifying and enforcing our standards of
|
|
33
|
+
acceptable behavior and will take appropriate and fair corrective action in
|
|
34
|
+
response to any behavior that they deem inappropriate, threatening, offensive,
|
|
35
|
+
or harmful.
|
|
36
|
+
|
|
37
|
+
## Scope
|
|
38
|
+
|
|
39
|
+
This Code of Conduct applies within all community spaces, and also applies when
|
|
40
|
+
an individual is officially representing the community in public spaces.
|
|
41
|
+
|
|
42
|
+
## Enforcement
|
|
43
|
+
|
|
44
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
45
|
+
reported to the community leaders responsible for enforcement at
|
|
46
|
+
**support@cometapi.com**.
|
|
47
|
+
|
|
48
|
+
All complaints will be reviewed and investigated promptly and fairly.
|
|
49
|
+
|
|
50
|
+
## Attribution
|
|
51
|
+
|
|
52
|
+
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/),
|
|
53
|
+
version 2.1, available at
|
|
54
|
+
<https://www.contributor-covenant.org/version/2/1/code_of_conduct.html>.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Contributing to CometAPI CLI
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in contributing! Here's how to get started.
|
|
4
|
+
|
|
5
|
+
## Development Setup
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
git clone https://github.com/cometapi-dev/cometapi-cli.git
|
|
9
|
+
cd cometapi-cli
|
|
10
|
+
uv sync --extra dev
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Making Changes
|
|
14
|
+
|
|
15
|
+
1. **Fork** the repository and create a feature branch from `main`.
|
|
16
|
+
2. **Write or update tests** for your change.
|
|
17
|
+
3. **Run tests and lint** before submitting:
|
|
18
|
+
```bash
|
|
19
|
+
uv run pytest -v
|
|
20
|
+
uv run ruff check src/ tests/
|
|
21
|
+
```
|
|
22
|
+
4. **Open a pull request** with a clear description of the change.
|
|
23
|
+
|
|
24
|
+
## Code Style
|
|
25
|
+
|
|
26
|
+
- Follow [Ruff](https://docs.astral.sh/ruff/) defaults (configured in `pyproject.toml`).
|
|
27
|
+
- Keep the code typed — use type hints for all public functions.
|
|
28
|
+
- All network calls go through `CometClient` — never use raw HTTP in commands.
|
|
29
|
+
|
|
30
|
+
## Reporting Bugs
|
|
31
|
+
|
|
32
|
+
Open an issue using the **Bug Report** template. Include:
|
|
33
|
+
- CLI version (`cometapi --version`)
|
|
34
|
+
- Python version
|
|
35
|
+
- OS
|
|
36
|
+
- Steps to reproduce
|
|
37
|
+
|
|
38
|
+
## Suggesting Features
|
|
39
|
+
|
|
40
|
+
Open an issue using the **Feature Request** template.
|
|
41
|
+
|
|
42
|
+
## Code of Conduct
|
|
43
|
+
|
|
44
|
+
This project follows the [Contributor Covenant Code of Conduct](CODE_OF_CONDUCT.md). By participating, you agree to abide by its terms.
|
|
45
|
+
|
|
46
|
+
## License
|
|
47
|
+
|
|
48
|
+
By contributing, you agree that your contributions will be licensed under the [MIT License](LICENSE).
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cometapi-cli
|
|
3
|
-
Version: 0.1
|
|
3
|
+
Version: 0.2.1
|
|
4
4
|
Summary: CometAPI CLI — official command-line interface for the CometAPI AI gateway
|
|
5
|
-
Project-URL: Homepage, https://github.com/
|
|
6
|
-
Project-URL: Repository, https://github.com/
|
|
5
|
+
Project-URL: Homepage, https://github.com/cometapi-dev/cometapi-cli
|
|
6
|
+
Project-URL: Repository, https://github.com/cometapi-dev/cometapi-cli
|
|
7
7
|
Project-URL: Documentation, https://docs.cometapi.com
|
|
8
|
-
Project-URL: Changelog, https://github.com/
|
|
9
|
-
Project-URL: Issues, https://github.com/
|
|
8
|
+
Project-URL: Changelog, https://github.com/cometapi-dev/cometapi-cli/blob/main/CHANGELOG.md
|
|
9
|
+
Project-URL: Issues, https://github.com/cometapi-dev/cometapi-cli/issues
|
|
10
10
|
Author-email: CometAPI <support@cometapi.com>
|
|
11
11
|
License: MIT
|
|
12
12
|
License-File: LICENSE
|
|
@@ -42,7 +42,7 @@ Description-Content-Type: text/markdown
|
|
|
42
42
|
[](https://pypi.org/project/cometapi-cli/)
|
|
43
43
|
[](LICENSE)
|
|
44
44
|
|
|
45
|
-
> **Official command-line interface for [CometAPI](https://cometapi.com)** — 500+ AI Model API, All In One API.
|
|
45
|
+
> **Official command-line interface for [CometAPI](https://www.cometapi.com/?utm_source=cometapi-cli&utm_medium=readme&utm_campaign=oss&utm_content=homepage)** — 500+ AI Model API, All In One API.
|
|
46
46
|
|
|
47
47
|
Access 500+ AI models at low cost, directly from the terminal. Chat, search models, check usage, and manage your account — all through a single API key.
|
|
48
48
|
|
|
@@ -59,7 +59,7 @@ pipx install cometapi-cli # isolated environment
|
|
|
59
59
|
uv tool install cometapi-cli # uv
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
-
**Prerequisites**: Python 3.10+ · [
|
|
62
|
+
**Prerequisites**: Python 3.10+ · [CometAPI Key](https://www.cometapi.com/console/token?utm_source=cometapi-cli&utm_medium=readme&utm_campaign=oss&utm_content=prerequisites)
|
|
63
63
|
|
|
64
64
|
## Quick Start
|
|
65
65
|
|
|
@@ -77,8 +77,8 @@ cometapi models --search gpt --limit 10
|
|
|
77
77
|
Or configure manually:
|
|
78
78
|
|
|
79
79
|
```bash
|
|
80
|
-
export COMETAPI_KEY="your-api-key" # https://www.cometapi.com/console/token
|
|
81
|
-
export COMETAPI_ACCESS_TOKEN="your-access-token" # https://www.cometapi.com/console/personal (optional)
|
|
80
|
+
export COMETAPI_KEY="your-api-key" # https://www.cometapi.com/console/token?utm_source=cometapi-cli&utm_medium=readme&utm_campaign=oss&utm_content=env-api-key
|
|
81
|
+
export COMETAPI_ACCESS_TOKEN="your-access-token" # https://www.cometapi.com/console/personal?utm_source=cometapi-cli&utm_medium=readme&utm_campaign=oss&utm_content=env-access-token (optional)
|
|
82
82
|
```
|
|
83
83
|
|
|
84
84
|
## Commands
|
|
@@ -164,6 +164,20 @@ cometapi config unset api_key # Remove a value
|
|
|
164
164
|
cometapi config path # Show config file path
|
|
165
165
|
```
|
|
166
166
|
|
|
167
|
+
### Examples
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
# Switch default output to JSON (all commands)
|
|
171
|
+
cometapi config set output_format json
|
|
172
|
+
|
|
173
|
+
# Change default model
|
|
174
|
+
cometapi config set default_model claude-sonnet-4-6
|
|
175
|
+
|
|
176
|
+
# Override per-command (regardless of config)
|
|
177
|
+
cometapi models --format yaml
|
|
178
|
+
cometapi balance --json
|
|
179
|
+
```
|
|
180
|
+
|
|
167
181
|
**Priority**: CLI flags > config file > environment variables > defaults
|
|
168
182
|
|
|
169
183
|
| Key | Env Variable | Description |
|
|
@@ -186,7 +200,7 @@ CometAPI CLI is designed to be agent-friendly:
|
|
|
186
200
|
## Development
|
|
187
201
|
|
|
188
202
|
```bash
|
|
189
|
-
git clone https://github.com/
|
|
203
|
+
git clone https://github.com/cometapi-dev/cometapi-cli.git
|
|
190
204
|
cd cometapi-cli
|
|
191
205
|
uv sync --extra dev
|
|
192
206
|
|
|
@@ -199,7 +213,7 @@ uv run cometapi --version # verify
|
|
|
199
213
|
<summary>Without uv (pip)</summary>
|
|
200
214
|
|
|
201
215
|
```bash
|
|
202
|
-
git clone https://github.com/
|
|
216
|
+
git clone https://github.com/cometapi-dev/cometapi-cli.git
|
|
203
217
|
cd cometapi-cli
|
|
204
218
|
pip install -e ".[dev]"
|
|
205
219
|
pytest -v
|
|
@@ -212,7 +226,7 @@ pytest -v
|
|
|
212
226
|
- API keys and access tokens are **never** logged or displayed in full — only the last 4 characters are shown
|
|
213
227
|
- Config files are stored with restrictive permissions (`0600`)
|
|
214
228
|
- Credentials should **never** be committed to version control
|
|
215
|
-
- Create credentials at: [API Key](https://www.cometapi.com/console/token) · [Access Token](https://www.cometapi.com/console/personal)
|
|
229
|
+
- Create credentials at: [API Key](https://www.cometapi.com/console/token?utm_source=cometapi-cli&utm_medium=readme&utm_campaign=oss&utm_content=security-api-key) · [Access Token](https://www.cometapi.com/console/personal?utm_source=cometapi-cli&utm_medium=readme&utm_campaign=oss&utm_content=security-access-token)
|
|
216
230
|
- **Disclaimer**: You are responsible for all usage and charges incurred with your API keys
|
|
217
231
|
|
|
218
232
|
## Troubleshooting
|
|
@@ -223,6 +237,10 @@ pytest -v
|
|
|
223
237
|
| `Connection failed` | Run `cometapi doctor` to diagnose connectivity |
|
|
224
238
|
| `Access token not configured` | Only needed for `account`/`stats` commands — run `cometapi init` to add one |
|
|
225
239
|
|
|
240
|
+
## Contributing
|
|
241
|
+
|
|
242
|
+
Contributions are welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
|
|
243
|
+
|
|
226
244
|
## License
|
|
227
245
|
|
|
228
|
-
MIT
|
|
246
|
+
This project is licensed under the [MIT License](LICENSE).
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
[](https://pypi.org/project/cometapi-cli/)
|
|
5
5
|
[](LICENSE)
|
|
6
6
|
|
|
7
|
-
> **Official command-line interface for [CometAPI](https://cometapi.com)** — 500+ AI Model API, All In One API.
|
|
7
|
+
> **Official command-line interface for [CometAPI](https://www.cometapi.com/?utm_source=cometapi-cli&utm_medium=readme&utm_campaign=oss&utm_content=homepage)** — 500+ AI Model API, All In One API.
|
|
8
8
|
|
|
9
9
|
Access 500+ AI models at low cost, directly from the terminal. Chat, search models, check usage, and manage your account — all through a single API key.
|
|
10
10
|
|
|
@@ -21,7 +21,7 @@ pipx install cometapi-cli # isolated environment
|
|
|
21
21
|
uv tool install cometapi-cli # uv
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
-
**Prerequisites**: Python 3.10+ · [
|
|
24
|
+
**Prerequisites**: Python 3.10+ · [CometAPI Key](https://www.cometapi.com/console/token?utm_source=cometapi-cli&utm_medium=readme&utm_campaign=oss&utm_content=prerequisites)
|
|
25
25
|
|
|
26
26
|
## Quick Start
|
|
27
27
|
|
|
@@ -39,8 +39,8 @@ cometapi models --search gpt --limit 10
|
|
|
39
39
|
Or configure manually:
|
|
40
40
|
|
|
41
41
|
```bash
|
|
42
|
-
export COMETAPI_KEY="your-api-key" # https://www.cometapi.com/console/token
|
|
43
|
-
export COMETAPI_ACCESS_TOKEN="your-access-token" # https://www.cometapi.com/console/personal (optional)
|
|
42
|
+
export COMETAPI_KEY="your-api-key" # https://www.cometapi.com/console/token?utm_source=cometapi-cli&utm_medium=readme&utm_campaign=oss&utm_content=env-api-key
|
|
43
|
+
export COMETAPI_ACCESS_TOKEN="your-access-token" # https://www.cometapi.com/console/personal?utm_source=cometapi-cli&utm_medium=readme&utm_campaign=oss&utm_content=env-access-token (optional)
|
|
44
44
|
```
|
|
45
45
|
|
|
46
46
|
## Commands
|
|
@@ -126,6 +126,20 @@ cometapi config unset api_key # Remove a value
|
|
|
126
126
|
cometapi config path # Show config file path
|
|
127
127
|
```
|
|
128
128
|
|
|
129
|
+
### Examples
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
# Switch default output to JSON (all commands)
|
|
133
|
+
cometapi config set output_format json
|
|
134
|
+
|
|
135
|
+
# Change default model
|
|
136
|
+
cometapi config set default_model claude-sonnet-4-6
|
|
137
|
+
|
|
138
|
+
# Override per-command (regardless of config)
|
|
139
|
+
cometapi models --format yaml
|
|
140
|
+
cometapi balance --json
|
|
141
|
+
```
|
|
142
|
+
|
|
129
143
|
**Priority**: CLI flags > config file > environment variables > defaults
|
|
130
144
|
|
|
131
145
|
| Key | Env Variable | Description |
|
|
@@ -148,7 +162,7 @@ CometAPI CLI is designed to be agent-friendly:
|
|
|
148
162
|
## Development
|
|
149
163
|
|
|
150
164
|
```bash
|
|
151
|
-
git clone https://github.com/
|
|
165
|
+
git clone https://github.com/cometapi-dev/cometapi-cli.git
|
|
152
166
|
cd cometapi-cli
|
|
153
167
|
uv sync --extra dev
|
|
154
168
|
|
|
@@ -161,7 +175,7 @@ uv run cometapi --version # verify
|
|
|
161
175
|
<summary>Without uv (pip)</summary>
|
|
162
176
|
|
|
163
177
|
```bash
|
|
164
|
-
git clone https://github.com/
|
|
178
|
+
git clone https://github.com/cometapi-dev/cometapi-cli.git
|
|
165
179
|
cd cometapi-cli
|
|
166
180
|
pip install -e ".[dev]"
|
|
167
181
|
pytest -v
|
|
@@ -174,7 +188,7 @@ pytest -v
|
|
|
174
188
|
- API keys and access tokens are **never** logged or displayed in full — only the last 4 characters are shown
|
|
175
189
|
- Config files are stored with restrictive permissions (`0600`)
|
|
176
190
|
- Credentials should **never** be committed to version control
|
|
177
|
-
- Create credentials at: [API Key](https://www.cometapi.com/console/token) · [Access Token](https://www.cometapi.com/console/personal)
|
|
191
|
+
- Create credentials at: [API Key](https://www.cometapi.com/console/token?utm_source=cometapi-cli&utm_medium=readme&utm_campaign=oss&utm_content=security-api-key) · [Access Token](https://www.cometapi.com/console/personal?utm_source=cometapi-cli&utm_medium=readme&utm_campaign=oss&utm_content=security-access-token)
|
|
178
192
|
- **Disclaimer**: You are responsible for all usage and charges incurred with your API keys
|
|
179
193
|
|
|
180
194
|
## Troubleshooting
|
|
@@ -185,6 +199,10 @@ pytest -v
|
|
|
185
199
|
| `Connection failed` | Run `cometapi doctor` to diagnose connectivity |
|
|
186
200
|
| `Access token not configured` | Only needed for `account`/`stats` commands — run `cometapi init` to add one |
|
|
187
201
|
|
|
202
|
+
## Contributing
|
|
203
|
+
|
|
204
|
+
Contributions are welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
|
|
205
|
+
|
|
188
206
|
## License
|
|
189
207
|
|
|
190
|
-
MIT
|
|
208
|
+
This project is licensed under the [MIT License](LICENSE).
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
## Supported Versions
|
|
4
|
+
|
|
5
|
+
| Version | Supported |
|
|
6
|
+
|---------|-----------|
|
|
7
|
+
| 0.2.x | ✅ |
|
|
8
|
+
| < 0.2 | ❌ |
|
|
9
|
+
|
|
10
|
+
## Reporting a Vulnerability
|
|
11
|
+
|
|
12
|
+
If you discover a security vulnerability, please report it responsibly:
|
|
13
|
+
|
|
14
|
+
1. **Do NOT open a public issue.**
|
|
15
|
+
2. Email **support@cometapi.com** with details of the vulnerability.
|
|
16
|
+
3. Include steps to reproduce, if possible.
|
|
17
|
+
|
|
18
|
+
We will acknowledge receipt within 48 hours and aim to provide a fix or mitigation plan within 7 days.
|
|
19
|
+
|
|
20
|
+
## Security Practices
|
|
21
|
+
|
|
22
|
+
- API keys and access tokens are **never** logged or displayed in full — only the last 4 characters are shown.
|
|
23
|
+
- Config files are stored with restrictive permissions (`0600`).
|
|
24
|
+
- Credentials should **never** be committed to version control.
|
|
25
|
+
- Create credentials at:
|
|
26
|
+
- API Key: https://www.cometapi.com/console/token
|
|
27
|
+
- Access Token: https://www.cometapi.com/console/personal
|
|
@@ -18,14 +18,16 @@ No credentials required — this command sets them up.
|
|
|
18
18
|
|
|
19
19
|
## Wizard Flow
|
|
20
20
|
|
|
21
|
-
1. **
|
|
22
|
-
2. **
|
|
23
|
-
3. **
|
|
24
|
-
4. **
|
|
25
|
-
5. **
|
|
26
|
-
6. **
|
|
21
|
+
1. **Existing config check** — if a config file exists, displays a summary of current settings (secrets masked) and asks whether to continue with reconfiguration. User can abort to keep config unchanged.
|
|
22
|
+
2. **Security notice** — displays a warning about credential handling and links to creation pages.
|
|
23
|
+
3. **API key prompt** — asks for `COMETAPI_KEY`. Shows current value (masked) as default if already configured. Displays `(Enter to keep)` hint when a value exists.
|
|
24
|
+
4. **Connectivity test** — if an API key is provided, tests connectivity by calling `models.list()`.
|
|
25
|
+
5. **Access token prompt** — asks whether to configure `COMETAPI_ACCESS_TOKEN` (optional). Shows current value (masked) as default. Displays `(Enter to keep)` hint when a value exists.
|
|
26
|
+
6. **Default model** — asks for the default model to use with `chat` (default: `gpt-5.4`).
|
|
27
|
+
7. **Default output format** — asks for the default output format (default: `table`).
|
|
28
|
+
8. **Save** — writes configuration to `~/.config/cometapi/config.toml` with `0600` permissions. If no values were changed, skips writing and displays "No changes made."
|
|
27
29
|
|
|
28
|
-
## Example Session
|
|
30
|
+
## Example Session (First Run)
|
|
29
31
|
|
|
30
32
|
```
|
|
31
33
|
🚀 Welcome
|
|
@@ -49,6 +51,7 @@ Configure access token? (for account/stats commands) [y/n]: y
|
|
|
49
51
|
Access Token (COMETAPI_ACCESS_TOKEN): pat-...
|
|
50
52
|
|
|
51
53
|
Default model [gpt-5.4]: gpt-5.4
|
|
54
|
+
Default output format (table, json, yaml, csv, markdown) [table]: table
|
|
52
55
|
|
|
53
56
|
✅ Setup Complete
|
|
54
57
|
Configuration saved to /Users/you/.config/cometapi/config.toml
|
|
@@ -62,7 +65,25 @@ Next steps:
|
|
|
62
65
|
|
|
63
66
|
## Re-Running Init
|
|
64
67
|
|
|
65
|
-
|
|
68
|
+
When a configuration file already exists, `init` displays a summary of current settings and prompts for confirmation before proceeding:
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
📋 Current Config
|
|
72
|
+
Existing configuration found:
|
|
73
|
+
|
|
74
|
+
api_key = ****abcd
|
|
75
|
+
access_token = ****wxyz
|
|
76
|
+
default_model = gpt-5.4
|
|
77
|
+
output_format = table
|
|
78
|
+
|
|
79
|
+
Press Enter on each prompt to keep the current value.
|
|
80
|
+
|
|
81
|
+
Continue with reconfiguration? [Y/n]:
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
- Press **Enter** or **y** to proceed — each prompt shows `(Enter to keep)` so you can skip unchanged fields.
|
|
85
|
+
- Press **n** to abort — config file remains untouched.
|
|
86
|
+
- If you go through all prompts without changing anything, the wizard prints "No changes made" and does not rewrite the file.
|
|
66
87
|
|
|
67
88
|
## Credential Links
|
|
68
89
|
|
|
@@ -22,7 +22,7 @@ Requires `COMETAPI_KEY`. Access token is not needed.
|
|
|
22
22
|
|
|
23
23
|
## Behavior
|
|
24
24
|
|
|
25
|
-
- Results are sorted
|
|
25
|
+
- Results are sorted in descending natural/version-aware order so newer model IDs surface first.
|
|
26
26
|
- `--search` performs a case-insensitive substring match on the model `id` field.
|
|
27
27
|
- `--limit` is applied after filtering and sorting.
|
|
28
28
|
|
|
@@ -31,7 +31,6 @@ Requires `COMETAPI_KEY`. Access token is not needed.
|
|
|
31
31
|
| Column | Description |
|
|
32
32
|
|--------|-------------|
|
|
33
33
|
| `id` | Model identifier (e.g., `gpt-5.4`, `claude-sonnet-4-6`) |
|
|
34
|
-
| `owned_by` | Model provider (e.g., `openai`, `anthropic`) |
|
|
35
34
|
|
|
36
35
|
## Examples
|
|
37
36
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "cometapi-cli"
|
|
3
|
-
version = "0.1
|
|
3
|
+
version = "0.2.1"
|
|
4
4
|
description = "CometAPI CLI — official command-line interface for the CometAPI AI gateway"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
license = { text = "MIT" }
|
|
@@ -40,11 +40,11 @@ dev = [
|
|
|
40
40
|
]
|
|
41
41
|
|
|
42
42
|
[project.urls]
|
|
43
|
-
Homepage = "https://github.com/
|
|
44
|
-
Repository = "https://github.com/
|
|
43
|
+
Homepage = "https://github.com/cometapi-dev/cometapi-cli"
|
|
44
|
+
Repository = "https://github.com/cometapi-dev/cometapi-cli"
|
|
45
45
|
Documentation = "https://docs.cometapi.com"
|
|
46
|
-
Changelog = "https://github.com/
|
|
47
|
-
Issues = "https://github.com/
|
|
46
|
+
Changelog = "https://github.com/cometapi-dev/cometapi-cli/blob/main/CHANGELOG.md"
|
|
47
|
+
Issues = "https://github.com/cometapi-dev/cometapi-cli/issues"
|
|
48
48
|
|
|
49
49
|
[project.scripts]
|
|
50
50
|
cometapi = "cometapi_cli.app:app"
|
|
@@ -33,11 +33,11 @@ def main(
|
|
|
33
33
|
ctx: typer.Context,
|
|
34
34
|
version: Annotated[
|
|
35
35
|
bool | None,
|
|
36
|
-
typer.Option("--version", "-V", help="Show version and exit.", callback=_version_callback, is_eager=True),
|
|
36
|
+
typer.Option("--version", "-V", "-v", help="Show version and exit.", callback=_version_callback, is_eager=True),
|
|
37
37
|
] = None,
|
|
38
38
|
output_format: Annotated[
|
|
39
39
|
OutputFormat,
|
|
40
|
-
typer.Option("--format", "-f", help="Output format."),
|
|
40
|
+
typer.Option("--format", "-f", help="Output format (table, json, yaml, csv, markdown)."),
|
|
41
41
|
] = OutputFormat.TABLE,
|
|
42
42
|
json_output: Annotated[
|
|
43
43
|
bool,
|
|
@@ -14,7 +14,7 @@ from ..formatters import OutputFormat, output, resolve_format
|
|
|
14
14
|
@handle_errors
|
|
15
15
|
def account(
|
|
16
16
|
ctx: typer.Context,
|
|
17
|
-
output_format: Annotated[OutputFormat | None, typer.Option("--format", "-f", help="Output format.")] = None,
|
|
17
|
+
output_format: Annotated[OutputFormat | None, typer.Option("--format", "-f", help="Output format (table, json, yaml, csv, markdown).")] = None,
|
|
18
18
|
json_output: Annotated[bool, typer.Option("--json", help="Output as JSON.")] = False,
|
|
19
19
|
) -> None:
|
|
20
20
|
"""Show your CometAPI account profile (requires access token)."""
|
|
@@ -18,7 +18,7 @@ def balance(
|
|
|
18
18
|
str | None,
|
|
19
19
|
typer.Option("--source", "-s", help="Data source: 'account' (full account) or 'token' (current API key)."),
|
|
20
20
|
] = None,
|
|
21
|
-
output_format: Annotated[OutputFormat | None, typer.Option("--format", "-f", help="Output format.")] = None,
|
|
21
|
+
output_format: Annotated[OutputFormat | None, typer.Option("--format", "-f", help="Output format (table, json, yaml, csv, markdown).")] = None,
|
|
22
22
|
json_output: Annotated[bool, typer.Option("--json", help="Output as JSON.")] = False,
|
|
23
23
|
) -> None:
|
|
24
24
|
"""Show your CometAPI account balance.
|