pub struct Config {
pub bird_root: PathBuf,
pub client_id: String,
pub hot_days: u32,
pub inline_threshold: usize,
pub auto_extract: bool,
pub storage_mode: StorageMode,
pub remotes: Vec<RemoteConfig>,
pub sync: SyncConfig,
pub hooks: HooksConfig,
pub buffer: BufferConfig,
}Expand description
BIRD configuration.
Fields§
§bird_root: PathBufRoot directory for all BIRD data.
client_id: StringClient identifier for this machine.
hot_days: u32Days to keep data in hot tier before archiving.
inline_threshold: usizeThreshold in bytes for inline vs blob storage.
auto_extract: boolAutomatically extract events after shq run commands.
storage_mode: StorageModeStorage mode for writing data.
- parquet: Multi-writer safe, requires compaction (default)
- duckdb: Single-writer, no compaction needed
remotes: Vec<RemoteConfig>Remote storage configurations.
sync: SyncConfigSync configuration for push/pull operations.
hooks: HooksConfigShell hook configuration.
buffer: BufferConfigRetrospective buffer configuration.
Implementations§
Source§impl Config
impl Config
Sourcepub fn with_root(bird_root: impl Into<PathBuf>) -> Self
pub fn with_root(bird_root: impl Into<PathBuf>) -> Self
Create a new config with the given BIRD_ROOT.
Sourcepub fn with_duckdb_mode(bird_root: impl Into<PathBuf>) -> Self
pub fn with_duckdb_mode(bird_root: impl Into<PathBuf>) -> Self
Create a new config with DuckDB storage mode.
Sourcepub fn default_location() -> Result<Self>
pub fn default_location() -> Result<Self>
Create a config using default BIRD_ROOT resolution.
Sourcepub fn recent_dir(&self) -> PathBuf
pub fn recent_dir(&self) -> PathBuf
Path to the recent (hot) data directory.
Sourcepub fn archive_dir(&self) -> PathBuf
pub fn archive_dir(&self) -> PathBuf
Path to the archive (cold) data directory.
Sourcepub fn attempts_dir(&self, date: &NaiveDate) -> PathBuf
pub fn attempts_dir(&self, date: &NaiveDate) -> PathBuf
Path to attempts parquet files for a given date (v5 schema).
Partitioning: recent/attempts/date=YYYY-MM-DD/
Sourcepub fn outcomes_dir(&self, date: &NaiveDate) -> PathBuf
pub fn outcomes_dir(&self, date: &NaiveDate) -> PathBuf
Path to outcomes parquet files for a given date (v5 schema).
Partitioning: recent/outcomes/date=YYYY-MM-DD/
Sourcepub fn invocations_dir_with_status(
&self,
status: &str,
date: &NaiveDate,
) -> PathBuf
pub fn invocations_dir_with_status( &self, status: &str, date: &NaiveDate, ) -> PathBuf
Path to invocations parquet files for a given date and status.
V4 Schema: Status partitioning: recent/invocations/status=<status>/date=YYYY-MM-DD/
In v5 schema, use attempts_dir() and outcomes_dir() instead.
Sourcepub fn invocations_dir(&self, date: &NaiveDate) -> PathBuf
pub fn invocations_dir(&self, date: &NaiveDate) -> PathBuf
Path to invocations parquet files for a given date (defaults to “completed” status).
V4 Schema: For backwards compatibility - use invocations_dir_with_status for explicit status.
In v5 schema, use attempts_dir() and outcomes_dir() instead.
Sourcepub fn pending_dir(&self) -> PathBuf
👎Deprecated since 0.2.0: V4 schema. In v5, pending detection is via the invocations view.
pub fn pending_dir(&self) -> PathBuf
Path to the pending invocations directory (JSON files for crash recovery).
V4 Schema: In v5, pending detection is via:
SELECT * FROM attempts WHERE id NOT IN (SELECT attempt_id FROM outcomes)
Sourcepub fn outputs_dir(&self, date: &NaiveDate) -> PathBuf
pub fn outputs_dir(&self, date: &NaiveDate) -> PathBuf
Path to outputs parquet files for a given date.
Sourcepub fn sessions_dir(&self, date: &NaiveDate) -> PathBuf
pub fn sessions_dir(&self, date: &NaiveDate) -> PathBuf
Path to sessions parquet files for a given date.
Sourcepub fn extensions_dir(&self) -> PathBuf
pub fn extensions_dir(&self) -> PathBuf
Path to the DuckDB extensions directory.
Sourcepub fn running_dir(&self) -> PathBuf
pub fn running_dir(&self) -> PathBuf
Path to the running directory for in-progress command output.
Files here are temp files streamed during command execution:
running/<invocation_id>.out
On completion, content is moved to blob storage. On crash, files survive
for recovery. Use shq show --follow <id> to tail while running.
Sourcepub fn running_path(&self, invocation_id: &Uuid) -> PathBuf
pub fn running_path(&self, invocation_id: &Uuid) -> PathBuf
Path to a running output file for a specific invocation.
Sourcepub fn buffer_dir(&self) -> PathBuf
pub fn buffer_dir(&self) -> PathBuf
Path to the retrospective buffer directory.
Contains output from recent shell commands that weren’t explicitly captured.
Files: <uuid>.out (output) and <uuid>.meta (JSON metadata).
Protected with 700 permissions since buffer may contain sensitive output.
Sourcepub fn buffer_output_path(&self, id: &Uuid) -> PathBuf
pub fn buffer_output_path(&self, id: &Uuid) -> PathBuf
Path to a buffer entry’s output file.
Sourcepub fn buffer_meta_path(&self, id: &Uuid) -> PathBuf
pub fn buffer_meta_path(&self, id: &Uuid) -> PathBuf
Path to a buffer entry’s metadata file.
Sourcepub fn blob_path(&self, hash: &str, cmd_hint: &str) -> PathBuf
pub fn blob_path(&self, hash: &str, cmd_hint: &str) -> PathBuf
Path to a specific blob file by hash and command.
Sourcepub fn event_formats_path(&self) -> PathBuf
pub fn event_formats_path(&self) -> PathBuf
Path to the event-formats.toml config file (legacy).
Sourcepub fn format_hints_path(&self) -> PathBuf
pub fn format_hints_path(&self) -> PathBuf
Path to the format-hints.toml config file.
Sourcepub fn events_dir(&self, date: &NaiveDate) -> PathBuf
pub fn events_dir(&self, date: &NaiveDate) -> PathBuf
Path to events parquet files for a given date.
Sourcepub fn get_remote(&self, name: &str) -> Option<&RemoteConfig>
pub fn get_remote(&self, name: &str) -> Option<&RemoteConfig>
Get a remote by name.
Sourcepub fn add_remote(&mut self, remote: RemoteConfig)
pub fn add_remote(&mut self, remote: RemoteConfig)
Add a remote configuration.
Sourcepub fn remove_remote(&mut self, name: &str) -> bool
pub fn remove_remote(&mut self, name: &str) -> bool
Remove a remote by name. Returns true if removed.
Sourcepub fn blob_roots(&self) -> Vec<String>
pub fn blob_roots(&self) -> Vec<String>
Get all blob roots for multi-location resolution. Returns local blobs dir first, then remote blob URLs.
Sourcepub fn auto_attach_remotes(&self) -> Vec<&RemoteConfig>
pub fn auto_attach_remotes(&self) -> Vec<&RemoteConfig>
Get remotes that should be auto-attached.