Skip to content

Instantly share code, notes, and snippets.

@dir
Last active March 7, 2025 22:06
Show Gist options
  • Select an option

  • Save dir/3de3c9fcd81f95b4b0ab40d57074c106 to your computer and use it in GitHub Desktop.

Select an option

Save dir/3de3c9fcd81f95b4b0ab40d57074c106 to your computer and use it in GitHub Desktop.
Bash script to remove Figma Agent login item & FigmaAgent.app(s) from your Mac
#!/usr/bin/env bash
#
# figma-agent-remove
# Removes Figma Agent from launchctl & deletes Figma Agent apps
# - This script may require sudo privileges.
# - You will likely have to re-run this script after every Figma update.
# - You will need to restart your system for changes to take effect.
# - After restarting, you may have to manually remove FigmaAgent from Login Items one last time.
FIGMA_AGENT_LAUNCHCTL_IDENTIFIER="application.com.figma.agent"
FIGMA_AGENT_APP_PATHS=(
"$HOME/Library/Application Support/Figma/FigmaAgent.app"
"/Applications/Figma.app/Contents/Library/FigmaAgent.app"
)
remove_from_launchctl() {
figma_agents=$(launchctl list | grep "$FIGMA_AGENT_LAUNCHCTL_IDENTIFIER")
if [ -z "$figma_agents" ]; then
echo "No Figma Agent found in launchctl."
else
echo "Found Figma Agent in launchctl:"
echo "$figma_agents"
echo ""
echo "Unloading Figma Agent(s) from launchctl..."
while IFS= read -r line; do
service_name=$(echo "$line" | awk '{print $3}')
if [ -n "$service_name" ]; then
echo "- $service_name"
launchctl unload -w "/Library/LaunchAgents/$service_name.plist" 2>/dev/null ||
launchctl unload -w "$HOME/Library/LaunchAgents/$service_name.plist" 2>/dev/null ||
launchctl unload -w "/Library/LaunchDaemons/$service_name.plist" 2>/dev/null ||
echo "Could not find plist file for $service_name"
fi
done <<<"$figma_agents"
fi
}
delete_apps() {
found_agents=false
found_paths=""
for path in "${FIGMA_AGENT_APP_PATHS[@]}"; do
if [ -d "$path" ]; then
found_agents=true
found_paths+="$path\n"
fi
done
if [ "$found_agents" = false ]; then
echo "No FigmaAgent.app(s) found on system, skipping..."
else
echo "Found Figma Agent app in:"
echo -e "$found_paths"
echo "Deleting Figma Agent app(s)..."
for path in "${FIGMA_AGENT_APP_PATHS[@]}"; do
if [ -d "$path" ]; then
echo "- $path"
if rm -rf "$path"; then
echo " Successfully deleted"
else
echo " Failed to delete (you may need sudo privileges)"
fi
fi
done
echo ""
fi
}
main() {
remove_from_launchctl
echo ""
delete_apps
echo ""
echo "Figma Agent has been removed from your system, you may need to re-run this script after each Figma update."
echo ""
echo "Final Steps:"
echo "1. Restart your system."
echo "2. Remove FigmaAgent from Settings > Login Items (if you see it after restarting)"
echo ""
}
main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment