Kiro Local Account Importer
Use this skill to import Kiro accounts without involving the StaticFlow backend.
The workflow runs locally, reads SQLite files directly, and calls the mapped
llm-access admin API such as http://127.0.0.1:19182.
Boundaries
- Do not change backend code for this workflow.
- Do not ask remote/cloud
llm-accessto read local SQLite paths. - Parse local SQLite locally, then call
llm-accessadmin APIs. - Do not print raw
access_token,refresh_token, orclient_secret. - Dry-run first unless the user explicitly wants a real import.
API Flow
Use scripts/import_kiro_accounts.py.
The script:
- Discovers SQLite files from
--sqlite-file,--search-dir, or the default~/.local/share/kiro-cli/data.sqlite3. - Reads supported Kiro auth records from
auth_kv:- social:
kirocli:social:token - IDC/OIDC:
kirocli:odic:token,kirocli:oidc:token - device registration: matching
device-registrationkeys
- social:
- Creates the Kiro account through:
POST /admin/kiro-gateway/accounts/import-auth - Sets standard scheduling:
kiro_channel_max_concurrency = 3kiro_channel_min_start_interval_ms = random[200, 1000]minimum_remaining_credits_before_block >= 10
- Assigns proxy by patching:
PATCH /admin/kiro-gateway/accounts/{name} - Validates the account by refreshing balance through the selected proxy:
POST /admin/kiro-gateway/accounts/{name}/balance - Accepts the import only when balance refresh succeeds, remaining credits are
at least
10, and the refreshed upstreamuser_idis not already present on an existing Kiro account. If refresh fails, try the next United States proxy. If all proxies fail, if the account's remaining credits are below10, or if the refresheduser_idis a duplicate, delete the newly imported account and report it as invalid.
Proxy Policy
Default proxy behavior:
- Fetch active proxies from
GET /admin/llm-gateway/proxy-configs. - Keep only active United States proxy nodes. With the current proxy schema,
this is inferred from established proxy names such as
do-us-*,aws_us*,us-home*,my-homeus*, anddmit-us. - Count active Kiro accounts currently fixed to each proxy via
GET /admin/kiro-gateway/accounts?limit=10000&offset=0. - Try to read hot Kiro latency ranking from
/internal/kiro-gateway/latency-ranking?source=hot&window=1h. - Prefer the least-used active United States proxy first.
- Use hot first-token latency only as a tie-breaker within the same account count bucket, then break remaining ties by proxy name.
- If latency data is unavailable, choose the least-used active proxy and break ties by proxy name.
- Direct/no-proxy imports are not allowed for Kiro accounts.
Commands
Default dry run:
python3 skills/kiro-local-account-importer/scripts/import_kiro_accounts.py \
--admin-base-url http://127.0.0.1:19182
Dry run for one explicit SQLite:
python3 skills/kiro-local-account-importer/scripts/import_kiro_accounts.py \
--admin-base-url http://127.0.0.1:19182 \
--sqlite-file /path/to/data.sqlite3 \
--account-name kiro-main
Dry run for a directory:
python3 skills/kiro-local-account-importer/scripts/import_kiro_accounts.py \
--admin-base-url http://127.0.0.1:19182 \
--search-dir /path/to/kiro-auth-dbs \
--name-prefix kiro-
Apply after reviewing dry-run output:
python3 skills/kiro-local-account-importer/scripts/import_kiro_accounts.py \
--admin-base-url http://127.0.0.1:19182 \
--search-dir /path/to/kiro-auth-dbs \
--name-prefix kiro- \
--apply
If the mapped admin API requires a token, add:
--admin-token "$STATICFLOW_ADMIN_TOKEN"
Verification
After real import, verify:
curl -fsS http://127.0.0.1:19182/admin/kiro-gateway/accounts?limit=20 \
| jq '.accounts[] | {name, kiro_channel_max_concurrency, kiro_channel_min_start_interval_ms, proxy_mode, proxy_config_id}'
Expected:
- imported accounts exist;
- max concurrency is
3; - min start interval is between
200and1000; - minimum remaining credits is at least
10; - proxy mode is
fixed; - proxy name is a United States node.
- the real import output has
validated: trueand includes the refreshed balance response. - no imported account duplicates an existing refreshed Kiro
user_id.