Can't import filter expression from file?

mitmproxy can add filter expression from console.

  -f FILTER, --filter FILTER
                    Filter view expression.

But I want to add filter expression from file like described below.
Because I want to switch filter expression per project.

mitmproxy --filter-file ./filter.conf

Is there any solution for this?

You can set any of the mitmproxy command-line options from the mitmproxy configuration file. I’d recommend doing that, and starting each project with an explicit path to the config (–conf). See here for more:

http://docs.mitmproxy.org/en/stable/config.html