The flyctl command is your route to harnessing the immense power of the global Fly network… well, it’s a pretty cool command. There are plenty of features in it that not everyone knows. With that in mind, here are some tips for some higher Flying:
The command… It started off as
flyctlbut we kept being asked when would the command becomefly. “Why not both?” we said and now, on most platforms, you can useflyctlorflyinterchangeably. Boom! Three keystrokes saved!The current app… You already know that Fly looks for a
fly.tomlfile in the current directory to work out what the app you are working with is called. But for many commands you can also add-a appnameto your Fly command and it’ll use that appname instead. If there’s afly.tomlin your current directory, it will ask if you are sure that’s the name you want to use to be on the safe side. So now you don’t have to change directory to, say, get a status onmygreatapp99- just dofly status -a mygreatapp99.Building from outside the directory… The
fly deploycommand can work with that. Say you want to build the app in a child directory “mygreatchildapp”. Then just point the deploy at it.fly deploy ./mygreatchildappand Fly will find thefly.tomlin there and get to deploying.Deploy different… What should you do if you have a Fly app that you want to deploy a couple of different ways. If, for each way, you’ve built a
fly.tomlfile how do you pull that all of them together under one directory? Rename thefly.tomlfiles to something meaningful for your apptest.toml,preview.toml,production.tomland then leverage the-caka--configflag onfly deploy. That gets you the ability to runfly deploy -c preview.tomland away it goes deploying with that config. Oh, and you can combine that with the previous item on this list and then build out of your mono repo tree without changing directory.Easy opening… Are you working out what your application’s “.fly.dev” host name is? Save time with the
fly opencommand that works out the app’s URL for you and opens your browser on that page.Get Metrics… Some things look better rendered in your browser, like metrics. Now you may know the
fly dashcommand which opens up your Fly web dashboard in your browser. Well, you can go one better withfly dash metricswhich takes you straight to the dashboard metrics page for some graphical delight and a lot of information.Go Docs… If you want to look something up in the docs and you are at the command line, try
fly docswhich opens your browser straight into the documentation’s top page.