Skip to content

Commit

Permalink
feat(profile): open in the Console
Browse files Browse the repository at this point in the history
  • Loading branch information
davlgd authored and hsablonniere committed Dec 18, 2024
1 parent 04f3826 commit 4ee9730
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
6 changes: 5 additions & 1 deletion bin/clever.js
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,7 @@ async function run () {

// OPEN COMMAND
const openCommand = cliparse.command('open', {
description: 'Open an application in your browser',
description: 'Open an application in the Console',
options: [opts.alias, opts.appIdOrName],
}, open.open);

Expand All @@ -776,9 +776,13 @@ async function run () {
}, consoleModule.openConsole);

// PROFILE COMMAND
const profileOpenCommand = cliparse.command('open', {
description: 'Open your profile in the Console',
}, profile.openProfile);
const profileCommand = cliparse.command('profile', {
description: 'Display the profile of the current user',
options: [opts.humanJsonOutputFormat],
commands: [profileOpenCommand],
}, profile.profile);

// PUBLISHED CONFIG COMMANDS
Expand Down
8 changes: 7 additions & 1 deletion src/commands/profile.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import colors from 'colors/safe.js';

import openPage from 'open';
import { Logger } from '../logger.js';
import * as User from '../models/user.js';

Expand Down Expand Up @@ -46,3 +46,9 @@ export async function profile (params) {
}
}
};

export async function openProfile () {
const URL = 'https://console.clever-cloud.com/users/me/information';
Logger.debug('Opening the profile page in your browser');
await openPage(URL, { wait: false });
}

0 comments on commit 4ee9730

Please sign in to comment.