Skip to main content

systemprompt_cli/
environment.rs

1//! Detection of the CLI's execution environment (TTY, CI, subprocess).
2//!
3//! Copyright (c) systemprompt.io — Business Source License 1.1.
4//! See <https://systemprompt.io> for licensing details.
5
6use crate::env_overrides::EnvOverrides;
7
8#[derive(Debug, Clone, Copy)]
9pub struct ExecutionEnvironment {
10    pub is_fly: bool,
11    pub is_remote_cli: bool,
12}
13
14impl ExecutionEnvironment {
15    #[must_use]
16    pub const fn from_env(env: &EnvOverrides) -> Self {
17        Self {
18            is_fly: env.is_fly,
19            is_remote_cli: env.is_remote_cli,
20        }
21    }
22}