Skip to content

Instantly share code, notes, and snippets.

@Chipusy
Forked from maxtaco/bot-signup-flow.md
Created April 17, 2020 12:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Chipusy/19c9ecd0287bd69b2c991e4cd32452ef to your computer and use it in GitHub Desktop.
Save Chipusy/19c9ecd0287bd69b2c991e4cd32452ef to your computer and use it in GitHub Desktop.
New bot signup flow

Get a Bot Token

As your keybase user run:

$ keybase bot token create > /tmp/bot-token

You'll get back a base64 token, like: 6C37sjCBgMNf06Z6oTgixIxHJpja8G-Qp. This is your bot token that allows you to sign up bots.

Signup the Bot

You can signup for your bot in a new "bot home dir" using your bot token, and by specifying the username of the bot. Here we use standalone mode which means the service and the client run in the same process, and then both exit at the same time. It won't actually write any credentials to that directory, but we give it a non-standard home directory in this example so we don't pick up your real user.

$ keybase --standalone --home=/tmp/bot bot signup -u bot_Ej338s01384 -t $(cat /tmp/bot-token) > paper-key

This will output a paper key to standard output. Note this bot has one keypair that's a paper key, and no standard device keys.

Startup the Bot

Next, start the service, logged in as the bot on startup:

$ keybase --home=/tmp/bot service --oneshot-username bot_Ej338s01384 < paper-key

Caveats

Only 5 bot signups per user are currently allowed, but we can consider relaxing that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment