1pub mod analyzer;
31pub mod cli;
32pub mod common;
33pub mod config;
34pub mod error;
35pub mod generator;
36pub mod handlers;
37
38pub use analyzer::{analyze_project, ProjectAnalysis};
40pub use error::{IaCGeneratorError, Result};
41pub use generator::{generate_dockerfile, generate_compose, generate_terraform};
42pub use handlers::*;
43use cli::Commands;
44
45pub const VERSION: &str = env!("CARGO_PKG_VERSION");
47
48pub async fn run_command(command: Commands) -> Result<()> {
49 match command {
50 Commands::Analyze { path, json, detailed, display, only } => {
51 handlers::handle_analyze(path, json, detailed, display, only)
52 }
53 Commands::Generate {
54 path,
55 output,
56 dockerfile,
57 compose,
58 terraform,
59 all,
60 dry_run,
61 force
62 } => {
63 handlers::handle_generate(path, output, dockerfile, compose, terraform, all, dry_run, force)
64 }
65 Commands::Validate { path, types, fix } => {
66 handlers::handle_validate(path, types, fix)
67 }
68 Commands::Support { languages, frameworks, detailed } => {
69 handlers::handle_support(languages, frameworks, detailed)
70 }
71 Commands::Dependencies { path, licenses, vulnerabilities, prod_only, dev_only, format } => {
72 handlers::handle_dependencies(path, licenses, vulnerabilities, prod_only, dev_only, format).await
73 }
74 Commands::Vulnerabilities { path, severity, format, output } => {
75 handlers::handle_vulnerabilities(path, severity, format, output).await
76 }
77 Commands::Security {
78 path,
79 mode,
80 include_low,
81 no_secrets,
82 no_code_patterns,
83 no_infrastructure,
84 no_compliance,
85 frameworks,
86 format,
87 output,
88 fail_on_findings
89 } => {
90 handlers::handle_security(
91 path,
92 mode,
93 include_low,
94 no_secrets,
95 no_code_patterns,
96 no_infrastructure,
97 no_compliance,
98 frameworks,
99 format,
100 output,
101 fail_on_findings
102 )
103 }
104 Commands::Tools { command } => {
105 handlers::handle_tools(command).await
106 }
107 }
108}