@padua/cli 1.8.0 → 1.12.0

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.
Files changed (62) hide show
  1. package/README.md +192 -2
  2. package/dist/commands/doctor/checks.d.ts +30 -0
  3. package/dist/commands/doctor/checks.d.ts.map +1 -0
  4. package/dist/commands/doctor/checks.js +374 -0
  5. package/dist/commands/doctor/checks.js.map +1 -0
  6. package/dist/commands/doctor/index.d.ts +28 -0
  7. package/dist/commands/doctor/index.d.ts.map +1 -0
  8. package/dist/commands/doctor/index.js +168 -0
  9. package/dist/commands/doctor/index.js.map +1 -0
  10. package/dist/commands/doctor/suggestions.d.ts +31 -0
  11. package/dist/commands/doctor/suggestions.d.ts.map +1 -0
  12. package/dist/commands/doctor/suggestions.js +89 -0
  13. package/dist/commands/doctor/suggestions.js.map +1 -0
  14. package/dist/commands/doctor/types.d.ts +55 -0
  15. package/dist/commands/doctor/types.d.ts.map +1 -0
  16. package/dist/commands/doctor/types.js +18 -0
  17. package/dist/commands/doctor/types.js.map +1 -0
  18. package/dist/commands/init/aws-profile.d.ts +1 -1
  19. package/dist/commands/init/aws-profile.d.ts.map +1 -1
  20. package/dist/commands/init/aws-profile.js +146 -31
  21. package/dist/commands/init/aws-profile.js.map +1 -1
  22. package/dist/commands/init/index.d.ts +1 -0
  23. package/dist/commands/init/index.d.ts.map +1 -1
  24. package/dist/commands/init/index.js +134 -2
  25. package/dist/commands/init/index.js.map +1 -1
  26. package/dist/commands/login/codeartifact.d.ts +4 -1
  27. package/dist/commands/login/codeartifact.d.ts.map +1 -1
  28. package/dist/commands/login/codeartifact.js +55 -19
  29. package/dist/commands/login/codeartifact.js.map +1 -1
  30. package/dist/commands/login/index.d.ts.map +1 -1
  31. package/dist/commands/login/index.js +2 -1
  32. package/dist/commands/login/index.js.map +1 -1
  33. package/dist/commands/login/npmrc.d.ts +50 -0
  34. package/dist/commands/login/npmrc.d.ts.map +1 -0
  35. package/dist/commands/login/npmrc.js +168 -0
  36. package/dist/commands/login/npmrc.js.map +1 -0
  37. package/dist/commands/login/types.d.ts +2 -0
  38. package/dist/commands/login/types.d.ts.map +1 -1
  39. package/dist/commands/login/types.js.map +1 -1
  40. package/dist/commands/status/checks.d.ts +1 -1
  41. package/dist/commands/status/checks.d.ts.map +1 -1
  42. package/dist/commands/status/checks.js +22 -6
  43. package/dist/commands/status/checks.js.map +1 -1
  44. package/dist/commands/status/index.d.ts.map +1 -1
  45. package/dist/commands/status/index.js +3 -0
  46. package/dist/commands/status/index.js.map +1 -1
  47. package/dist/commands/status/types.d.ts +2 -0
  48. package/dist/commands/status/types.d.ts.map +1 -1
  49. package/dist/commands/tunnel/aws.d.ts +10 -3
  50. package/dist/commands/tunnel/aws.d.ts.map +1 -1
  51. package/dist/commands/tunnel/aws.js +50 -14
  52. package/dist/commands/tunnel/aws.js.map +1 -1
  53. package/dist/commands/tunnel/rds.d.ts.map +1 -1
  54. package/dist/commands/tunnel/rds.js +14 -4
  55. package/dist/commands/tunnel/rds.js.map +1 -1
  56. package/dist/commands/tunnel/types.d.ts +6 -0
  57. package/dist/commands/tunnel/types.d.ts.map +1 -1
  58. package/dist/commands/tunnel/types.js +30 -1
  59. package/dist/commands/tunnel/types.js.map +1 -1
  60. package/dist/index.js +2 -0
  61. package/dist/index.js.map +1 -1
  62. package/package.json +1 -1
