1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// SPDX-FileCopyrightText: 2026 Andrei G <bug-ops>
// SPDX-License-Identifier: MIT OR Apache-2.0
//! Session-scoped CLI configuration: bare mode, JSON output, and auto-approval flags.
use serde::{Deserialize, Serialize};
/// Session-scoped CLI overrides loaded from the `[cli]` TOML section.
///
/// Command-line flags take priority over these values. This section has no
/// effect on Telegram, Discord, Slack, or ACP sessions.
#[derive(Debug, Clone, Default, Deserialize, Serialize)]
#[serde(default)]
#[allow(clippy::struct_excessive_bools)] // config struct — boolean flags are idiomatic for TOML-deserialized configuration
pub struct CliConfig {
/// Enable bare mode (skip skills, memory, MCP, scheduler, watchers).
pub bare: bool,
/// Enable safe mode (skip ZEPH.md/CLAUDE.md/AGENTS.md, plugins, skills,
/// hooks, and MCP servers for this session). Session-scoped only — never
/// persisted to `config.toml` (`#[serde(skip)]`), mirroring `--bare`'s
/// troubleshooting-flag precedent but gating a disjoint set of subsystems.
#[serde(skip)]
pub safe_mode: bool,
/// Force MCP image passthrough (spec-072) off for this session (`--no-mcp-media`),
/// regardless of per-server `media_passthrough` or `[mcp.media]` config. Session-scoped
/// only — never persisted to `config.toml` (`#[serde(skip)]`), mirroring `safe_mode`.
#[serde(skip)]
pub no_mcp_media: bool,
/// Emit structured JSON events (JSONL) to stdout. Forces logs to stderr.
pub json: bool,
/// Auto-approve trust-gate prompts (`-y` / `--auto`).
pub auto: bool,
/// Loop command configuration.
#[serde(rename = "loop")]
pub loop_: LoopConfig,
/// Tool allowlist for CLI/TUI sessions. `None` means all tools are permitted.
#[serde(default)]
pub allowed_tools: Option<Vec<String>>,
}
/// Configuration for the `/loop` command.
#[derive(Debug, Clone, Deserialize, Serialize)]
#[serde(default)]
pub struct LoopConfig {
/// Minimum allowed interval between loop ticks (seconds). Floor enforced at parse time.
pub min_interval_secs: u64,
/// Maximum number of concurrent loops. Reserved for future use; always 1 in v1.
pub max_concurrent: u32,
}
impl Default for LoopConfig {
fn default() -> Self {
Self {
min_interval_secs: 5,
max_concurrent: 1,
}
}
}