How can you uninstall an app from the CLI if you can't find the app code available locally? #CaterinaHacksCorner

Earlier today I was trying to clean up my demo environment and was struggling in finding the folder for one of my apps.
I wanted to clean up the environment using the Forge CLI forge uninstall command instead of uninstalling the app from the UI.

However, as you can probably and correctly guess, I have a lot of copies of the same repository/app available in my local filesystem and I couldn’t figure out which one was the right one.
All my attempts to find the right app by using the forge install --list where not helping in finding the right folder so after almost 30 minutes of me trying, I decided that I needed to find another way.

How to uninstall an app from the Forge CLI if you can’t find it in your filesystem?
Here is what I did:

  • Browse to the Developer console and search for the app
  • open each app and check the Installations tab
  • once the one installed in the workspace, grab the App ID from either the URL or the overview tab (this is e3539f94-92c3-4f8a-b8d5-7ff3d3edcaec in the screenshot above)
  • in a terminal, browse to any Forge app you have available locally → open the manifest.yml → replace the UUID part in the app/id definition with the UUID of the app → save the file
  • run the forge uninstall command and the app is uninstalled
  • don’t forget to change the App ID in the manifest.yml back to its original value

Problem solved. Next time I will not try to find the right app locally, I will just temporarily change the app id of one of the apps I have.

Have a nice weekend,
Caterina

7 Likes

Could Forge CLI be improved to take an app ID as an optional argument for uninstall command? It could save the developers a ton of troubles like this.