Example of using fx for a short-lived CLI process?
Author: cweagansCreated Jul 4, 2021Updated Jun 18, 2026
All of the information/examples that I can find about how to use Fx in the "correct" way are centered around long-lived processes (HTTP servers and the like). I really like how my application is structured with Fx, but I'm not quite sure how to use it for e.g. a CLI application that should be running for < 1 second.
For instance, is there any way to silence the log output entirely? Is there a way to default to not a long-running process?
Source: uber-go/fx