diff --git a/.Jules/palette.md b/.Jules/palette.md new file mode 100644 index 0000000..7dd5ab3 --- /dev/null +++ b/.Jules/palette.md @@ -0,0 +1,3 @@ +## 2024-03-24 - CLI Interactive Prompt Enhancements +**Learning:** For CLI tools that require external credentials (like API tokens), users often context-switch to find them. Providing specific navigation paths (e.g., "Account > My Account > API Tokens") or URL patterns directly in the prompt significantly reduces friction. Also, explicitly stating `(input hidden)` for `getpass` prompts prevents user confusion about whether input is being received. +**Action:** When designing CLI onboarding flows, always include "where to find this" hints for credentials and explicit feedback indicators for hidden inputs. diff --git a/main.py b/main.py index e6aabc5..bcad1ff 100644 --- a/main.py +++ b/main.py @@ -712,23 +712,25 @@ def main(): if not args.dry_run and sys.stdin.isatty(): if not profile_ids: print(f"{Colors.CYAN}ℹ Profile ID is missing.{Colors.ENDC}") + print(f"{Colors.BLUE} (Tip: You can find this in your Control D dashboard URL: /profiles/){Colors.ENDC}") p_input = input(f"{Colors.BOLD}Enter Control D Profile ID:{Colors.ENDC} ").strip() if p_input: profile_ids = [p.strip() for p in p_input.split(",") if p.strip()] if not TOKEN: print(f"{Colors.CYAN}ℹ API Token is missing.{Colors.ENDC}") + print(f"{Colors.BLUE} (Tip: Generate this in Account > My Account > API Tokens){Colors.ENDC}") import getpass - t_input = getpass.getpass(f"{Colors.BOLD}Enter Control D API Token:{Colors.ENDC} ").strip() + t_input = getpass.getpass(f"{Colors.BOLD}Enter Control D API Token (input hidden):{Colors.ENDC} ").strip() if t_input: TOKEN = t_input if not profile_ids and not args.dry_run: - log.error("PROFILE missing and --dry-run not set. Provide --profiles or set PROFILE env.") + log.error("Profile ID is missing. Please provide it via --profiles argument or PROFILE environment variable.") exit(1) if not TOKEN and not args.dry_run: - log.error("TOKEN missing and --dry-run not set. Set TOKEN env for live sync.") + log.error("API Token is missing. Please provide it via TOKEN environment variable for live sync.") exit(1) warm_up_cache(folder_urls)