feat(config): add export and import subcommands (#67)#68
Conversation
|
Good idea |
|
please fix biome error |
|
A very insightful point. Very good. |
|
LGTM |
|
Thanks for the review @NianJiuZst. I did a careful comparison and the biome CI failure is not introduced by this PR. Here are the numbers from running
The 2-error reduction comes from The remaining 18 errors all come from files this PR does not modify, e.g. It looks like the biome bump in #63 left some existing files unformatted, and this PR is the first one to surface it because CI runs against forks freshly. To keep the diff focused, I'd prefer : |
|
OK,Thanks your contribution ❤️ |
Summary
Implements
openmeta config exportandopenmeta config importsubcommands as proposed in #67. Enables portable configuration backup, restore, and migration between machines.Closes #67
Motivation
OpenMeta currently has no way to migrate configuration between machines. Users switching devices must rerun
openmeta initand manually rebuild profile, scoring preferences, commit template, and repository targeting presets. This PR introduces a single-file portable format that solves backup, migration, and team-sharing scenarios in one shot.Changes
src/commands/config.ts— Registerexportandimportsubcommands following the existing thin-command patternsrc/orchestration/config.ts— ImplementexportConfig()andimportConfig()methods with secret redaction logictest/config-orchestrator.test.ts— Add 6 new test cases covering export, import, secret handling, and error pathsDesign Decisions
exportreplacesgithub.pat,llm.apiKey, and per-profileapiKeywith<REDACTED>. Use--include-secretsfor full export with an explicit warning.<REDACTED>— Imported<REDACTED>placeholders never overwrite local credentials, preventing accidental wipes when re-importing a sanitized backup.configService.update()— Goes through the existing normalize / encrypt pipeline rather than writing config directly, avoiding divergence.AppConfig— Output structure matches the runtime config shape, making files human-readable and editable.Usage