Description
Suggestion
Add an --interactive
(-i
) flag to the configu upsert
command to open the user's default text editor with a temporary file pre-filled with config data.
When invoked, this mode:
- Opens the editor with a temp file formatted in YAML or JSON (based on schema or
.configu
settings). - Pre-populates keys and values from the schema and previously upserted values.
- Applies changes after the editor is closed, continuing the upsert process as normal.
- Merges key-values from
--kv
if also provided, to pre-fill the editor content. - Uses settings from
.configu.cli.editor
and.configu.cli.format
to control the editor and format.
Motivation
Many developers prefer editing structured configurations in a full editor instead of passing long strings via CLI.
This feature:
- improves UX for complex configurations data.
- Makes
configu upsert
more ergonomic for local development and debugging. - Enables a familiar workflow (e.g. Git’s
--edit
,kubectl edit
, Helm--values
). - Is a key building block for future interactive CLI experiences with Configu.
Context
- Related future commands might include:
configu open schema
,configu open config
, orconfigu open dashboard
. - This sets the naming precedent for interactive workflows in Configu CLI.
- Interactive editor behavior (format, editor binary) is configurable via
.configu
:cli: editor: code format: yaml
flowchart TD
A[User runs configu upsert -i] --> B[Load schema + previous config values]
B --> C[Merge with --kv if used]
C --> D[Format config in YAML/JSON]
D --> E[Open in default editor from .configu]
E --> F[User edits and saves file]
F --> G[Validate and apply config]
G --> H[Finish upsert process]