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}
25
26/// Configuration for the `/loop` command.
27#[derive(Debug, Clone, Deserialize, Serialize)]
28#[serde(default)]
29pub struct LoopConfig {
30 /// Minimum allowed interval between loop ticks (seconds). Floor enforced at parse time.
31 pub min_interval_secs: u64,
32 /// Maximum number of concurrent loops. Reserved for future use; always 1 in v1.
33 pub max_concurrent: u32,
34}
35
36impl Default for LoopConfig {
37 fn default() -> Self {
38 Self {
39 min_interval_secs: 5,
40 max_concurrent: 1,
41 }
42 }
43}