Repository navigation
feat: spinners, summaries and colors; keep secrets off the terminal - #30
Merged
Merged
Conversation
Output now uses console and indicatif, all on stderr: - a spinner while a secret is fetched from its provider - one-line summaries, e.g. "✓ Loaded 5 secrets from work (3 from the keychain, 2 from 1password)" and "✓ Added 2 SSH keys to ssh-agent (expire in 8h)" - colored errors, warnings and debug lines - colored marks in `doctor`, and states and headings in `status` and `profile show` Nothing is animated or colored when the output isn't a terminal, with -q, or with NO_COLOR. On a terminal without the shell integration, `load` and `unload` now handle SSH keys as usual and skip only the variables, which they can't set and won't print: they fail with a hint instead of refusing everything.
…oader `Loader` counted cached and fetched secrets in `Cell`s, mutable state behind `&self` that also counted SSH keys the summary doesn't report. Now `load` returns the value with its origin (keychain or provider), and `resolve` returns the variables with how many came from where and how many failed. The loader keeps no state.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Output
All on stderr. stdout and the shell integration's fd 3 are unchanged.
consolefor styling and terminal detection,indicatiffor the spinner. Warnings printed while a spinner runs appear above it.doctor,status(set / in agent green, not set dim, problems yellow),statusandprofile show.-q, or withNO_COLOR(alsoCLICOLORandCLICOLOR_FORCE). stdout is only styled whenmainturns it on, so captured output, as in tests, stays plain.profile clear,config initandconfig editprint ✓ summaries too.evalor at shell start, so a full-screen interface doesn't fit.Terminal without the shell integration
#28 refused
loadandunloadoutright in this case. Now they do what doesn't need the shell, and only refuse the variables:loadunloadeval "$(keysafe init zsh)"to ~/.zshrc, or runeval "$(keysafe load)""keysafe load github-key(SSH key only) now works on a plain terminal.Testing
loadon a terminal: adds keys, doesn't fetch or print variables;unloadon a terminal: removes keys, keeps variables and files;scriptand a stubop:loadwithout the integration not callingopat all.Known edge: if
opitself asks for input on the terminal (setups without the desktop app's biometric unlock), its prompt and the spinner share the line. keysafe checks the sign-in first, so this needs a setup whereopprompts anyway.