Open
Conversation
- Add 'aish models usage' command to show token/credit usage - Support auto-detect provider from model name - Support OpenAI, DeepSeek, OpenRouter usage API - Display API key status with masked display - Show usage dashboard links for all providers
F16shen
requested changes
Mar 16, 2026
Collaborator
F16shen
left a comment
There was a problem hiding this comment.
这个分支是按旧主线写的,但当前 main 已经把 models auth login 抽成通用 provider framework 了,所以这部分不能直接合并。请不要在 cli.py 里重新写一套只支持 openai-codex 的登录逻辑,也不要自己调用 codex login;当前主线已经通过 cli.py:265、registry.py:88 和 openai_codex.py:1265 统一处理 provider auth 了,你的改动需要基于这套结构重做。
另外,models usage 现在这版也需要调整:不要靠 model 字符串猜 provider,也不要只看 config.model_config.api_key,因为主线还支持环境变量和 LiteLLM 默认鉴权。建议第一版先只输出当前 provider、auth 状态和 dashboard 链接;如果要查实时 usage,再把能力做成 provider 层接口并补测试,参考 test_cli.py:354 现有的 provider-contract 测试方式。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add feature/models-usage-command branch