Codineer v0.6.2
Features
- Credential chain module — Unified credential resolution framework with priority-based CredentialChain. Built-in resolvers: EnvVarResolver (API key / bearer token from env vars), CodineerOAuthResolver (saved OAuth tokens with auto-refresh), ClaudeCodeResolver (auto-discover credentials from Claude Code ~/.claude/.credentials.json or macOS Keychain). (04c81cb)
- Fallback models — Parse fallbackModels string array from settings.json. When the primary model lacks credentials, Codineer tries each fallback in order. (8d337c5)
- Model listing API — Add ModelAliasEntry, list_builtin_models(), provider_kind_by_name(), and ProviderKind::display_name() for human-readable provider labels. (ff4e273)
- CLI redesign with hierarchical commands (fd2ca16):
- codineer login [] [--source ] / logout / status with per-provider credential chain
- codineer config set|get|list for settings management (replaces manual JSON editing)
- codineer models [] with per-provider filtering and live Ollama model query
- Model fallback chain integrated into startup flow
- Subcommand typo suggestions via edit distance
- 37 new CLI tests
Bug Fixes
- Platform-specific session token path — DEFAULT_SESSION_TOKEN_PATH is now platform-aware: /run/codineer/ on Linux, /tmp/codineer/ on macOS, env var required on Windows. Windows sandbox processes now set USERPROFILE/TEMP/TMP matching Unix HOME/TMPDIR behavior. (2e556a6)
- Credential auto-discover defaults — CredentialConfig now defaults auto_discover and claude_code_enabled to true (was false due to #[derive(Default)]). Fixes codineer login anthropic --source claude-code returning "unknown credential source". (b544744)
- Auto-discover login UX — codineer login --source claude-code now checks if credentials exist and prints actionable guidance instead of "does not support interactive login". (1c07c48)
Documentation
- Add settings.example.json link and expand settings reference table with oauth, sandbox, enabledPlugins fields. (361cee1)
- Align READMEs (EN + CN), settings.example.json, and help text with source code: fix comparison table formatting, add credential chain docs, fallback models docs, Quick Start examples. (e278ed4)
Chores
- Rotate OAuth client_id to a fresh UUID. (bf0267b)
新功能
- 凭据链模块 — 统一的凭据解析框架,基于优先级的 CredentialChain。内置三种解析器:EnvVarResolver(环境变量 API key / Bearer token)、CodineerOAuthResolver(已保存的 OAuth token 并支持自动刷新)、ClaudeCodeResolver(从 Claude Code 的 ~/.claude/.credentials.json 或 macOS 钥匙串自动发现凭据)。(04c81cb)
- 模型回退 — 从 settings.json 解析 fallbackModels 字符串数组。当主模型缺少凭据时,Codineer 依序尝试每个回退模型。(8d337c5)
- 模型列表 API — 新增 ModelAliasEntry、list_builtin_models()、provider_kind_by_name() 和 ProviderKind::display_name(),提供人类可读的 Provider 标签。(ff4e273)
- CLI 层级命令重构 (fd2ca16):
- codineer login [] [--source ] / logout / status,支持按 Provider 管理凭据链
- codineer config set|get|list 配置管理命令(替代手工编辑 JSON)
- codineer models [] 按 Provider 筛选,支持实时查询 Ollama 模型
- 启动流程集成模型回退链
- 子命令拼写纠错建议(编辑距离算法)
- 新增 37 个 CLI 测试
Bug 修复
- 平台特定 session token 路径 — DEFAULT_SESSION_TOKEN_PATH 现已区分平台:Linux 使用 /run/codineer/,macOS 使用 /tmp/codineer/,Windows 需通过环境变量指定。Windows 沙箱进程现设置 USERPROFILE/TEMP/TMP,与 Unix 的 HOME/TMPDIR 行为对齐。(2e556a6)
- 凭据自动发现默认值 — CredentialConfig 的 auto_discover 和 claude_code_enabled 默认值改为 true(此前因 #[derive(Default)] 默认为 false)。修复 codineer login anthropic --source claude-code 报 "unknown credential source" 的问题。(b544744)
- 自动发现源登录体验 — codineer login --source claude-code 现在会检查凭据是否存在并给出可操作的引导,而非显示 "does not support interactive login"。(1c07c48)
文档
- 新增 settings.example.json 链接,扩展配置参考表,补充 oauth、sandbox、enabledPlugins 字段。(361cee1)
- 对齐中英文 README、settings.example.json 和 help 文本与源码:修复对比表格式、新增凭据链文档、回退模型文档、快速开始示例。(e278ed4)
杂项
- 更换 OAuth client_id 为新 UUID。(bf0267b)
Full Changelog: v0.6.1...v0.6.2
Full Changelog: v0.6.1...v0.6.2