Skip to content

Commit 117da69

Browse files
author
Manus AI
committed
feat: Add --host parameter to register command
The register command now accepts a --host parameter to allow users to register against self-hosted Fleetbase instances instead of only the default api.fleetbase.io. Usage: flb register --host myinstance.com flb register -h myinstance.com Changes: - Added --host/-h option to register command - Defaults to api.fleetbase.io if not specified - Dynamically builds registration API URL based on host - Updates login suggestion to include --host if used during registration
1 parent 2a08b01 commit 117da69

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,8 @@ async function versionBump (options) {
723723

724724
// Command to handle registration
725725
async function registerCommand(options) {
726-
const registrationApi = 'https://api.fleetbase.io/~registry/v1/developer-account/register';
726+
const host = options.host || 'api.fleetbase.io';
727+
const registrationApi = `https://${host}/~registry/v1/developer-account/register`;
727728

728729
try {
729730
// Collect registration information
@@ -792,7 +793,8 @@ async function registerCommand(options) {
792793
if (response.data.status === 'success') {
793794
console.log('\n✓ Account created successfully!');
794795
console.log('✓ Please check your email to verify your account.');
795-
console.log(`\n✓ Once verified, you can login with: flb login -u ${registrationData.username}`);
796+
const loginCmd = options.host ? `flb login -u ${registrationData.username} --host ${options.host}` : `flb login -u ${registrationData.username}`;
797+
console.log(`\n✓ Once verified, you can login with: ${loginCmd}`);
796798
} else {
797799
console.error('Registration failed:', response.data.message || 'Unknown error');
798800
process.exit(1);
@@ -1181,6 +1183,7 @@ program
11811183
.option('-e, --email <email>', 'Email address')
11821184
.option('-p, --password <password>', 'Password')
11831185
.option('-n, --name <name>', 'Your full name (optional)')
1186+
.option('-h, --host <host>', 'API host (default: api.fleetbase.io)')
11841187
.action(registerCommand);
11851188

11861189
program

0 commit comments

Comments
 (0)