openfang icon indicating copy to clipboard operation
openfang copied to clipboard

Externalize Default Configurations to .openfang Folder

Open lvy010 opened this issue 8 months ago • 2 comments

Description

Default agents, models, and providers are hardcoded into the binary, preventing clean installations and easy customization without recompilation.

Alternatives Considered

Move all defaults to .openfang/ folder structure with JSON/YAML configs. Add --no-defaults flag for minimal installations.

Additional Context

  • Clean installs without bundled defaults
  • Easy customization via config files
  • Smaller binary size (~20-40% reduction)
  • No recompilation needed for updates
  • Version-controllable configurations

Zero breaking changes. Auto-generate defaults on first run for existing users.

lvy010 avatar Mar 12 '26 04:03 lvy010

Feature Implementation Complete

I've completed the implementation of catalog and agent template externalization, split into three PRs:

  • #546 - Core: Load models/providers from ~/.openfang/catalog files
  • #547 - Extension: Externalize agent templates + init seed mechanism
  • #548 - Tests: Cover home-backed catalog bootstrapping behavior

All test plan items verified ✓

lvy010 avatar Mar 12 '26 05:03 lvy010

OpenFang already uses ~/.openfang/ as the home directory for config.toml, agents/, skills/, and database files. The default configuration is generated by openfang init and stored in ~/.openfang/config.toml. Agent templates live in ~/.openfang/agents/. Skills are in ~/.openfang/skills/. The compile-time defaults serve as fallbacks when no disk config exists. This is the intended design for zero-config startup with customization through the .openfang folder.

jaberjaber23 avatar Mar 12 '26 15:03 jaberjaber23