diff --git a/scripts/atproto-app-passwords.nu b/scripts/atproto-app-passwords.nu new file mode 100755 index 0000000..2c96666 --- /dev/null +++ b/scripts/atproto-app-passwords.nu @@ -0,0 +1,29 @@ +#!/usr/bin/env nu +# SPDX-License-Identifier: AGPL-3.0-only +# Copyright (c) 2026 MatrixFurry + +def main [ + --pds-host: string = "https://tngl.sh" + handle: string + name: string +] { + let xrpc = $pds_host + "/xrpc/" + let password = input -s "Password: " + + let session = http post --content-type application/json ($xrpc + "com.atproto.server.createSession") { + identifier: $handle + password: $password + } + + let app_password = http post --content-type application/json -H { + Authorization: $"Bearer ($session.accessJwt)" + } ($xrpc + "com.atproto.server.createAppPassword") { + name: $name + } + + print ("New app password created: " + $app_password.password) + + http post --allow-errors --content-type application/json -H { + Authorization: $"Bearer ($session.refreshJwt)" + } ($xrpc + "com.atproto.server.deleteSession") {} +}