feat: add --config-file CLI flag for YAML config

This commit is contained in:
2026-05-21 10:25:06 -04:00
parent c015dce51e
commit b179135136
+12
View File
@@ -11,6 +11,7 @@ import qualified Options.Applicative as Opts
import System.IO (BufferMode (NoBuffering), hSetBuffering, stderr, stdout)
import qualified Roux
import qualified Roux.Config as Config
-- ---------------------------------------------------------------------------
-- CLI options
@@ -20,6 +21,7 @@ data Options = Options
{ optHost :: String
, optPort :: Int
, optRecipeDir :: FilePath
, optConfigFile :: FilePath
}
optionsParser :: Opts.Parser Options
@@ -49,6 +51,13 @@ optionsParser =
<> Opts.value "recipes"
<> Opts.showDefault
)
<*> Opts.strOption
( Opts.long "config-file"
<> Opts.metavar "FILE"
<> Opts.help "Path to YAML configuration file"
<> Opts.value "roux-config.yaml"
<> Opts.showDefault
)
main :: IO ()
main = do
@@ -71,6 +80,9 @@ main = do
putStrLn $ "[roux] scanning recipes from " <> optRecipeDir opts
putStrLn $ "[roux] listening on " <> optHost opts <> ":" <> show (optPort opts)
putStrLn $ "[roux] config file: " <> optConfigFile opts
-- Load config (file may be missing; LLM features disabled gracefully)
_config <- Config.loadConfig (optConfigFile opts)
waiApp <- Roux.app (optRecipeDir opts)
Warp.runSettings settings waiApp