AgentKit
Tài liệuBộ kitTham chiếu CLIỨng dụng Desktop

secrets

ak secrets delete

Xóa giá trị bí mật được chỉ định.

Xóa giá trị bí mật được chỉ định.

Kiểm tra kỹ <ref> trước khi chạy. Lệnh xóa value và index entry, không idempotent và không thể hoàn tác.

Dùng ak secrets delete với đối số và tùy chọn dưới đây. Phần help nguyên bản giữ nguyên thuật ngữ, cú pháp, tác động và điều kiện thực thi của CLI để đối chiếu chính xác.

Khi bật đồng bộ vault, lần ghi cục bộ thành công sẽ khởi động push nền cho vault dùng backend hệ điều hành. Lệnh trả kết quả ngay. Dùng --no-push cho lần ghi này hoặc đặt AGENTKIT_SECRETS_AUTO_PUSH=0 để tắt push nền. Backend file đồng bộ khi bạn chạy ak secrets sync now.

Contract và help của lệnh

Delete a stored secret

Synopsis

Permanently delete <ref>'s value from the active backend and remove its entry from the index. Deleting a ref that does not exist is an error, not a no-op — delete is not idempotent, so scripts can detect a stale/duplicate delete. Use it when a credential is rotated out of use, revoked, or no longer needed.

Effects: Removes the value from the active backend and the ref's entry from ~/.agentkit/secrets/index.json. Irreversible. With sync on, it then starts a background ak secrets sync now that pushes the change without waiting for it; --no-push or AGENTKIT_SECRETS_AUTO_PUSH=0 turns that off, and the file backend is never pushed in the background.

Exit status: 0 success 2 invalid flags or arguments 3 ref has no stored value 5 backend or index failure

ak secrets delete <ref> [flags]

Examples

  ak secrets delete ${REF}
  ak secrets delete ${REF} --json  # machine-readable confirmation

Options

      --backend string                Storage backend: keychain (default), file (age-encrypted vault), or memory (dev/test; values and its index are throwaway)
  -h, --help                          help for delete
      --json                          Emit machine-readable JSON (implies --no-interactive)
      --no-interactive                Disable interactive prompts (CI-safe)
      --no-push ak secrets sync now   Do not push this change to the sync vault in the background (it syncs at the next ak secrets sync now)
  -q, --quiet                         Suppress non-error output on stderr
      --unlock-with-recovery          Open the file backend's vault with a recovery private key and set a new passphrase
  -V, --verbose                       Extra diagnostic output on stderr (loses to --quiet)
  -y, --yes                           Assume yes for all prompts

SEE ALSO

  • ak secrets - Manage named secret values (API keys, tokens)