Skip to content

🎨 Palette: Improve interactive CLI prompts with helpful hints#114

Merged
abhimehro merged 2 commits intomainfrom
palette-ux-improvements-15106567699088137186
Jan 19, 2026
Merged

🎨 Palette: Improve interactive CLI prompts with helpful hints#114
abhimehro merged 2 commits intomainfrom
palette-ux-improvements-15106567699088137186

Conversation

@google-labs-jules
Copy link

💡 What: Added helpful hints and a direct URL to the interactive prompts for Profile ID and API Token.
🎯 Why: To help new users easily locate their credentials without needing to search through documentation, reducing setup friction.
📸 Before/After:

  • Before: Enter Control D API Token:
  • After:
    ℹ API Token is missing.
    You can generate one at: https://controld.com/account/manage-account
    Enter Control D API Token:
    

Accessibility: N/A (CLI text improvement)


PR created automatically by Jules for task 15106567699088137186 started by @abhimehro

- Added a direct link to the Control D account page when prompting for the API Token.
- Added a hint about where to find the Profile ID when prompting for it.
- Improved the new user experience by reducing friction during initial setup.
@google-labs-jules
Copy link
Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@trunk-io
Copy link

trunk-io bot commented Jan 18, 2026

😎 Merged manually by Abhi Mehrotra (@abhimehro) - details.

captured = capsys.readouterr()
stdout = captured.out

assert "You can find this in the URL of your profile" in stdout

Check notice

Code scanning / Bandit

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Note test

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
stdout = captured.out

assert "You can find this in the URL of your profile" in stdout
assert "https://controld.com/account/manage-account" in stdout

Check notice

Code scanning / Bandit

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Note test

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
captured = capsys.readouterr()
stdout = captured.out

assert "You can find this in the URL of your profile" in stdout

Check notice

Code scanning / Bandit (reported by Codacy)

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Note test

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
stdout = captured.out

assert "You can find this in the URL of your profile" in stdout
assert "https://controld.com/account/manage-account" in stdout

Check notice

Code scanning / Bandit (reported by Codacy)

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Note test

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
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.CYAN} You can find this in the URL of your profile in the Control D Dashboard.{Colors.ENDC}")

Check warning

Code scanning / Pylint (reported by Codacy)

Line too long (122/100) Warning

Line too long (122/100)

if not TOKEN:
print(f"{Colors.CYAN}ℹ API Token is missing.{Colors.ENDC}")
print(f"{Colors.CYAN} You can generate one at: https://controld.com/account/manage-account{Colors.ENDC}")

Check warning

Code scanning / Pylint (reported by Codacy)

Line too long (118/100) Warning

Line too long (118/100)
assert "\033[" in combined_output

# Case 6: Interactive prompts show helpful hints
def test_interactive_prompts_show_hints(monkeypatch, capsys):

Check warning

Code scanning / Pylint (reported by Codacy)

Missing function docstring Warning test

Missing function docstring
monkeypatch.delenv("TOKEN", raising=False)

# Reload main with isatty=True to trigger interactive mode logic
m = reload_main_with_env(monkeypatch, isatty=True)

Check warning

Code scanning / Pylint (reported by Codacy)

Variable name "m" doesn't conform to snake_case naming style Warning test

Variable name "m" doesn't conform to snake_case naming style
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.CYAN} You can find this in the URL of your profile in the Control D Dashboard.{Colors.ENDC}")

Check warning

Code scanning / Pylintpython3 (reported by Codacy)

Line too long (122/100) Warning

Line too long (122/100)

if not TOKEN:
print(f"{Colors.CYAN}ℹ API Token is missing.{Colors.ENDC}")
print(f"{Colors.CYAN} You can generate one at: https://controld.com/account/manage-account{Colors.ENDC}")

Check warning

Code scanning / Pylintpython3 (reported by Codacy)

Line too long (118/100) Warning

Line too long (118/100)
assert "\033[" in combined_output

# Case 6: Interactive prompts show helpful hints
def test_interactive_prompts_show_hints(monkeypatch, capsys):

Check warning

Code scanning / Pylintpython3 (reported by Codacy)

Missing function or method docstring Warning test

Missing function or method docstring
monkeypatch.delenv("TOKEN", raising=False)

# Reload main with isatty=True to trigger interactive mode logic
m = reload_main_with_env(monkeypatch, isatty=True)

Check warning

Code scanning / Pylintpython3 (reported by Codacy)

Variable name "m" doesn't conform to snake_case naming style Warning test

Variable name "m" doesn't conform to snake_case naming style
@abhimehro abhimehro marked this pull request as ready for review January 19, 2026 05:30
Copilot AI review requested due to automatic review settings January 19, 2026 05:30
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the user experience of the CLI tool by adding contextual hints to interactive credential prompts. When Profile ID or API Token are missing, the tool now displays helpful messages directing users to where they can find or generate these credentials, reducing setup friction for new users.

Changes:

  • Added informational hints to Profile ID and API Token prompts with direct URLs to help users locate credentials
  • Added test coverage to verify the hints are displayed in interactive mode
  • Documented the learning pattern in the project's palette documentation

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
main.py Added two hint messages (lines 811 and 818) providing contextual help for Profile ID and API Token prompts with direct URLs
test_main.py Added new test case to verify interactive prompts display the helpful hints correctly
.Jules/palette.md Added documentation about the CLI prompt improvement pattern for future reference

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@abhimehro abhimehro merged commit 8de122c into main Jan 19, 2026
18 checks passed
@abhimehro abhimehro deleted the palette-ux-improvements-15106567699088137186 branch January 19, 2026 05:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants