feat(cli): add init-master-key / export-credentials / import-credentials commands

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-05-11 10:51:28 +08:00
parent 5f8c93dee9
commit 07adc98e8c
2 changed files with 315 additions and 0 deletions

View File

@@ -13,6 +13,11 @@ Machine commands output single-line JSON where appropriate.
"""
import sys
from service.account_crypto_commands import (
cmd_account_export_credentials,
cmd_account_import_credentials,
cmd_account_init_master_key,
)
from service.account_service import (
cmd_account_add_secret,
cmd_account_add_web,
@@ -211,6 +216,12 @@ def main() -> None:
print("ERROR:CLI_BAD_ARGS account open 需要 <id>。")
sys.exit(1)
cmd_open(av[3])
elif sub == "init-master-key":
cmd_account_init_master_key(av)
elif sub == "export-credentials":
cmd_account_export_credentials(av)
elif sub == "import-credentials":
cmd_account_import_credentials(av)
else:
print("ERROR:CLI_BAD_ARGS 未知的 account 子命令。")
print(_USAGE)