566 B · text History bbb2a48
#!/bin/sh
# Create a personal API token for an existing user and print it, once.
#   bin/token sam@example.com "sentry-cli" project:releases,org:read
# The token goes to stdout, what it is to stderr. Only its hash is kept, so
# copy it now. In each organization it is still narrowed to the user's role.
set -eu

[ $# -eq 3 ] && [ -n "$1" ] && [ -n "$2" ] && [ -n "$3" ] ||
  { echo "usage: $0 EMAIL LABEL SCOPE[,SCOPE...]" >&2; exit 2; }
export TOKEN_EMAIL="$1" TOKEN_LABEL="$2" TOKEN_SCOPES="$3"

cd -P -- "$(dirname -- "$0")"
exec ./vigil eval Vigil.Release.token