What commands does `flyctl ssh --command` accept?

I’ve attempted to run bash files, i’ve attempted to run cd and put and many others and nothing seems to work. The docs only state the flags but no examples of usage. Is there any other documentation that exists that could help me learn how to use these commands?

My goal is to automate moving to a directory and uploading some files into it. I’ve tried to inline the commands AND I’ve tried to create a script file. The --command flag does not execute the inline command and it throws a permissions error when I try to run the script file.

You’ll have to do it on every app restart though? I don’t think there’s any notification when an app is restarted. For example, Fly can (and does) move apps from one host to another, or restart it if it’s failing health checks, or restart them often like when you’re using Machines (which are inherently ephemeral). Unless you’re storing state on persistent disks, the app is going to start with a clean state.

I’ve seen folks use flyctl ssh console -C <command> The recommendation is to run shell scripts as <command> rather than exec binutils / coreutils (like cd, grep etc): One-liner to cd and run bundle (rails) - #5 by rubys