@startanaicompany/cli 1.4.3 → 1.4.7

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.3",
3
+ "version": "1.4.7",
4
4
  "description": "Official CLI for StartAnAiCompany.com - Deploy AI recruitment sites with ease",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -82,16 +82,8 @@ async function register(options) {
82
82
  logger.newline();
83
83
  logger.field('Email', email);
84
84
 
85
- // Show session token or API key info
86
- if (result.session_token) {
87
- logger.field('Session Token', result.session_token.substring(0, 20) + '...');
88
- if (result.expires_at) {
89
- const expirationDate = new Date(result.expires_at);
90
- logger.field('Expires', expirationDate.toLocaleDateString());
91
- }
92
- } else if (result.api_key) {
93
- logger.field('API Key', result.api_key.substring(0, 20) + '...');
94
- }
85
+ // Session token is automatically saved, no need to show it
86
+ // User will get their API key after verification
95
87
 
96
88
  } catch (error) {
97
89
  spin.fail('Registration failed');
@@ -66,7 +66,11 @@ async function status() {
66
66
 
67
67
  // Show account info
68
68
  logger.field('User ID', userData.id);
69
- logger.field('Git Username', userData.git_username || 'Not set');
69
+ if (userData.git_username) {
70
+ logger.field('Git Username', userData.git_username);
71
+ } else {
72
+ logger.field('Git Connection', 'Not connected (use OAuth to connect)');
73
+ }
70
74
  logger.field('Applications', `${userData.application_count} / ${userData.max_applications}`);
71
75
 
72
76
  logger.newline();
@@ -64,13 +64,17 @@ async function verify(code) {
64
64
 
65
65
  logger.newline();
66
66
  logger.success('Your account is now verified!');
67
- logger.info('You can now create and deploy applications.');
68
67
 
69
- // Show API key if provided
68
+ // Show API key if provided (FULL key, not truncated)
70
69
  if (result.api_key) {
71
70
  logger.newline();
72
- logger.field('API Key', result.api_key.substring(0, 20) + '...');
71
+ logger.field('API Key', result.api_key);
73
72
  logger.warn('Save your API key securely. It will not be shown again.');
73
+ logger.newline();
74
+ logger.info('Next step: Login with your API key');
75
+ logger.log(` saac login -e ${user.email} -k ${result.api_key}`);
76
+ logger.newline();
77
+ logger.info('After login, you can create and deploy applications.');
74
78
  }
75
79
 
76
80
  // Show expiration if session token was updated
package/src/lib/oauth.js CHANGED
@@ -47,7 +47,7 @@ async function connectGitAccount(gitHost, apiKey) {
47
47
 
48
48
  // Build authorization URL
49
49
  const baseUrl = getApiUrl().replace('/api/v1', ''); // Remove /api/v1 suffix
50
- const authUrl = `${baseUrl}/oauth/authorize?git_host=${encodeURIComponent(gitHost)}&session_id=${sessionId}`;
50
+ const authUrl = `${baseUrl}/oauth/authorize?git_host=${encodeURIComponent(gitHost)}&session_id=${sessionId}&token=${encodeURIComponent(apiKey)}`;
51
51
 
52
52
  logger.info('Opening browser for authentication...');
53
53
  logger.newline();
@@ -90,6 +90,9 @@ async function pollForCompletion(sessionId, apiKey) {
90
90
 
91
91
  const baseUrl = getApiUrl().replace('/api/v1', ''); // Remove /api/v1 suffix
92
92
 
93
+ // Give user time to complete OAuth flow in browser (5 seconds)
94
+ await sleep(5000);
95
+
93
96
  for (let attempt = 0; attempt < maxAttempts; attempt++) {
94
97
  await sleep(pollInterval);
95
98