Skip to main content

zeph_config/
cli.rs

1// SPDX-FileCopyrightText: 2026 Andrei G <bug-ops>
2// SPDX-License-Identifier: MIT OR Apache-2.0
3
4//! Session-scoped CLI configuration: bare mode, JSON output, and auto-approval flags.
5
6use serde::{Deserialize, Serialize};
7
8/// Session-scoped CLI overrides loaded from the `[cli]` TOML section.
9///
10/// Command-line flags take priority over these values. This section has no
11/// effect on Telegram, Discord, Slack, or ACP sessions.
12#[derive(Debug, Clone, Default, Deserialize, Serialize)]
13#[serde(default)]
14pub struct CliConfig {
15    /// Enable bare mode (skip skills, memory, MCP, scheduler, watchers).
16    pub bare: bool,
17    /// Emit structured JSON events (JSONL) to stdout. Forces logs to stderr.
18    pub json: bool,
19    /// Auto-approve trust-gate prompts (`-y` / `--auto`).
20    pub auto: bool,
21    /// Loop command configuration.
22    #[serde(rename = "loop")]
23    pub loop_: LoopConfig,
24    /// Tool allowlist for CLI/TUI sessions. `None` means all tools are permitted.
25    #[serde(default)]
26    pub allowed_tools: Option<Vec<String>>,
27}
28
29/// Configuration for the `/loop` command.
30#[derive(Debug, Clone, Deserialize, Serialize)]
31#[serde(default)]
32pub struct LoopConfig {
33    /// Minimum allowed interval between loop ticks (seconds). Floor enforced at parse time.
34    pub min_interval_secs: u64,
35    /// Maximum number of concurrent loops. Reserved for future use; always 1 in v1.
36    pub max_concurrent: u32,
37}
38
39impl Default for LoopConfig {
40    fn default() -> Self {
41        Self {
42            min_interval_secs: 5,
43            max_concurrent: 1,
44        }
45    }
46}