Feature Request: 在 UI 中开放「从 JSON 文件批量导入账号」功能(后端 account_upsert 已支持)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- javascript, typescript
- Domain
- frontend
Research direction
Start from the existing "Add account" panel in the renderer UI and the backend AccountsManager.upsertAccount() it already calls, then trace how account_upsert is reached over control.sock. Add a file/directory picker that parses single-account and array JSON, validates email and refresh_token, and reports imported vs skipped counts. Done means the new entry point works from the UI and reuses the existing dedup-by-email/id upsert rather than new storage logic. Frontend file names are not given, so locating the panel is the first task.
Written by the indexing model from the issue text.
Description
背景与痛点
目前在 GravityBox「添加账号」界面中,仅提供:
- 保存当前账号(从正在运行的 Antigravity 客户端导入当前登录态)
- Google 授权登录…(通过浏览器走 OAuth)
但在查看后端源码时发现,核心引擎已经内置了完整的 account_upsert(AccountsManager.upsertAccount())能力,能够直接接收单个账号 JSON 对象(包含 id、email、name、token 等字段)完成入库。然而前端 UI 尚未开放从本地 JSON 文件导入账号的入口。
对于从其他工具(如 Antigravity Tools ~/.antigravity_tools/accounts/)迁移过来的多账号用户,如果手里有 5~10 个账号,只能逐个重新在浏览器里走一遍 Google OAuth 登录,或者手动写脚本调用 control.sock 的 account_upsert,门槛较高。
建议功能
在「账号 → 添加账号」面板(或右上角菜单)中增加 「从 JSON 导入账号…」:
- 支持单文件 / 多文件 / 目录批量导入:
- 兼容单账号 JSON(含
email+token: { refresh_token, access_token, ... }结构,如 Antigravity Tools 导出的accounts/<uuid>.json); - 兼容 JSON 数组格式(一次导入多个账号)。
- 兼容单账号 JSON(含
- 安全校验与去重:
- 复用现有的
upsertAccount()逻辑,按email/id自动去重更新; - 导入前校验必要字段(
email、refresh_token),并在界面提示成功/跳过的账号数量。
- 复用现有的
- 可选加分项 — 配套「导出账号备份(JSON)」:
- 方便用户换机或重装系统时快速备份与恢复账号列表(导出时可提示用户文件包含登录凭据,注意妥善保管)。
- Dominant language
- JavaScript
- Stars
- 21
- Forks
- 0
- Avg merge
- 30m
- Merged PRs (30d)
- 9
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Enzoo404/gravitybox
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Enzoo404/gravitybox#21 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 60/100
Enzoo404/gravitybox#18 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 40/100
Enzoo404/gravitybox#19 ·
Maintainers usually reply within 1 day
-
[FEAT] 搞个Windows版本Openenhancement help wanted
Difficulty 5/5 Over a week Newbie friendliness 8/100
Enzoo404/gravitybox#17 · 1 comment ·
Maintainers usually reply within 1 day
All issues in Enzoo404/gravitybox
Similar issues
-
bug pydanty:is-working
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
pydantic/pydantic-ai#13939 ·
Maintainers usually reply within 1 day
-
self-host
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
funmusicplace/mirlo#2625 ·
Maintainers usually reply within 1 day
-
Bug Tests
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
JSPrismarine/JSPrismarine#3271 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 Half a day Newbie friendliness 85/100
sindresorhus/eslint-plugin-unicorn#4034 ·
Maintainers usually reply within 1 day
-
Content:WebExt needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day