Skip to main content

Module config

Module config 

Source
Expand description

JSON config file for the taskfast CLI.

Persistent state written by taskfast init (and edited via taskfast config set) so subsequent subcommands work in a fresh shell without sourcing anything.

§Layout

Default path: ./.taskfast/config.json (project-local). Override via the global --config <path> flag or TASKFAST_CONFIG env var.

§Precedence

Ctx::from_cli_and_config (see cmd/mod.rs) layers values as:

clap flag > env var > config file > default

Clap already folds flag > env via env = "...". The config file sits one rung under that, so omitting a field in JSON never surprises a caller who passed the flag.

§Forward-compat

schema_version is a u32 that starts at CURRENT_SCHEMA_VERSION. Unknown fields are tolerated (default serde behaviour). A file with a newer schema_version logs a warning and loads what it recognises — it does not fail, so an older CLI doesn’t brick a newer config dir.

§Secrets

api_key lives in this file. The file is written mode 0600 on unix (atomic temp + rename) and the containing .taskfast/ directory is intended to be git-ignored.

Structs§

Config
On-disk config. Every runtime field is Option so the file stays small and a partially-configured project can still round-trip.

Enums§

ConfigError

Constants§

CURRENT_SCHEMA_VERSION
Current on-disk schema version. Bump when a field changes shape in a way a reader needs to special-case; additive fields don’t need a bump because serde #[serde(default)] already handles missing keys.
DEFAULT_CONFIG_PATH
Default project-local path, relative to the CWD.