CLI reference
Every retrojet command, what it prints, and what to do when it fails.
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
| Flag | Meaning |
|---|---|
--no-browser | Do not open a browser. Useful over SSH or on a machine without a desktop. |
What happens:
- The CLI starts a small server on
127.0.0.1and opens the console athttps://retrojetdev.cloud/cli/login. The URL is also printed, in case the browser does not open. - You sign in if needed, then click Allow. Cancel stops the login.
- 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
| OS | File |
|---|---|
| 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>
| Message | Fix |
|---|---|
not logged in to Retrojet, run ... first | Run retrojet login. |
your login to Retrojet has expired, run ... again | The 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:
Checks that
pubspec.yamlexists and that there is noretrojet.yamlyet. To runinitagain, deleteretrojet.yamlfirst.Reads the package ID of each platform folder that exists:
Platform File Value Android android/app/build.gradle.ktsorbuild.gradleapplicationIdiOS ios/Runner.xcodeproj/project.pbxprojPRODUCT_BUNDLE_IDENTIFIERmacOS macos/Runner/Configs/AppInfo.xcconfigPRODUCT_BUNDLE_IDENTIFIERLinux linux/CMakeLists.txtAPPLICATION_IDWindows none skipped, Flutter Windows apps have no package ID 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.
Writes
retrojet.yamlwith theapp_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
| Message | Fix |
|---|---|
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 found | Run 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 apps | The Free plan allows one app. Use the existing app or upgrade. |
retrojet release and retrojet patch
retrojet release android
retrojet patch android
Environment variables
| Variable | Effect |
|---|---|
NO_COLOR | Turns off colored output. Color is also off when output goes to a file or another program. |