Does 'railway run' execute remotely or locally?

I dont think I totally understand how CLI works. When i do "railway run script_name.rb" is it running script_name deployed on the service or is it running my local script_name.rb but with ENV variables of the service? I previously though it was the first, I know think its the latter.
Solution:
it's running locally with your railway environment variables
Jump to solution
4 Replies
Percy
Percy8mo ago
Project ID: N/A
dwaynemac
dwaynemac8mo ago
N/A
Solution
ThallesComH
ThallesComH8mo ago
it's running locally with your railway environment variables
sagat
sagat8mo ago
Yes, it pulls all the env variables of the railway env. Example you have a strapi instance with env vars for postgres connection. You want to develop locally, it will pull the postgres vars and inject them locally.