git-ai 0.1.27

Git AI: Automates commit messages using ChatGPT. Stage your files, and Git AI generates the messages.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use git2::Repository;
use anyhow::{Context, Result};

#[tokio::main]
async fn main() -> Result<()> {
  env_logger::init();

  let repo = Repository::open_from_env().context("Failed to open repository")?;
  let mut config = repo.config().context("Failed to load config")?;
  config.remove("ai.thread-id").context("Failed to delete thread-id")?;
  config.snapshot().context("Failed to save config")?;
  let mut global_config = config.open_global().context("Failed to open global config")?;
  global_config
    .remove("ai.assistant-id")
    .context("Failed to delete assistant-id")?;
  global_config.snapshot().context("Failed to save global config")?;
  Ok(())
}