How on earth do you generate a Fly.io auth token with current flyctl???

Hello —

I’m trying to generate a Fly.io auth token so my GitHub actions to deploy to Fly.io won’t fail. However, the only instructions I could find, on your YouTube channles and elsewhere, were the instructions for the old way, $ flyctl auth token, which does not work any more with the current flyctl, as it returns — The 'fly auth token' command is deprecated. Use 'fly tokens create' instead.

So I went to the instructinos here in the Fly.io docs for fly tokens create (fly tokens · Fly Docs) and found this —

What in the heck is that string I’m supposed to put in the option --access-token string??? there is nothing in the instuctions in the Fly.io docs that says what that string is supposed to be and how to look it up. Is it supposed to be GitHub or whatever service I’m using to deploy with a FLY_API_TOKEN? Something else? This is extremely unclear.

I also went to look up creating the token for a GitHub Actions Deployment (Staging environments with GitHub actions · Fly Docs). That had —

What ORG name is supposed to go there? There is no detail in the instructions saying what that is. Is it, again, GitHub? Is it my own company/org? Could I just make up and ORG name and use that?

All this is extremely unclear to me and I really want to deploy my latest App build to Fly.io via GitHub actions. Please let me know where there are instructions for this or how I find out what string is for $ fly tokens create --access-token string or what the ORG is supposed to be. Any help here, please, would be appreciated.

best,

faddah

fly tokens create org and then follow the CLI wizards

Hello @khuezy,

Thank you for that reply and help. But I’m still left wondering, why doesn’t it say that in Fly.io docs instead of fly tokens create --access-token string? Why don’t they update the docs to say that? Also, for that GitHub Deploy, that still doesn’t explain what the <ORG> is supposed to be? And it’s not in the Fly.io Documentation instuctions either.

I’m saying I’m finding these Docs for Fly.io hard to follow and incomplete. And all the Fly.io videos on YouTube are out-of-date as they still tell you to use $ flyctl auth token.

But I do appreciate the help.

best,

faddah

If you have multiple orgs, you do fly tokens create org MY-ORG.
--access-token is a flag for you to pass credentials into the fly command to elevate permissions.

The documentation sucks and can be improved.

“Global Options” (in any CLI that I know of) are options that can be supplied for any command – so the --access-token is where you can supply an already existing Fly token authorizing the user to take whatever action is being attempted with flyctl. If you are already able to use flyctl without passing an auth token, you don’t need to specify it. The flag is not specific to fly tokens create and is optional, just like the options --debug and --verbose right next to it.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.