retrojet <command> [flags]
  

Run retrojet --help or retrojet <command> --help for the same information in your terminal.

retrojet login

Signs the CLI in to your Retrojet account through the browser.

  retrojet login
retrojet login --no-browser   # only print the URL, open it yourself
  
FlagMeaning
--no-browserDo not open a browser. Useful over SSH or on a machine without a desktop.

What happens:

  1. The CLI starts a small server on 127.0.0.1 and opens the console at https://retrojetdev.cloud/cli/login. The URL is also printed, in case the browser does not open.
  2. You sign in if needed, then click Allow. Cancel stops the login.
  3. The browser hands a one-time code back to the CLI, which exchanges it for an access token directly with Retrojet.

The access token never passes through the browser. The login uses PKCE (RFC 7636), so a code that leaks from the browser history is useless on its own. It expires after 5 minutes and works only once.

If the browser does not come back within 5 minutes, the CLI stops with gave up waiting for the browser login. Run retrojet login again.

Where the token is stored

OSFile
macOS~/Library/Application Support/retrojet/credentials.json
Linux~/.config/retrojet/credentials.json, or $XDG_CONFIG_HOME/retrojet/ when set
Windows%AppData%\retrojet\credentials.json

On macOS and Linux the file is readable only by you (0600). The token is valid for 30 days. Changing your password signs out every session, including the CLI.

retrojet whoami

Shows which account the CLI is signed in to.

  retrojet whoami
  
  Logged in to Retrojet as Budi <budi@acme.com>
  
MessageFix
not logged in to Retrojet, run ... firstRun retrojet login.
your login to Retrojet has expired, run ... againThe 30 days are over. Run retrojet login.
your login to Retrojet is no longer valid ...The token was rejected, for example after a password change. Run retrojet login.

retrojet logout

Deletes the token from this computer. It does not call Retrojet.

  retrojet logout
  

retrojet init

Connects the Flutter project in the current folder to an app in Retrojet and writes retrojet.yaml. Run it in the folder that contains pubspec.yaml.

  retrojet init
  

Steps:

  1. Checks that pubspec.yaml exists and that there is no retrojet.yaml yet. To run init again, delete retrojet.yaml first.

  2. Reads the package ID of each platform folder that exists:

    PlatformFileValue
    Androidandroid/app/build.gradle.kts or build.gradleapplicationId
    iOSios/Runner.xcodeproj/project.pbxprojPRODUCT_BUNDLE_IDENTIFIER
    macOSmacos/Runner/Configs/AppInfo.xcconfigPRODUCT_BUNDLE_IDENTIFIER
    Linuxlinux/CMakeLists.txtAPPLICATION_ID
    Windowsnoneskipped, Flutter Windows apps have no package ID
  3. Looks for an app with exactly that package ID in your organizations:

    • Found in one organization: uses it.
    • Found in several: asks you to pick one.
    • Not found: creates it in an organization where you are Owner or Admin, and asks which one if there are several.
  4. Writes retrojet.yaml with the app_id. Commit this file.

Package ID must match

The package ID has to be exactly the same on every platform. Otherwise init stops and lists what it found:

  Error: the package ID must be exactly the same on every platform:

  android  com.acme.demo_app  android/app/build.gradle.kts
  ios      com.acme.demoApp   ios/Runner.xcodeproj/project.pbxproj

Make them identical, then run `retrojet init` again.
  

This happens with most new projects: flutter create --project-name demo_app uses com.acme.demo_app on Android and Linux but com.acme.demoApp on iOS and macOS, because Apple bundle IDs cannot contain _. Pick one ID with only letters, digits, and dots, such as com.acme.demoapp, and use it everywhere.

An app that is already published in the stores with different IDs per platform cannot change them, so it cannot use retrojet init yet.

Not supported yet

  • Android flavors with more than one applicationId. (applicationIdSuffix, such as .debug, is ignored.)
  • Bundle IDs set from build variables, such as $(APP_ID) in Xcode.
  • Xcode configurations with different bundle IDs. Test targets and extensions, such as com.acme.demo.RunnerTests, are ignored.

Errors

MessageFix
this project is already set up: retrojet.yaml has app_id ...Nothing to do. Delete retrojet.yaml only if you really want to connect a different app.
no android, ios, macos or linux folder foundRun init in the root of a Flutter project.
no app with package ID ... exists, and you are not an Owner or Admin of any organization ...Ask an Admin to create the app in the console, then run init again.
Upgrade your plan to add more appsThe Free plan allows one app. Use the existing app or upgrade.

retrojet release and retrojet patch

  retrojet release android
retrojet patch android
  

Environment variables

VariableEffect
NO_COLORTurns off colored output. Color is also off when output goes to a file or another program.