ai_env 0.1.1

Detect AI coding agent information from the environment.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use crate::api::{opt_var, self_id, AiAgent, AiEnvironment};

// Google Gemini CLI — sets GEMINI_CLI=1 in shell commands it runs
// https://google-gemini.github.io/gemini-cli/docs/tools/shell.html
pub fn create_environment() -> AiEnvironment {
    AiEnvironment {
        agent: AiAgent::Gemini,
        env_prefix: Some("GEMINI_".into()),
        id: self_id(),
        sandboxed: false,
        session_id: opt_var("GEMINI_SESSION_ID"),
    }
}