MCPcopy Create free account
hub / github.com/aws/amazon-q-developer-cli / auto_init

Method auto_init

crates/chat-cli/src/cli/chat/checkpoint.rs:86–100  ·  view source on GitHub ↗

Initialize checkpoint manager automatically (when in a git repo)

(
        os: &Os,
        shadow_path: impl AsRef<Path>,
        current_history: &VecDeque<HistoryEntry>,
    )

Source from the content-addressed store, hash-verified

84impl CheckpointManager {
85 /// Initialize checkpoint manager automatically (when in a git repo)
86 pub async fn auto_init(
87 os: &Os,
88 shadow_path: impl AsRef<Path>,
89 current_history: &VecDeque<HistoryEntry>,
90 ) -> Result<Self> {
91 if !is_git_installed() {
92 bail!("Checkpoints are not available. Git is required but not installed.");
93 }
94 if !is_in_git_repo() {
95 bail!("Checkpoints are not available in this directory. Use '/checkpoint init' to enable checkpoints.");
96 }
97
98 let manager = Self::manual_init(os, shadow_path, current_history).await?;
99 Ok(manager)
100 }
101
102 /// Initialize checkpoint manager manually
103 pub async fn manual_init(

Callers

nothing calls this directly

Calls 2

is_git_installedFunction · 0.85
is_in_git_repoFunction · 0.85

Tested by

no test coverage detected