Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: 🤖 Add Help subcommand for auth subcommands #36 #37

Merged
merged 3 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -348,5 +348,7 @@
"unexpectedFileFormat": "We weren't expecting the format {format}. Kindly submit a detailed report of the issue to our support team.",
"failedCalculateBlake3Hash": "Failed to calculate the Blake3 hash. Please try again!",
"failedDeployFleekFunction": "Failed to deploy the Fleek Function. Please try again!",
"warnProvideValidDomainName": "Please provide a valid domain name."
"warnProvideValidDomainName": "Please provide a valid domain name.",
"cmdAuthLoginDescription": "Authenticate the CLI session using the Fleek Platform Web app. Open the URL in your favourite browser to initiate the browser-based login process. Select your preferred authentication method and return to CLI once completed.",
"cmdAuthLogoutDescription": "Ends your active CLI session, securing your account. Disables access to personal features such as storage and site deployment until re-authentication."
}
16 changes: 9 additions & 7 deletions src/commands/auth/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import { t } from '../../utils/translation';
import { loginActionHandler } from './login';
import { logoutActionHandler } from './logout';

export default (program: Command) => {
program
export default (cmd: Command) => {
cmd
.command('login')
.description(t('loginToFlkPlt', { status: t('loginTo') }))
.description(t('cmdAuthLoginDescription'))
.action(() => {
const uiAppUrl = getDefined('UI__APP_URL');
const authApiUrl = getDefined('SDK__GRAPHQL_API_URL');
Expand All @@ -22,10 +22,12 @@ export default (program: Command) => {
uiAppUrl,
authApiUrl,
});
});
})
.addHelpCommand();

program
cmd
.command('logout')
.description(t('loginToFlkPlt', { status: t('logoutOf') }))
.action(logoutActionHandler);
.description(t('cmdAuthLogoutDescription'))
.action(logoutActionHandler)
.addHelpCommand();
};