pub fn snoop_server(
    dir: PathBuf,
    opts: &SnoopServeOpts,
    tools: &Tools,
    global_opts: &Opts,
) -> Result<i32, ExecutionError> {
    run_cmd_directly(
        format!(
            "{} run {}",
            tools.cargo_engine, global_opts.cargo_engine_args
        ),
        &dir,
        vec![
            ("PERSEUS_ENGINE_OPERATION", "serve"),
            ("CARGO_TARGET_DIR", "dist/target_engine"),
            ("PERSEUS_HOST", &opts.host),
            ("PERSEUS_PORT", &opts.port.to_string()),
            ("RUSTFLAGS", "--cfg=engine"),
        ], /* Unlike the `serve` command, we're both
            * building and running here, so we provide
            * the operation */
    )
}
Runs the commands to run the server directly so the user can see detailed
logs.
packages/perseus-cli/src/snoop.rs