auth.ts package.json
+12 −1 3-const session = getStoredSession()
4+const session = await refreshToken(stored)
6+export async function refreshToken(t: string)
{
7+const res = await fetch({
8+url: '/api/refresh',
9+method: 'POST',
10+body: JSON.stringify({ t }),
11+})
12+return res.json()
13+}
15+if (session.expired) {
16+return redirect('/login?reason=expired')
17+}
package.json
19+"next": "^14.2.0"
feat auth
add token refresh endpoint
fix ui
redirect on session expiry
chore deps
bump next to 14.2.0
$ aic commit --all ▋
✓ 3 commits created in 4.2s — view on GitHub →
02 — 工作原理
安装一次 → 输入 aic → 干净提交。
- 01 安装 brew install aic
- 02 配置 provider · key · model — 或你的本地 agent
- 03 运行 type: aic
- 04 读取 读取 diff
- 05 起草 写好提交信息
- 06 提交 搞定 ✓
aic
$ aic
⟢ agent starting
config .aic.yml
model gpt-4o-mini · fast
ready ✓ 0.8s
analyzing repository
⟢ analyzing 12 changed files
auth/refresh.ts ┐ token rotation
auth/verify.ts ┘
Redirect.tsx session expiry fix
package.json ┐ dependency bump
lock.json ┘
3 commit groups identified
━━ proposed plan ━━
1 feat(auth): refresh token rotation
2 fix(ui): redirect on session expiry
3 chore: bump dependencies
→ aic commit --all
✓ abc1234 chore: bump dependencies
✓ def5678 fix(ui): redirect on expiry
✓ ghi9012 feat(auth): refresh token rotation
12 files → 3 commits in 4.2s
▋ 03 — 自动批处理
到文件边界为止
一个文件,多个提交
其他提交工具都止步于文件边界——一个文件,一条信息。aic 在 hunk 层级读取你的 diff,所以一个涉及三处改动的文件会变成三个聚焦的约定式提交。没有暂存、一条命令、一份真正能干净回读的历史。
按 hunk 批处理 ✦
查看 aic 在最佳 AI 提交工具中的位置 →17 种提交类型 · WCAG 安全配色
feat improvement fix perf hotfix revert docs deps style ci refactor chore build release security test wip
04 — 解决冲突
解决合并冲突。
合并到一半?一条命令。aic 读取每个冲突文件,提出无标记的解决方案,并在落盘前展示合并后的 diff。每个文件单独 y/n——批准你信任的,拒绝其余的,然后它完成合并。
05 — 带上你的 agent
带上你的 agent,而不是你的密钥。
已经在用 Claude Code、Codex、Cursor 或 Gemini?以无头模式把 aic 指向你的 agent——它传递 diff,你的 agent 写提交信息,aic 提交。无需 API 密钥,无需默认模型:复用你 agent 自己的认证。
06 — 供应商与隐私
你的密钥 · 你的模型
自带供应商。aic 直连你的 LLM——没有中间人,没有按提交计费,没有代理。你的 API 密钥永不离开你的机器。
- OpenAI
- Anthropic
- Gemini
- DeepSeek
- Groq
- Ollama
- xAI
- Mistral
- OpenRouter
- Perplexity
- Together
- OpenAI-compatible
- OpenAI
- gpt-5-mini
- Anthropic
- claude-haiku-4-5
- Gemini
- gemini-2.5-flash
- DeepSeek
- deepseek-v4-flash
- Groq
- llama-3.3-70b-versatile
- Ollama
- llama3.3
- xAI
- grok-4.3
- Mistral
- mistral-small-latest
- OpenRouter
- (你的模型)
- Perplexity
- sonar
- Together
- meta-llama/Llama-3.3-70B-Instruct-Turbo
- OpenAI-compatible
- (你的模型)
无中间人 · 无按提交计费 · 调用直接从你的机器发出
保存配置 · 用 aic use 切换
07 — 安装
一行安装 aic。
- 免费 & MIT
- 无需 Node.js
- 12 个供应商
- 兼容你的 pre-commit 钩子
- 密钥永不离机
brew install CaicoLeung/aic/aic 用 `brew upgrade aic` 更新。Homebrew 安装会被自动识别,因此 `aic update` 会引导你转用 brew。
curl --proto '=https' --tlsv1.2 -sSfL https://github.com/CaicoLeung/aic/releases/latest/download/aic-installer.sh | sh 从 GitHub Releases 下载最新发布版本的可执行文件。
irm https://github.com/CaicoLeung/aic/releases/latest/download/aic-installer.ps1 | iex PowerShell。下载最新发布版本的可执行文件。
然后运行 aic setup 来选择供应商、密钥和模型。