package/README.md CHANGED
@@ -23,6 +23,8 @@ npm install -g @padua/cli
23
23
 
24
24
  ## Quick Start
25
25
 
26
+ > **⚠️ WARNING:** `padua init` will delete your existing `~/.aws/config` file to ensure a clean configuration. A timestamped backup is automatically created at `~/.aws/config.backup.<timestamp>`. Use the `--keep-existing` flag to preserve custom non-Padua profiles.
27
+
26
28
  ```bash
27
29
  # 1. Initialize configuration (discovers SSO accounts automatically)
28
30
  padua init
@@ -33,9 +35,11 @@ padua login
33
35
 
34
36
  The `init` command will:
35
37
  - Check for required prerequisites
38
+ - Detect AWS environment variables and warn if present
36
39
  - Authenticate with AWS SSO
37
40
  - Discover all accounts and roles you have access to
38
- - Create profiles in `~/.aws/config`
41
+ - Create a timestamped backup of `~/.aws/config`
42
+ - Delete and regenerate `~/.aws/config` with discovered profiles
39
43
  - Generate `~/.padua/padua.config.json`
40
44
 
41
45
  ## Features
@@ -46,10 +50,106 @@ The `init` command will:
46
50
  | | Profiles | Interactive AWS profile selection with shell integration |
47
51
  | | CodeArtifact | Automatic npm registry authentication |
48
52
  | | ECR | Docker registry authentication |
49
- | **Config** | Init | Automatic SSO discovery and profile generation |
53
+ | **Config** | Init | Automatic SSO discovery and profile generation with backup |
50
54
  | | Status | Health check for all authentication services |
55
+ | | Doctor | Configuration validation and diagnostics with fuzzy profile matching |
51
56
  | **Tunnel** | RDS | Secure tunnels to RDS/Aurora databases via SSM |
52
57
 
58
+ ## Init Command
59
+
60
+ Interactive configuration wizard that discovers all AWS accounts and roles via SSO, then generates AWS CLI profiles.
61
+
62
+ ### Basic Usage
63
+
64
+ ```bash
65
+ padua init # Standard initialization
66
+ padua init --keep-existing # Preserve custom non-Padua profiles
67
+ padua init --force # Skip confirmation prompts
68
+ ```
69
+
70
+ ### Options
71
+
72
+ | Flag | Description |
73
+ |------|-------------|
74
+ | `--force` | Overwrite existing config without prompting |
75
+ | `--keep-existing` | Preserve non-Padua profiles in ~/.aws/config |
76
+ | `--no-browser` | Don't auto-open browser for SSO authentication |
77
+ | `-v, --verbose` | Show detailed progress information |
78
+ | `--no-color` | Disable colored output |
79
+
80
+ **Note:** `--force` and `--keep-existing` are mutually exclusive.
81
+
82
+ ### What It Does
83
+
84
+ 1. **Prerequisite Check** - Validates required tools are installed (AWS CLI v2, npm, Docker, Session Manager Plugin)
85
+ 2. **Environment Variable Detection** - Warns if AWS environment variables are set that may interfere with SSO
86
+ 3. **SSO Authentication** - Authenticates with AWS SSO or reuses cached token
87
+ 4. **Account Discovery** - Discovers all AWS accounts and roles available via SSO
88
+ 5. **Role Selection** - Prompts user to select which role to use for profiles
89
+ 6. **Backup Creation** - Creates timestamped backup of existing `~/.aws/config`
90
+ 7. **Config Generation** - Deletes old config and generates fresh profiles
91
+ 8. **Profile Preservation** - Optionally merges back custom non-Padua profiles
92
+
93
+ ### Backup Behavior
94
+
95
+ - **Location:** `~/.aws/config.backup.YYYYMMDD-HHMMSS`
96
+ - **Auto-cleanup:** Keeps last 5 backups, removes older ones automatically
97
+ - **Restoration:** `cp ~/.aws/config.backup.* ~/.aws/config`
98
+
99
+ ### Profile Preservation
100
+
101
+ By default, `padua init` deletes **all** existing profiles to ensure a clean state. Use `--keep-existing` to preserve custom profiles:
102
+
103
+ ```bash
104
+ padua init --keep-existing
105
+ ```
106
+
107
+ **How it works:**
108
+ - Identifies Padua-managed profiles by `sso_session = padua` reference
109
+ - Preserves all other profiles (custom configurations)
110
+ - Merges custom profiles back after generating Padua profiles
111
+
112
+ ### Environment Variable Warnings
113
+
114
+ If AWS environment variables are detected, you'll see:
115
+
116
+ ```
117
+ WARNING: AWS environment variables detected
118
+ The following environment variables may interfere with SSO authentication:
119
+ AWS_PROFILE=development
120
+ AWS_DEFAULT_REGION=us-east-1
121
+
122
+ To unset (bash/zsh):
123
+ unset AWS_PROFILE AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN AWS_DEFAULT_REGION
124
+
125
+ Continue anyway? (y/N)
126
+ ```
127
+
128
+ ### Exit Codes
129
+
130
+ | Code | Meaning |
131
+ |------|---------|
132
+ | 0 | Success |
133
+ | 1 | General error or mutually exclusive flags |
134
+ | 2 | Missing required prerequisites |
135
+ | 4 | Config write failed |
136
+
137
+ ### Troubleshooting
138
+
139
+ **"SSO session 'padua' already exists"**
140
+ - Run with `--force` flag to overwrite
141
+
142
+ **Environment variables interfering**
143
+ - Unset AWS variables before running init:
144
+ ```bash
145
+ unset AWS_PROFILE AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN AWS_DEFAULT_REGION
146
+ ```
147
+
148
+ **Lost custom profiles**
149
+ - Check backup: `ls -la ~/.aws/config.backup.*`
150
+ - Restore backup: `cp ~/.aws/config.backup.20260128-143055 ~/.aws/config`
151
+ - Or run `padua init --keep-existing` to preserve custom profiles
152
+
53
153
  ## Login Command
54
154
 
55
155
  Authenticate to AWS SSO, CodeArtifact (npm), and ECR (Docker) with a single command.
@@ -70,6 +170,7 @@ padua login --sso-only # SSO only, skip CodeArtifact and ECR
70
170
  |------|-------------|
71
171
  | `-p, --profile <name>` | AWS SSO profile to use |
72
172
  | `--sso-only` | Only authenticate to SSO |
173
+ | `--local` | Write CodeArtifact config to project `.npmrc` instead of global `~/.npmrc` |
73
174
  | `-v, --verbose` | Show detailed output |
74
175
  | `-q, --quiet` | Suppress non-error output |
75
176
  | `--no-color` | Disable colored output |
@@ -196,6 +297,95 @@ ECR (Docker)
196
297
  | 1 | One or more services have issues |
197
298
  | 2 | Configuration not found |
198
299
 
300
+ ## Doctor Command
301
+
302
+ Validate Padua CLI configuration and diagnose common issues. Helps troubleshoot problems with profiles, authentication, and prerequisites.
303
+
304
+ ### Basic Usage
305
+
306
+ ```bash
307
+ padua doctor # Run all diagnostic checks
308
+ padua doctor --verbose # Show detailed diagnostic information
309
+ ```
310
+
311
+ ### Options
312
+
313
+ | Flag | Description |
314
+ |------|-------------|
315
+ | `--fix` | Attempt to auto-fix common issues (not yet implemented) |
316
+ | `-v, --verbose` | Show detailed diagnostic information |
317
+ | `--no-color` | Disable colored output |
318
+
319
+ ### Diagnostic Checks
320
+
321
+ The doctor command performs comprehensive validation:
322
+
323
+ 1. **Config Validation** - Verifies `~/.padua/padua.config.json` exists and contains valid JSON
324
+ 2. **Config Schema** - Validates field formats (account IDs, regions, domains, repositories)
325
+ 3. **Profile Validation** - Checks if `defaultProfile` exists in `~/.aws/config`, suggests corrections for typos
326
+ 4. **Prerequisites** - Checks AWS CLI, npm, Docker, Session Manager Plugin installation status and versions
327
+ 5. **Authentication** - Validates SSO, CodeArtifact, and ECR authentication status
328
+ 6. **Installation** - Compares current CLI version with latest published version on npm
329
+
330
+ ### Example Output
331
+
332
+ ```
333
+ 🏥 Padua CLI Doctor
334
+
335
+ Config Validation
336
+ [✓] Config file: Found at ~/.padua/padua.config.json
337
+ [✓] Config schema: All fields valid
338
+ [✗] Default profile 'development' not found in ~/.aws/config
339
+ → Did you mean 'paduafg-development'?
340
+
341
+ Prerequisites
342
+ [✓] AWS CLI: Installed (2.15.0)
343
+ [✓] npm: Installed (10.9.2)
344
+ [✓] Docker: Installed (29.1.3)
345
+ [⚠] Session Manager Plugin: Not installed
346
+ → Required for tunneling features. Install: https://docs.aws.amazon.com/...
347
+
348
+ Authentication
349
+ [✓] SSO authentication: Authenticated as user@example.com
350
+ [✓] CodeArtifact authentication: Authenticated (project .npmrc)
351
+ [✓] ECR authentication: Authenticated
352
+
353
+ Installation
354
+ [⚠] CLI version: Current: 1.10.0, Latest: 1.11.0
355
+ → Update with: npm install -g @padua/cli@latest
356
+
357
+ Summary: 1 error, 2 warnings
358
+ ```
359
+
360
+ ### Exit Codes
361
+
362
+ | Code | Meaning |
363
+ |------|---------|
364
+ | 0 | All checks passed |
365
+ | 1 | Issues or warnings found |
366
+ | 2 | Config not found or invalid |
367
+
368
+ ### Use Cases
369
+
370
+ **Troubleshooting login issues:**
371
+ ```bash
372
+ # Check why "padua login" fails
373
+ padua doctor
374
+ ```
375
+
376
+ **Verifying setup after installation:**
377
+ ```bash
378
+ # Ensure all prerequisites are installed
379
+ padua doctor
380
+ ```
381
+
382
+ **Finding profile typos:**
383
+ ```bash
384
+ # Get suggestions for misspelled profile names
385
+ padua doctor
386
+ # Example: Suggests 'paduafg-development' if you typed 'development'
387
+ ```
388
+
199
389
  ## Profile Command
200
390
 
201
391
  Interactive AWS profile selection with shell integration.
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Diagnostic checks for the doctor command
3
+ */
4
+ import { DoctorCheck } from './types';
5
+ import { PaduaConfig } from '../login/types';
6
+ /**
7
+ * Check if config file exists and is valid JSON
8
+ */
9
+ export declare function checkConfigFile(): Promise<DoctorCheck>;
10
+ /**
11
+ * Validate config schema and field formats
12
+ */
13
+ export declare function checkConfigSchema(config: PaduaConfig): Promise<DoctorCheck[]>;
14
+ /**
15
+ * Validate default profile exists in AWS config
16
+ */
17
+ export declare function checkDefaultProfile(config: PaduaConfig): Promise<DoctorCheck>;
18
+ /**
19
+ * Check prerequisites (AWS CLI, npm, Docker, etc.)
20
+ */
21
+ export declare function checkPrerequisitesStatus(): Promise<DoctorCheck[]>;
22
+ /**
23
+ * Check authentication status for all services
24
+ */
25
+ export declare function checkAuthStatus(profile: string, config: PaduaConfig): Promise<DoctorCheck[]>;
26
+ /**
27
+ * Check if CLI version is up to date
28
+ */
29
+ export declare function checkCliVersion(): Promise<DoctorCheck>;
30
+ //# sourceMappingURL=checks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checks.d.ts","sourceRoot":"","sources":["../../../src/commands/doctor/checks.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EACL,WAAW,EAKZ,MAAM,gBAAgB,CAAC;AAQxB;;GAEG;AACH,wBAAsB,eAAe,IAAI,OAAO,CAAC,WAAW,CAAC,CA2B5D;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAyHnF;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,CA8BnF;AAED;;GAEG;AACH,wBAAsB,wBAAwB,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC,CAqBvE;AAED;;GAEG;AACH,wBAAsB,eAAe,CACnC,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,WAAW,GAClB,OAAO,CAAC,WAAW,EAAE,CAAC,CA4DxB;AAED;;GAEG;AACH,wBAAsB,eAAe,IAAI,OAAO,CAAC,WAAW,CAAC,CAqD5D"}
@@ -0,0 +1,374 @@
1
+ "use strict";
2
+ /**
3
+ * Diagnostic checks for the doctor command
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.checkConfigFile = checkConfigFile;
40
+ exports.checkConfigSchema = checkConfigSchema;
41
+ exports.checkDefaultProfile = checkDefaultProfile;
42
+ exports.checkPrerequisitesStatus = checkPrerequisitesStatus;
43
+ exports.checkAuthStatus = checkAuthStatus;
44
+ exports.checkCliVersion = checkCliVersion;
45
+ const fs = __importStar(require("fs"));
46
+ const path = __importStar(require("path"));
47
+ const os = __importStar(require("os"));
48
+ const child_process_1 = require("child_process");
49
+ const types_1 = require("../login/types");
50
+ const aws_config_1 = require("../init/aws-config");
51
+ const prerequisites_1 = require("../init/prerequisites");
52
+ const checks_1 = require("../status/checks");
53
+ const suggestions_1 = require("./suggestions");
54
+ const CONFIG_PATH = path.join(os.homedir(), '.padua', 'padua.config.json');
55
+ /**
56
+ * Check if config file exists and is valid JSON
57
+ */
58
+ async function checkConfigFile() {
59
+ if (!fs.existsSync(CONFIG_PATH)) {
60
+ return {
61
+ name: 'Config file',
62
+ status: 'fail',
63
+ message: 'Config file not found',
64
+ suggestion: 'Run: padua init',
65
+ };
66
+ }
67
+ try {
68
+ const content = fs.readFileSync(CONFIG_PATH, 'utf-8');
69
+ JSON.parse(content);
70
+ return {
71
+ name: 'Config file',
72
+ status: 'pass',
73
+ message: `Found at ${CONFIG_PATH}`,
74
+ };
75
+ }
76
+ catch (error) {
77
+ return {
78
+ name: 'Config file',
79
+ status: 'fail',
80
+ message: 'Config file contains invalid JSON',
81
+ suggestion: 'Fix the JSON syntax or run: padua init',
82
+ };
83
+ }
84
+ }
85
+ /**
86
+ * Validate config schema and field formats
87
+ */
88
+ async function checkConfigSchema(config) {
89
+ const checks = [];
90
+ // Check CodeArtifact config if present
91
+ if (config.codeartifact) {
92
+ const ca = config.codeartifact;
93
+ // Validate domain
94
+ if (!ca.domain || !(0, types_1.isValidDomainName)(ca.domain)) {
95
+ checks.push({
96
+ name: 'CodeArtifact domain',
97
+ status: 'fail',
98
+ message: `Invalid domain: '${ca.domain}'`,
99
+ suggestion: 'Domain must be 1-127 lowercase alphanumeric characters with hyphens',
100
+ });
101
+ }
102
+ else {
103
+ checks.push({
104
+ name: 'CodeArtifact domain',
105
+ status: 'pass',
106
+ message: `Valid: ${ca.domain}`,
107
+ });
108
+ }
109
+ // Validate domain owner
110
+ if (!ca.domainOwner || !(0, types_1.isValidAccountId)(ca.domainOwner)) {
111
+ checks.push({
112
+ name: 'CodeArtifact domain owner',
113
+ status: 'fail',
114
+ message: `Invalid account ID: '${ca.domainOwner}'`,
115
+ suggestion: 'Account ID must be exactly 12 digits',
116
+ });
117
+ }
118
+ else {
119
+ checks.push({
120
+ name: 'CodeArtifact domain owner',
121
+ status: 'pass',
122
+ message: `Valid: ${ca.domainOwner}`,
123
+ });
124
+ }
125
+ // Validate repository
126
+ if (!ca.repository || !(0, types_1.isValidRepositoryName)(ca.repository)) {
127
+ checks.push({
128
+ name: 'CodeArtifact repository',
129
+ status: 'fail',
130
+ message: `Invalid repository: '${ca.repository}'`,
131
+ suggestion: 'Repository must be 1-100 lowercase alphanumeric characters with hyphens',
132
+ });
133
+ }
134
+ else {
135
+ checks.push({
136
+ name: 'CodeArtifact repository',
137
+ status: 'pass',
138
+ message: `Valid: ${ca.repository}`,
139
+ });
140
+ }
141
+ }
142
+ // Check ECR config if present
143
+ if (config.ecr) {
144
+ const ecr = config.ecr;
145
+ // Validate account ID
146
+ if (!ecr.accountId || !(0, types_1.isValidAccountId)(ecr.accountId)) {
147
+ checks.push({
148
+ name: 'ECR account ID',
149
+ status: 'fail',
150
+ message: `Invalid account ID: '${ecr.accountId}'`,
151
+ suggestion: 'Account ID must be exactly 12 digits',
152
+ });
153
+ }
154
+ else {
155
+ checks.push({
156
+ name: 'ECR account ID',
157
+ status: 'pass',
158
+ message: `Valid: ${ecr.accountId}`,
159
+ });
160
+ }
161
+ // Validate region
162
+ if (!ecr.region || !(0, types_1.isValidRegion)(ecr.region)) {
163
+ checks.push({
164
+ name: 'ECR region',
165
+ status: 'fail',
166
+ message: `Invalid region: '${ecr.region}'`,
167
+ suggestion: 'Must be a valid AWS region code (e.g., us-east-1, ap-southeast-2)',
168
+ });
169
+ }
170
+ else {
171
+ checks.push({
172
+ name: 'ECR region',
173
+ status: 'pass',
174
+ message: `Valid: ${ecr.region}`,
175
+ });
176
+ }
177
+ }
178
+ // Check region if present
179
+ if (config.region) {
180
+ if (!(0, types_1.isValidRegion)(config.region)) {
181
+ checks.push({
182
+ name: 'Default region',
183
+ status: 'fail',
184
+ message: `Invalid region: '${config.region}'`,
185
+ suggestion: 'Must be a valid AWS region code',
186
+ });
187
+ }
188
+ else {
189
+ checks.push({
190
+ name: 'Default region',
191
+ status: 'pass',
192
+ message: `Valid: ${config.region}`,
193
+ });
194
+ }
195
+ }
196
+ // If all checks passed and schema is valid
197
+ if (checks.length === 0 || checks.every(c => c.status === 'pass')) {
198
+ return [{
199
+ name: 'Config schema',
200
+ status: 'pass',
201
+ message: 'All fields valid',
202
+ }];
203
+ }
204
+ return checks;
205
+ }
206
+ /**
207
+ * Validate default profile exists in AWS config
208
+ */
209
+ async function checkDefaultProfile(config) {
210
+ if (!config.defaultProfile) {
211
+ return {
212
+ name: 'Default profile',
213
+ status: 'pass',
214
+ message: 'No default profile configured',
215
+ };
216
+ }
217
+ const availableProfiles = (0, aws_config_1.getAWSProfiles)();
218
+ if (availableProfiles.includes(config.defaultProfile)) {
219
+ return {
220
+ name: 'Default profile',
221
+ status: 'pass',
222
+ message: `Profile '${config.defaultProfile}' exists`,
223
+ };
224
+ }
225
+ // Profile not found - suggest alternatives
226
+ const suggestion = (0, suggestions_1.findClosestProfile)(config.defaultProfile, availableProfiles);
227
+ return {
228
+ name: 'Default profile',
229
+ status: 'fail',
230
+ message: `Profile '${config.defaultProfile}' not found in ~/.aws/config`,
231
+ suggestion: suggestion
232
+ ? `Did you mean '${suggestion}'? Update defaultProfile in config or run: padua init`
233
+ : 'Run: padua init to regenerate profiles',
234
+ };
235
+ }
236
+ /**
237
+ * Check prerequisites (AWS CLI, npm, Docker, etc.)
238
+ */
239
+ async function checkPrerequisitesStatus() {
240
+ const result = (0, prerequisites_1.checkPrerequisites)();
241
+ return result.results.map(prereq => {
242
+ if (prereq.installed) {
243
+ return {
244
+ name: prereq.name,
245
+ status: 'pass',
246
+ message: prereq.version ? `Installed (${prereq.version})` : 'Installed',
247
+ };
248
+ }
249
+ return {
250
+ name: prereq.name,
251
+ status: prereq.required ? 'fail' : 'warn',
252
+ message: 'Not installed',
253
+ suggestion: prereq.note
254
+ ? `${prereq.note}. Install: ${prereq.installUrl}`
255
+ : `Install: ${prereq.installUrl}`,
256
+ };
257
+ });
258
+ }
259
+ /**
260
+ * Check authentication status for all services
261
+ */
262
+ async function checkAuthStatus(profile, config) {
263
+ const checks = [];
264
+ // Check SSO
265
+ const ssoStatus = await (0, checks_1.checkSSOStatus)(profile);
266
+ if (ssoStatus.authenticated) {
267
+ checks.push({
268
+ name: 'SSO authentication',
269
+ status: 'pass',
270
+ message: `Authenticated as ${ssoStatus.identity?.sessionName || 'unknown'}`,
271
+ });
272
+ }
273
+ else {
274
+ checks.push({
275
+ name: 'SSO authentication',
276
+ status: 'fail',
277
+ message: ssoStatus.error || 'Not authenticated',
278
+ suggestion: `Run: padua login -p ${profile}`,
279
+ });
280
+ }
281
+ // Check CodeArtifact if configured
282
+ if (config.codeartifact) {
283
+ const caStatus = await (0, checks_1.checkCodeArtifactStatus)(config.codeartifact);
284
+ if (caStatus.authenticated) {
285
+ const location = caStatus.location === 'project' ? 'project .npmrc' : 'global ~/.npmrc';
286
+ checks.push({
287
+ name: 'CodeArtifact authentication',
288
+ status: 'pass',
289
+ message: `Authenticated (${location})`,
290
+ });
291
+ }
292
+ else {
293
+ checks.push({
294
+ name: 'CodeArtifact authentication',
295
+ status: 'fail',
296
+ message: caStatus.error || 'Not authenticated',
297
+ suggestion: `Run: padua login -p ${profile}`,
298
+ });
299
+ }
300
+ }
301
+ // Check ECR if configured
302
+ if (config.ecr) {
303
+ const ecrStatus = await (0, checks_1.checkECRStatus)(config.ecr);
304
+ if (ecrStatus.authenticated) {
305
+ checks.push({
306
+ name: 'ECR authentication',
307
+ status: 'pass',
308
+ message: 'Authenticated',
309
+ });
310
+ }
311
+ else {
312
+ checks.push({
313
+ name: 'ECR authentication',
314
+ status: 'fail',
315
+ message: ecrStatus.error || 'Not authenticated',
316
+ suggestion: `Run: padua login -p ${profile}`,
317
+ });
318
+ }
319
+ }
320
+ return checks;
321
+ }
322
+ /**
323
+ * Check if CLI version is up to date
324
+ */
325
+ async function checkCliVersion() {
326
+ try {
327
+ // Get current version
328
+ const packageJsonPath = path.join(__dirname, '..', '..', '..', 'package.json');
329
+ const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));
330
+ const currentVersion = packageJson.version;
331
+ // Get latest version from npm
332
+ const result = (0, child_process_1.spawnSync)('npm', ['view', '@padua/cli', 'version'], {
333
+ shell: false,
334
+ timeout: 10000,
335
+ stdio: ['pipe', 'pipe', 'pipe'],
336
+ });
337
+ if (result.status !== 0 || result.error) {
338
+ return {
339
+ name: 'CLI version',
340
+ status: 'warn',
341
+ message: `Current: ${currentVersion} (unable to check for updates)`,
342
+ };
343
+ }
344
+ const latestVersion = result.stdout?.toString().trim();
345
+ if (!latestVersion) {
346
+ return {
347
+ name: 'CLI version',
348
+ status: 'warn',
349
+ message: `Current: ${currentVersion} (unable to check for updates)`,
350
+ };
351
+ }
352
+ if (currentVersion === latestVersion) {
353
+ return {
354
+ name: 'CLI version',
355
+ status: 'pass',
356
+ message: `Up to date (${currentVersion})`,
357
+ };
358
+ }
359
+ return {
360
+ name: 'CLI version',
361
+ status: 'warn',
362
+ message: `Current: ${currentVersion}, Latest: ${latestVersion}`,
363
+ suggestion: 'Update with: npm install -g @padua/cli@latest',
364
+ };
365
+ }
366
+ catch (error) {
367
+ return {
368
+ name: 'CLI version',
369
+ status: 'warn',
370
+ message: 'Unable to check version',
371
+ };
372
+ }
373
+ }
374
+ //# sourceMappingURL=checks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checks.js","sourceRoot":"","sources":["../../../src/commands/doctor/checks.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBH,0CA2BC;AAKD,8CAyHC;AAKD,kDA8BC;AAKD,4DAqBC;AAKD,0CA+DC;AAKD,0CAqDC;AA1WD,uCAAyB;AACzB,2CAA6B;AAC7B,uCAAyB;AACzB,iDAA0C;AAE1C,0CAMw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G,MAAM,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC;QAEvD,IAAI,CAAC,aAAa,EAAE,CAAC;YACnB,OAAO;gBACL,IAAI,EAAE,aAAa;gBACnB,MAAM,EAAE,MAAM;gBACd,OAAO,EAAE,YAAY,cAAc,gCAAgC;aACpE,CAAC;QACJ,CAAC;QAED,IAAI,cAAc,KAAK,aAAa,EAAE,CAAC;YACrC,OAAO;gBACL,IAAI,EAAE,aAAa;gBACnB,MAAM,EAAE,MAAM;gBACd,OAAO,EAAE,eAAe,cAAc,GAAG;aAC1C,CAAC;QACJ,CAAC;QAED,OAAO;YACL,IAAI,EAAE,aAAa;YACnB,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,YAAY,cAAc,aAAa,aAAa,EAAE;YAC/D,UAAU,EAAE,+CAA+C;SAC5D,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO;YACL,IAAI,EAAE,aAAa;YACnB,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,yBAAyB;SACnC,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Doctor command - Validate configuration and diagnose issues
3
+ */
4
+ import { Command } from 'commander';
5
+ import { DoctorOptions, DoctorResult, DoctorCheck } from './types';
6
+ /**
7
+ * Doctor command definition
8
+ */
9
+ export declare const doctorCommand: Command;
10
+ /**
11
+ * Main handler for doctor command
12
+ */
13
+ declare function handleDoctor(options: DoctorOptions): Promise<void>;
14
+ /**
15
+ * Display a single check result
16
+ */
17
+ declare function displayCheck(check: DoctorCheck, options: {
18
+ noColor?: boolean;
19
+ verbose?: boolean;
20
+ }): void;
21
+ /**
22
+ * Display summary of all checks
23
+ */
24
+ declare function displaySummary(result: DoctorResult, options: {
25
+ noColor?: boolean;
26
+ }): void;
27
+ export { handleDoctor, displayCheck, displaySummary };
28
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/doctor/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,OAAO,EAAE,aAAa,EAAE,YAAY,EAAiB,WAAW,EAAE,MAAM,SAAS,CAAC;AAUlF;;GAEG;AACH,eAAO,MAAM,aAAa,SAKH,CAAC;AAExB;;GAEG;AACH,iBAAe,YAAY,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAyFjE;AAED;;GAEG;AACH,iBAAS,YAAY,CACnB,KAAK,EAAE,WAAW,EAClB,OAAO,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GAChD,IAAI,CAwCN;AAED;;GAEG;AACH,iBAAS,cAAc,CAAC,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CA4BlF;AAGD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,CAAC"}