cli icon indicating copy to clipboard operation
cli copied to clipboard

[FEATURE REQUEST] make `shell` respect local .env files (configurable with flag overrides)

Open alexng353 opened this issue 2 years ago • 2 comments

proposal: allow shell users to override/supplement railway variables with local .env's

features:

  • flags
    • --envfile={path} env file to use, defaults to these, in this order: railway.env, .env.local, .local.env, .env
    • --prefer-remote override namespace collisions with railway variables
    • --prefer-local override namespace collisions with local variables
  • can consume JSON formatted files (single level depth)
  • can consome kv formatted files (default .env styling)

defaults to prefer remote if there are namespace collisions without a prefer specified respecting local .env files is disabled by default

alexng353 avatar Apr 29 '23 01:04 alexng353

What's the motivation behind this? I'm curious about the purpose of this as railway shell is meant for spawning a shell with (remote) Railway variables - is there a use case for wanting local variables inside the shell?

namespace collisions

Can you elaborate on this bit?

half0wl avatar May 23 '23 13:05 half0wl

namespace collisions

Can you elaborate on this bit?

Sorry for the late reply, but I meant handling what happens when both railway and the local .env file have name collisions.

i.e. railway has API_KEY="hi james" and .env.local has API_KEY="hi john" there could be flags that change how the collisions are rectified

alexng353 avatar Jul 10 '23 00:07 alexng353