pub const MESSAGE_ONLY: bool = false;
pub const NO_DIFF_STATS: bool = false;
pub const SHOW_RAW_DIFF: bool = false;
pub const CONTEXT_LINES: u32 = 20; pub const MAX_LINES_PER_FILE: usize = 2000; pub const MAX_LINE_WIDTH: usize = 500; pub const MAX_FILE_LINES: usize = 5000;
pub const CMTIGNORE_FILENAME: &str = ".cmtignore";
pub const DEFAULT_PROVIDER: &str = "gemini";
pub const INCLUDE_RECENT_COMMITS: bool = true;
pub const RECENT_COMMITS_COUNT: usize = 10;
pub const DEFAULT_CONFIG_FILENAME: &str = ".cmt.toml";
pub const GLOBAL_CONFIG_DIRNAME: &str = ".config/cmt";
pub const GLOBAL_CONFIG_FILENAME: &str = "config.toml";
pub const DEFAULT_TEMPLATE: &str = "conventional";
pub const AVAILABLE_PROVIDERS: &[&str] = &["claude", "openai", "gemini"];
pub const DEFAULT_CLAUDE_MODEL: &str = "claude-sonnet-4-5-20250929";
pub const DEFAULT_OPENAI_MODEL: &str = "gpt-5.2";
pub const DEFAULT_GEMINI_MODEL: &str = "gemini-3-flash-preview";
pub const AVAILABLE_TEMPLATES: &[&str] = &["conventional", "simple", "detailed"];
pub fn example_config() -> String {
format!(
r#"# cmt configuration file
# General options
message_only = {}
no_diff_stats = {}
show_raw_diff = {}
context_lines = {}
max_lines_per_file = {}
max_line_width = {}
max_file_lines = {}
# AI provider options
provider = "{}" # Options: {}
# model = "{}" # Uncomment to set a specific model
# temperature = 0.3 # Uncomment to set a specific temperature
# Git options
include_recent_commits = {}
recent_commits_count = {}
# Template options
# template = "{}" # Uncomment to use a specific template
# You can add a default hint that will be used for all commits
# hint = "Focus on the technical details"
"#,
MESSAGE_ONLY,
NO_DIFF_STATS,
SHOW_RAW_DIFF,
CONTEXT_LINES,
MAX_LINES_PER_FILE,
MAX_LINE_WIDTH,
MAX_FILE_LINES,
DEFAULT_PROVIDER,
AVAILABLE_PROVIDERS.join(", "),
DEFAULT_CLAUDE_MODEL,
INCLUDE_RECENT_COMMITS,
RECENT_COMMITS_COUNT,
DEFAULT_TEMPLATE,
)
}
pub fn simple_template() -> String {
r#"{{{subject}}}
{{{details}}}"#
.to_string()
}
pub fn conventional_template() -> String {
r#"{{type}}{{#if scope}}({{{scope}}}){{/if}}: {{{subject}}}
{{#if details}}
{{{details}}}
{{/if}}"#
.to_string()
}
pub fn detailed_template() -> String {
r#"{{type}}{{#if scope}}({{{scope}}}){{/if}}: {{{subject}}}
{{#if details}}
{{{details}}}
{{/if}}
{{#if issues}}
Fixes: {{{issues}}}
{{/if}}
{{#if breaking}}
BREAKING CHANGE: {{{breaking}}}
{{/if}}"#
.to_string()
}