pub struct FileConfig {Show 20 fields
pub all: Option<bool>,
pub harnesses: Option<Vec<String>>,
pub exclude: Option<Vec<String>>,
pub model: Option<String>,
pub system: Option<String>,
pub bypass: Option<bool>,
pub mode: Option<PermissionMode>,
pub timeout: Option<u64>,
pub output_format: Option<OutputFormat>,
pub schema_file: Option<String>,
pub schema_max_retries: Option<u32>,
pub max_parallel: Option<usize>,
pub require_available: Option<bool>,
pub history: Option<bool>,
pub history_dir: Option<String>,
pub allowed_tools: Option<Vec<String>>,
pub denied_tools: Option<Vec<String>>,
pub hooks: Option<Vec<HookEntry>>,
pub env: BTreeMap<String, String>,
pub harness: BTreeMap<String, HarnessConfig>,
}Expand description
One config file, as written by the user. Every field is optional: an absent field defers to the next layer down. Unknown fields are rejected so a typo fails loudly instead of being silently ignored.
Fields§
§all: Option<bool>Default selection: run every harness (like --all). Mutually exclusive
with harnesses. Used only when the CLI passes no selection.
harnesses: Option<Vec<String>>Default selection: the harness ids to run (like --harness).
exclude: Option<Vec<String>>Harness ids excluded from an all selection (like --exclude).
model: Option<String>Model passed to each harness that supports a model flag (like --model).
system: Option<String>Portable system prompt (like --system).
bypass: Option<bool>Request each harness’s bypass mode (default true; like --no-bypass
when false). The CLI’s --bypass / --no-bypass always win. Superseded
by mode when both are set (mode is the richer spelling; bypass = false is exactly mode = "default").
mode: Option<PermissionMode>The normalized approval mode (like --mode): plan / default / edit
/ auto / bypass. Beats bypass when both are set. The CLI’s --mode
(and --bypass / --no-bypass) always win.
timeout: Option<u64>Per-harness timeout in seconds (like --timeout).
output_format: Option<OutputFormat>Output format override (like --output-format).
schema_file: Option<String>Path to a JSON Schema file constraining each harness’s final answer
(like --schema). Resolved relative to the working directory. Turns the
run into a structured-output run: the schema is delivered to the harness
(natively where supported, else via the prompt), the result is validated,
and a failure is re-prompted up to schema_max_retries times.
schema_max_retries: Option<u32>Maximum retries per harness when a response fails schema validation
(like --schema-max-retries; default 2). Only meaningful with a schema.
max_parallel: Option<usize>Concurrency cap (like --max-parallel).
require_available: Option<bool>Treat a missing harness as a failure (like --require-available).
history: Option<bool>Record a normalized, cross-harness history of each run to disk (opt-in,
off by default; like --history / --no-history). Most naturally set in
a user-level config.toml so one turns it on across every project.
history_dir: Option<String>Directory the history is written to and read from (like --history-dir).
Defaults to <platform state dir>/oneharness/history when unset.
allowed_tools: Option<Vec<String>>Tool/permission rules the harness may use without prompting, in each
harness’s native rule syntax. Delivered by oneharness sync, which
merges them into the harness’s own project config file (Claude Code’s
.claude/settings.json permissions.allow, Cursor’s .cursor/cli.json,
Qwen’s .qwen/settings.json, crush’s crush.json) so the policy also
applies outside oneharness. A harness with no mapping reports the rule
as unmapped in the sync report rather than dropping it silently.
denied_tools: Option<Vec<String>>Deny rules; synced like allowed_tools (for crush this lands in
options.disabled_tools, hiding the tool entirely).
hooks: Option<Vec<HookEntry>>Normalized pre-tool hooks, each fanned across the synced harnesses by
oneharness sync and rendered into every harness’s native shape (a
shared config file, a dedicated hooks file, or a plugin). Unlike the
verbatim per-harness [harness.<id>.hooks] table — which is one
harness’s own schema, limited to harnesses whose hooks share their
config file — a [[hooks]] entry is harness-agnostic and reaches all of
them. The two are independent and may both be set.
env: BTreeMap<String, String>Extra environment for every harness process (like repeated --env).
harness: BTreeMap<String, HarnessConfig>Per-harness overrides, keyed by canonical harness id.
Implementations§
Source§impl FileConfig
impl FileConfig
Sourcepub fn model_for(&self, id: &str) -> Option<&str>
pub fn model_for(&self, id: &str) -> Option<&str>
The model for one harness: its [harness.<id>] override, else the
top-level model. (A CLI --model beats both; the caller applies it.)
Sourcepub fn bin_for(&self, id: &str) -> Option<&str>
pub fn bin_for(&self, id: &str) -> Option<&str>
The configured binary override for one harness, if any.
Sourcepub fn args_for(&self, id: &str) -> &[String]
pub fn args_for(&self, id: &str) -> &[String]
Extra args appended to one harness’s command (before CLI passthrough).
Sourcepub fn allowed_tools_for(&self, id: &str) -> &[String]
pub fn allowed_tools_for(&self, id: &str) -> &[String]
Allow rules for one harness: its [harness.<id>] override, else the
top-level allowed_tools. (CLI --allowed-tools beats both.)
Sourcepub fn denied_tools_for(&self, id: &str) -> &[String]
pub fn denied_tools_for(&self, id: &str) -> &[String]
Deny rules for one harness, resolved like Self::allowed_tools_for.
Sourcepub fn hooks_for(&self, id: &str) -> Option<&Value>
pub fn hooks_for(&self, id: &str) -> Option<&Value>
The hooks table for one harness, if configured (per-harness only: hooks schemas are harness-specific, so there is no top-level form).
Sourcepub fn hook_specs_for(&self, id: &str) -> Vec<HookSpec>
pub fn hook_specs_for(&self, id: &str) -> Vec<HookSpec>
The normalized [[hooks]] that apply to harness id, ready to install:
entries with no harnesses filter or one naming id, with {harness}
substituted in the command. Order follows the config (later entries
install after earlier ones).
Sourcepub fn settings_for(&self, id: &str) -> Option<&Value>
pub fn settings_for(&self, id: &str) -> Option<&Value>
The raw settings table for one harness, if configured (per-harness only: the shape is that harness’s own config schema).
Sourcepub fn env_for(&self, id: &str) -> Vec<(String, String)>
pub fn env_for(&self, id: &str) -> Vec<(String, String)>
The configured environment for one harness, in application order:
top-level [env] first, then [harness.<id>.env] so it wins on a key
collision. (The harness’s own default_env goes before these, and CLI
--env after; the runner applies env last-write-wins.)
Trait Implementations§
Source§impl Clone for FileConfig
impl Clone for FileConfig
Source§fn clone(&self) -> FileConfig
fn clone(&self) -> FileConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FileConfig
impl Debug for FileConfig
Source§impl Default for FileConfig
impl Default for FileConfig
Source§fn default() -> FileConfig
fn default() -> FileConfig
Source§impl<'de> Deserialize<'de> for FileConfig
impl<'de> Deserialize<'de> for FileConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for FileConfig
impl PartialEq for FileConfig
Source§fn eq(&self, other: &FileConfig) -> bool
fn eq(&self, other: &FileConfig) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for FileConfig
Auto Trait Implementations§
impl Freeze for FileConfig
impl RefUnwindSafe for FileConfig
impl Send for FileConfig
impl Sync for FileConfig
impl Unpin for FileConfig
impl UnsafeUnpin for FileConfig
impl UnwindSafe for FileConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more