Skip to content

rust(feat): interactive profile setup for sift-cli config - #853

Merged
alexluck-sift merged 3 commits into
mainfrom
al/sift-cli/profile-updating
Oct 28, 2026
Merged

alexluck-sift merged 3 commits into
mainfrom
al/sift-cli/profile-updating

Conversation

@alexluck-sift

@alexluck-sift alexluck-sift commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

sift-cli config update with no flags printed Nothing to update. and exited 0, and setting up a profile took two commands that you had to know to run in order. This PR makes config create and config update interactive. create makes new things (the config file or a profile) and update edits existing ones, with the same prompts.

Config commands

  • config create prompts for the profile values. --profile <new> adds a profile, and with no --profile it asks for a name once the default profile is set up.
  • config update with no flags opens an editor: a profile picker, current values in brackets (Enter keeps them), a hidden API key, and a change list with the key masked before Apply? [Y/n]. It writes nothing when no field changed.
  • Breaking: outside a terminal, config update with no flags exits 2. A missing file or unknown profile points to config create. The flag path is unchanged for scripts and now prints what changed.

--profile default

  • Selects the top-level profile in every command. Before, it looked for a [default] table, so --profile default ping failed on a normal config. A file with a real [default] table still uses it.

Verification

First-time config create config update with the profile picker
First-time config create Config update with profile picker
  • Ran the built binary in a pseudo-terminal against a throwaway HOME: first-time create, create --profile staging, picker plus key rotation, no-change, decline, unknown profile, and input sent before the prompts appeared.
  • Ran the non-terminal paths (create, update with and without flags) and confirmed the exit codes and written TOML.
Check Result Evidence
config create when the default profile is set up Asks for a new profile name, then prompts for it screenshot
config update with no flags outside a terminal Error with a tip, exit status 2 screenshot
config update for a profile that does not exist Points to config create screenshot

`config create` now prompts for profile values and creates new profiles
with `--profile <name>`. `config update` without flags opens an editor
that shows current values, hides the API key, and confirms a masked
change list. Outside a terminal it exits 2 instead of a silent no-op.

`--profile default` now selects the top-level profile in every command.
…ditor

Each field now shows its current value on its own line above a `new:`
prompt, and the header says to type a new value or leave it blank to
keep the current one. Suggested app URLs say they are used when left
blank.
@alexluck-sift
alexluck-sift marked this pull request as ready for review October 26, 2026 17:35
solidiquis
solidiquis previously approved these changes Oct 27, 2026
@alexluck-sift
alexluck-sift merged commit 6af6c6b into main Oct 28, 2026
22 checks passed
@alexluck-sift
alexluck-sift deleted the al/sift-cli/profile-updating branch October 28, 2026 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants