@startanaicompany/cli 1.4.12 → 1.4.13

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/CLAUDE.md CHANGED
@@ -493,7 +493,7 @@ The wrapper API expects Git repositories to be hosted on the StartAnAiCompany Gi
493
493
  - During registration, Gitea username can be auto-detected or manually provided
494
494
  - Applications reference repositories in the format: `git@git.startanaicompany.com:user/repo.git`
495
495
 
496
- ## Current Status - Version 1.4.12
496
+ ## Current Status - Version 1.4.13
497
497
 
498
498
  ### Completed Features
499
499
 
@@ -706,4 +706,4 @@ Before publishing to npm:
706
706
  - `dotenv` - Environment variables
707
707
  - `open` - Open browser for OAuth (v8.4.2 for compatibility with chalk v4)
708
708
 
709
- **Version:** 1.4.12 (current)
709
+ **Version:** 1.4.13 (current)
File without changes
package/PUBLISHING.md CHANGED
File without changes
package/README.md CHANGED
File without changes
File without changes
package/bin/saac.js CHANGED
@@ -117,7 +117,6 @@ program
117
117
  // Required options
118
118
  .option('-s, --subdomain <subdomain>', 'Subdomain')
119
119
  .option('-r, --repository <url>', 'Git repository URL (SSH format)')
120
- .option('-t, --git-token <token>', 'Git API token')
121
120
  // Basic options
122
121
  .option('-b, --branch <branch>', 'Git branch', 'master')
123
122
  .option('-d, --domain-suffix <suffix>', 'Domain suffix', 'startanaicompany.com')
