@startanaicompany/cli 1.4.1 → 1.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@startanaicompany/cli",
3
- "version": "1.4.1",
3
+ "version": "1.4.3",
4
4
  "description": "Official CLI for StartAnAiCompany.com - Deploy AI recruitment sites with ease",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -32,15 +32,13 @@ async function register(options) {
32
32
  process.exit(1);
33
33
  }
34
34
 
35
- const gitUsername = options.gitUsername || undefined;
36
-
37
35
  logger.section('Register for StartAnAiCompany');
38
36
 
39
- // Register via API
37
+ // Register via API (git_username no longer required - OAuth used instead)
40
38
  const spin = logger.spinner('Creating account...').start();
41
39
 
42
40
  try {
43
- const result = await api.register(email, gitUsername);
41
+ const result = await api.register(email);
44
42
 
45
43
  spin.succeed('Account created successfully!');
46
44
 
@@ -21,7 +21,7 @@ async function verify(code) {
21
21
 
22
22
  const user = getUser();
23
23
 
24
- if (!user || !user.email) {
24
+ if (!user || !user.userId) {
25
25
  logger.error('No user found. Please register first');
26
26
  logger.newline();
27
27
  logger.info('Run:');
@@ -39,17 +39,22 @@ async function verify(code) {
39
39
  const spin = logger.spinner('Verifying email...').start();
40
40
 
41
41
  try {
42
- const result = await api.verifyEmail(user.email, code);
42
+ const result = await api.verifyEmail(user.userId, code);
43
43
 
44
44
  spin.succeed('Email verified successfully!');
45
45
 
46
- // Update user verification status and session token if provided
46
+ // Update user verification status and save API key
47
47
  const updatedUser = {
48
48
  ...user,
49
49
  verified: true,
50
50
  };
51
51
 
52
- // If backend returns new session token after verification, update it
52
+ // Save API key if returned (only returned once on verification)
53
+ if (result.api_key) {
54
+ updatedUser.apiKey = result.api_key;
55
+ }
56
+
57
+ // If backend returns session token after verification, update it
53
58
  if (result.session_token) {
54
59
  updatedUser.sessionToken = result.session_token;
55
60
  updatedUser.expiresAt = result.expires_at;
@@ -61,6 +66,13 @@ async function verify(code) {
61
66
  logger.success('Your account is now verified!');
62
67
  logger.info('You can now create and deploy applications.');
63
68
 
69
+ // Show API key if provided
70
+ if (result.api_key) {
71
+ logger.newline();
72
+ logger.field('API Key', result.api_key.substring(0, 20) + '...');
73
+ logger.warn('Save your API key securely. It will not be shown again.');
74
+ }
75
+
64
76
  // Show expiration if session token was updated
65
77
  if (result.expires_at) {
66
78
  const expirationDate = new Date(result.expires_at);
package/src/lib/api.js CHANGED
@@ -57,23 +57,21 @@ async function login(email, apiKey) {
57
57
 
58
58
  /**
59
59
  * Register a new user
60
+ * Note: git_username no longer required - users connect Git via OAuth separately
60
61
  */
61
- async function register(email, gitUsername) {
62
+ async function register(email) {
62
63
  const client = createClient();
63
- const response = await client.post('/users/register', {
64
- email,
65
- git_username: gitUsername,
66
- });
64
+ const response = await client.post('/users/register', { email });
67
65
  return response.data;
68
66
  }
69
67
 
70
68
  /**
71
69
  * Verify email with code
72
70
  */
73
- async function verifyEmail(email, code) {
71
+ async function verifyEmail(userId, code) {
74
72
  const client = createClient();
75
73
  const response = await client.post('/users/verify', {
76
- email,
74
+ user_id: userId,
77
75
  verification_code: code,
78
76
  });
79
77
  return response.data;