faucet-cli 1.2.0

Config-driven CLI runner for faucet-stream pipelines (YAML / JSON, Meltano-style)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! `faucet serve` — thin command layer: parse args into a `ServeConfig`, load
//! the startup `.env`, and hand off to `serve::run_server`.

use crate::cli::ServeArgs;
use crate::error::CliResult;
use crate::serve::ServeConfig;

pub async fn run(args: ServeArgs, log_level: String) -> CliResult<()> {
    let cwd = std::env::current_dir()?;
    let env_path =
        crate::env_loader::resolve_env_file(args.env_file.as_deref(), args.no_env_file, &cwd)?;
    crate::env_loader::load_env_file_if_present(env_path.as_deref())?;
    let mut config = ServeConfig::from_args(args)?;
    config.log_level = log_level;
    crate::serve::run_server(config).await
}