File without changes
package/git_auth.md CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@startanaicompany/cli",
3
- "version": "1.4.12",
3
+ "version": "1.4.13",
4
4
  "description": "Official CLI for StartAnAiCompany.com - Deploy AI recruitment sites with ease",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -29,7 +29,6 @@ async function create(name, options) {
29
29
  logger.info('Required options:');
30
30
  logger.log(' -s, --subdomain <subdomain> Subdomain for your app');
31
31
  logger.log(' -r, --repository <url> Git repository URL (SSH format)');
32
- logger.log(' -t, --git-token <token> Git API token (optional if OAuth connected)');
33
32
  logger.newline();
34
33
  logger.info('Optional options:');
35
34
  logger.log(' -b, --branch <branch> Git branch (default: master)');
@@ -51,9 +50,9 @@ async function create(name, options) {
51
50
  logger.log(' --env <KEY=VALUE> Environment variable (can be used multiple times)');
52
51
  logger.newline();
53
52
  logger.info('Example:');
54
- logger.log(' saac create my-app -s myapp -r git@git.startanaicompany.com:user/repo.git -t abc123');
55
- logger.log(' saac create api -s api -r git@git... -t abc123 --build-pack nixpacks --port 8080');
56
- logger.log(' saac create web -s web -r git@git... -t abc123 --health-check --pre-deploy-cmd "npm run migrate"');
53
+ logger.log(' saac create my-app -s myapp -r git@git.startanaicompany.com:user/repo.git');
54
+ logger.log(' saac create api -s api -r git@git... --build-pack nixpacks --port 8080');
55
+ logger.log(' saac create web -s web -r git@git... --health-check --pre-deploy-cmd "npm run migrate"');
57
56
  process.exit(1);
58
57
  }
59
58
 
@@ -62,7 +61,8 @@ async function create(name, options) {
62
61
  logger.newline();
63
62
  logger.info('Example:');
64
63
  logger.log(` saac create ${name} -s myapp -r git@git.startanaicompany.com:user/repo.git`);
65
- logger.log(` saac create ${name} -s myapp -r git@git... -t your_token # With manual token`);
64
+ logger.newline();
65
+ logger.info('Note: Git OAuth connection required. Connect with: saac git connect');
66
66
  process.exit(1);
67
67
  }
68
68
 
@@ -77,36 +77,16 @@ async function create(name, options) {
77
77
  if (connection) {
78
78
  logger.success(`Using connected account: ${connection.gitUsername}@${connection.gitHost}`);
79
79
  logger.newline();
80
- } else if (!options.gitToken) {
81
- // No OAuth connection AND no manual token provided
82
- logger.warn(`Git account not connected for ${gitHost}`);
80
+ } else {
81
+ // No OAuth connection - must connect
82
+ logger.error(`Git account not connected for ${gitHost}`);
83
83
  logger.newline();
84
-
85
- const { shouldConnect } = await inquirer.prompt([
86
- {
87
- type: 'confirm',
88
- name: 'shouldConnect',
89
- message: 'Would you like to connect now?',
90
- default: true,
91
- },
92
- ]);
93
-
94
- if (!shouldConnect) {
95
- logger.newline();
96
- logger.error('Cannot create application without Git authentication');
97
- logger.newline();
98
- logger.info('Options:');
99
- logger.log(' 1. Connect Git account: saac git connect');
100
- logger.log(' 2. Provide token: saac create ... --git-token <token>');
101
- process.exit(1);
102
- }
103
-
104
- // Initiate OAuth flow
105
- await oauth.connectGitAccount(gitHost, user.sessionToken || user.apiKey);
106
-
84
+ logger.info('Git OAuth connection is required to create applications');
107
85
  logger.newline();
108
- logger.section('Continuing with application creation');
86
+ logger.info('Connect now:');
87
+ logger.log(' saac git connect');
109
88
  logger.newline();
89
+ process.exit(1);
110
90
  }
111
91
 
112
92
  // Build application payload
@@ -118,10 +98,8 @@ async function create(name, options) {
118
98
  git_branch: options.branch || 'master',
119
99
  };
120
100
 
121
- // Only include git_api_token if provided (OAuth will be used if available)
122
- if (options.gitToken) {
123
- appData.git_api_token = options.gitToken;
124
- }
101
+ // OAuth tokens are retrieved from database by wrapper
102
+ // No manual git_api_token field needed
125
103
 
126
104
  // Optional: Port configuration
127
105
  if (options.port) {
@@ -304,9 +282,17 @@ async function create(name, options) {
304
282
  logger.error('Validation failed');
305
283
  if (data.details) {
306
284
  logger.newline();
307
- Object.entries(data.details).forEach(([field, message]) => {
308
- logger.log(` ${logger.chalk.yellow(field)}: ${message}`);
309
- });
285
+ // Backend sends details as array: [{field, message, type}, ...]
286
+ if (Array.isArray(data.details)) {
287
+ data.details.forEach((detail) => {
288
+ logger.log(` ${logger.chalk.yellow(detail.field)}: ${detail.message}`);
289
+ });
290
+ } else {
291
+ // Fallback for object format: {field: message, ...}
292
+ Object.entries(data.details).forEach(([field, message]) => {
293
+ logger.log(` ${logger.chalk.yellow(field)}: ${message}`);
294
+ });
295
+ }
310
296
  } else {
311
297
  logger.log(` ${data.message || data.error}`);
312
298
  }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -259,9 +259,17 @@ async function update(options) {
259
259
  logger.error('Validation failed');
260
260
  if (data.details) {
261
261
  logger.newline();
262
- Object.entries(data.details).forEach(([field, message]) => {
263
- logger.log(` ${logger.chalk.yellow(field)}: ${message}`);
264
- });
262
+ // Backend sends details as array: [{field, message, type}, ...]
263
+ if (Array.isArray(data.details)) {
264
+ data.details.forEach((detail) => {
265
+ logger.log(` ${logger.chalk.yellow(detail.field)}: ${detail.message}`);
266
+ });
267
+ } else {
268
+ // Fallback for object format: {field: message, ...}
269
+ Object.entries(data.details).forEach(([field, message]) => {
270
+ logger.log(` ${logger.chalk.yellow(field)}: ${message}`);
271
+ });
272
+ }
265
273
  } else {
266
274
  logger.log(` ${data.message || data.error}`);
267
275
  }
File without changes
File without changes
package/src/lib/api.js CHANGED
File without changes
package/src/lib/config.js CHANGED
File without changes
package/src/lib/logger.js CHANGED
File without changes
package/src/lib/oauth.js CHANGED
File without changes
File without changes