Restrict CLI Command Visibility Before User Authentication
Description
Currently, all CLI commands are visible and accessible before the user logs in. This exposes commands that should only be available to authenticated users and creates an inconsistent user experience.
The CLI should display only the login command before authentication. Once the user successfully logs in, all authorized commands should become visible and accessible.
Current Behavior
- All commands are displayed before login.
- Users can view commands intended for authenticated sessions.
- Unauthorized users can attempt to execute protected commands.
Expected Behavior
Before Login
- Only the
logincommand should be visible and executable.
After Login
- All authenticated commands should become visible and accessible.
Suggested Solution
Implement authentication-based command visibility and access control:
- Check authentication state before registering/displaying commands.
- Hide protected commands for unauthenticated users.
- Refresh command availability after successful login.
- Prevent execution of protected commands without authentication.
Acceptance Criteria
-
Only the logincommand is visible before authentication. -
Protected commands are hidden for unauthenticated users. -
All commands become visible after successful login. -
Unauthorized command execution is blocked. -
Help/menu output updates correctly based on authentication state.