Skip to content

feat: add logout command#1016

Open
Sypher845 wants to merge 1 commit into
goharbor:mainfrom
Sypher845:feat/logout-command
Open

feat: add logout command#1016
Sypher845 wants to merge 1 commit into
goharbor:mainfrom
Sypher845:feat/logout-command

Conversation

@Sypher845

@Sypher845 Sypher845 commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Description

Adds a harbor logout command for better UX, gives users a simple, discoverable way to remove their current credentials from the local config, mirroring the standard login / logout pairing found in CLI tools. Includes a confirmation prompt with -y flag.

Command

  • harbor logout
Kooha-2026-06-23-02-04-56

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation update
  • Chore / maintenance

Signed-off-by: Sypher845 <suyashpatil845@gmail.com>
@codecov

codecov Bot commented Jun 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 32.50000% with 27 lines in your changes missing coverage. Please review.
✅ Project coverage is 9.40%. Comparing base (60ad0bd) to head (9222592).
⚠️ Report is 188 commits behind head on main.

Files with missing lines Patch % Lines
cmd/harbor/root/logout.go 27.02% 26 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             main   #1016      +/-   ##
=========================================
- Coverage   10.99%   9.40%   -1.59%     
=========================================
  Files         173     322     +149     
  Lines        8671   16122    +7451     
=========================================
+ Hits          953    1516     +563     
- Misses       7612   14471    +6859     
- Partials      106     135      +29     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Sypher845
Sypher845 marked this pull request as ready for review June 22, 2026 21:01

@NucleoFusion NucleoFusion left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this not what
harbor-cli context delete does?
And context delete also has support for providing a name?

@Sypher845

Copy link
Copy Markdown
Contributor Author

Yeah, this is mainly for better UX and discoverability, most CLI tools have a login/logout pairing

@NucleoFusion NucleoFusion left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Im still conflicted on whether this is a meaningful enough change yk
But that is for the meet, while that is being done, here is a review anyway

Comment thread cmd/harbor/root/logout.go
Comment on lines +50 to +51
fmt.Printf("Log out from '%s'? [y/N]: ", currentName)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should be in prompt and use charm/huh

@qcserestipy

Copy link
Copy Markdown
Collaborator

@NucleoFusion @Sypher845 I also think that logout can be an alias for context delete at maximum. But it would reimplement the same functionality twice. Making it a convenience proxy might be discussed.

@qcserestipy qcserestipy added discussion Discussion status/needs-feedback Waiting for input from the issue author or reporter. May be closed after 7 days. labels Jun 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

discussion Discussion status/needs-feedback Waiting for input from the issue author or reporter. May be closed after 7 days.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feature]: logout command

3 participants