Global config for --max-depth 1 with rclone ls

I get a lot of users trying to make use of rclone that don't find the --max-depth 1 option on their own.

IIUC the recursion behavior or ls and lsf is different (unintuitively) and this seems to be well acknowledged:

I am wondering if it might be possible to make the "recursion" i.e. --max-depth -1 option overridable with a global config option so interactive users don't have to ctrl-c when the forget to spell it out explicitly on the command line when they're browsing around their namespace?

I think if there WAS a way to set-and-forget the behavior you want, it might be easier to imagine a path towards one day changing the default of rclone ls (which is supposed to be an interactive/human-readable command)

i.e.

Warning: assumed --max-depth -1 for backwards compatibility because recursion: false not explicitly set in config, if you want --max-depth 1 set recursion: true - the default recursion behavior or rclone ls will change to match lsd and lsf in a future release.

welcome to the forum,

cannot use global flags in the config file, has been discussed in the forum and at github.

set a persistent environment variable
RCLONE_MAX_DEPTH=1

1 Like