@robinmordasiewicz/f5xc-api-mcp 3.0.0 → 3.0.1

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/README.md CHANGED
@@ -88,8 +88,116 @@ Add to your MCP settings:
88
88
  | `F5XC_API_TOKEN` | For token auth | API token from XC Console |
89
89
  | `F5XC_P12_FILE` | For cert auth | Path to P12 certificate file |
90
90
  | `F5XC_P12_PASSWORD` | For cert auth | Password for P12 certificate |
91
+ | `F5XC_PROFILE` | No | Profile name to use (default: `defaultProfile` from config) |
91
92
  | `LOG_LEVEL` | No | Logging verbosity (debug, info, warn, error) |
92
93
 
94
+ ## Profile-Based Configuration
95
+
96
+ Manage multiple F5XC tenant credentials with named profiles stored in `~/.f5xc/credentials.json`.
97
+
98
+ ### Interactive Setup
99
+
100
+ Run the setup wizard to create profiles with auto-detection of existing environment variables:
101
+
102
+ ```bash
103
+ f5xc-api-mcp --setup
104
+ ```
105
+
106
+ The wizard will:
107
+
108
+ 1. Detect existing `F5XC_API_URL`, `F5XC_API_TOKEN`, `F5XC_P12_FILE`, `F5XC_P12_PASSWORD`
109
+ 2. Offer to create a profile from detected credentials
110
+ 3. Allow manual profile creation if no credentials are detected
111
+ 4. Set a default profile for automatic selection
112
+
113
+ ### Using Profiles
114
+
115
+ ```bash
116
+ # Use default profile
117
+ f5xc-api-mcp
118
+
119
+ # Use specific profile
120
+ F5XC_PROFILE=staging f5xc-api-mcp
121
+
122
+ # Override profile credentials with environment variables
123
+ F5XC_PROFILE=production F5XC_API_TOKEN=temporary-token f5xc-api-mcp
124
+ ```
125
+
126
+ ### Profile Management Commands
127
+
128
+ ```bash
129
+ # List all configured profiles
130
+ f5xc-api-mcp --list-profiles
131
+
132
+ # Display configuration file
133
+ f5xc-api-mcp --show-config
134
+
135
+ # Set default profile
136
+ f5xc-api-mcp --set-default production
137
+
138
+ # Delete a profile
139
+ f5xc-api-mcp --delete-profile staging
140
+
141
+ # Test profile connection
142
+ f5xc-api-mcp --test-profile production
143
+ ```
144
+
145
+ ### Configuration File Format
146
+
147
+ Profiles are stored in `~/.f5xc/credentials.json`:
148
+
149
+ ```json
150
+ {
151
+ "version": "1.0",
152
+ "defaultProfile": "production",
153
+ "profiles": {
154
+ "production": {
155
+ "apiUrl": "https://mytenant.console.ves.volterra.io",
156
+ "apiToken": "your-api-token",
157
+ "metadata": {
158
+ "description": "Production tenant",
159
+ "createdAt": "2025-12-21T10:00:00Z",
160
+ "lastUsedAt": "2025-12-21T15:30:00Z"
161
+ }
162
+ },
163
+ "staging": {
164
+ "apiUrl": "https://staging.console.ves.volterra.io",
165
+ "apiToken": "staging-token",
166
+ "metadata": {
167
+ "description": "Staging environment",
168
+ "createdAt": "2025-12-21T10:05:00Z"
169
+ }
170
+ }
171
+ }
172
+ }
173
+ ```
174
+
175
+ ### Credential Priority
176
+
177
+ Credentials are loaded in this order (highest to lowest priority):
178
+
179
+ 1. **Environment Variables** - `F5XC_API_URL`, `F5XC_API_TOKEN`, etc.
180
+ 2. **Active Profile** - Selected by `F5XC_PROFILE` or `defaultProfile`
181
+ 3. **Documentation Mode** - No credentials (read-only API documentation)
182
+
183
+ Environment variables always override profile settings, enabling temporary overrides.
184
+
185
+ ### Backward Compatibility
186
+
187
+ Existing setups using environment variables continue to work unchanged:
188
+
189
+ ```bash
190
+ export F5XC_API_URL=https://mytenant.console.ves.volterra.io
191
+ export F5XC_API_TOKEN=your-api-token
192
+ f5xc-api-mcp
193
+ ```
194
+
195
+ No changes needed - profiles are optional. Migrate to profiles when ready:
196
+
197
+ ```bash
198
+ f5xc-api-mcp --setup # Auto-detects existing env vars
199
+ ```
200
+
93
201
  ## Dual-Mode Operation
94
202
 
95
203
  ### Documentation Mode (No Authentication)
@@ -6,6 +6,7 @@
6
6
  * - Documentation mode: No credentials required
7
7
  * - Execution mode: API token or P12 certificate authentication
8
8
  */
9
+ import { ConfigManager } from "../config/index.js";
9
10
  /**
10
11
  * Authentication modes supported by the server
11
12
  */
@@ -25,6 +26,7 @@ export declare const AUTH_ENV_VARS: {
25
26
  readonly API_TOKEN: "F5XC_API_TOKEN";
26
27
  readonly P12_FILE: "F5XC_P12_FILE";
27
28
  readonly P12_PASSWORD: "F5XC_P12_PASSWORD";
29
+ readonly PROFILE: "F5XC_PROFILE";
28
30
  };
29
31
  /**
30
32
  * Credential configuration for API access
@@ -65,16 +67,49 @@ export declare function extractTenantFromUrl(url: string): string | null;
65
67
  * Credential Manager
66
68
  *
67
69
  * Manages authentication credentials for F5 Distributed Cloud API.
68
- * Reads configuration from environment variables and provides
69
- * normalized credentials for API access.
70
+ * Supports dual-layer credential loading with priority:
71
+ * 1. Environment variables (highest priority - overrides all)
72
+ * 2. Named profiles from ~/.f5xc/credentials.json
73
+ * 3. No credentials (documentation mode - lowest priority)
70
74
  */
71
75
  export declare class CredentialManager {
72
76
  private credentials;
73
- constructor();
77
+ private activeProfile;
78
+ private configManager;
79
+ constructor(configManager?: ConfigManager);
74
80
  /**
75
81
  * Load credentials from environment variables
76
82
  */
83
+ private loadFromEnvironment;
84
+ /**
85
+ * Load credentials from configuration file
86
+ */
87
+ private loadFromConfigFile;
88
+ /**
89
+ * Select which profile to use based on environment or config
90
+ */
91
+ private selectProfile;
92
+ /**
93
+ * Merge raw credentials from environment and config
94
+ * Environment variables override profile settings
95
+ */
96
+ private mergeCredentials;
97
+ /**
98
+ * Build credentials object from raw credentials
99
+ */
100
+ private buildCredentials;
101
+ /**
102
+ * Load credentials with priority order:
103
+ * 1. Environment variables (highest)
104
+ * 2. Profile from config file
105
+ * 3. No credentials - documentation mode (lowest)
106
+ */
77
107
  private loadCredentials;
108
+ /**
109
+ * Get the active profile name (if any)
110
+ * Returns null if credentials are from environment variables or no profile is active
111
+ */
112
+ getActiveProfile(): string | null;
78
113
  /**
79
114
  * Get the current authentication mode
80
115
  */
@@ -1 +1 @@
1
- {"version":3,"file":"credential-manager.d.ts","sourceRoot":"","sources":["../../src/auth/credential-manager.ts"],"names":[],"m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IA+CxB;;;;;OAKG;IACH,OAAO,CAAC,eAAe;IA0CvB;;;OAGG;IACH,gBAAgB,IAAI,MAAM,GAAG,IAAI;IAIjC;;OAEG;IACH,WAAW,IAAI,QAAQ;IAIvB;;OAEG;IACH,eAAe,IAAI,OAAO;IAI1B;;OAEG;IACH,SAAS,IAAI,MAAM,GAAG,IAAI;IAI1B;;OAEG;IACH,SAAS,IAAI,MAAM,GAAG,IAAI;IAI1B;;OAEG;IACH,QAAQ,IAAI,MAAM,GAAG,IAAI;IAIzB;;OAEG;IACH,iBAAiB,IAAI,MAAM,GAAG,IAAI;IAIlC;;OAEG;IACH,cAAc,IAAI,MAAM,GAAG,IAAI;IAI/B;;OAEG;IACH,cAAc,IAAI,QAAQ,CAAC,WAAW,CAAC;IAIvC;;;OAGG;IACH,MAAM,IAAI,IAAI;CAGf"}
@@ -8,6 +8,7 @@
8
8
  */
9
9
  import { readFileSync } from "fs";
10
10
  import { logger } from "../utils/logging.js";
11
+ import { ConfigManager } from "../config/index.js";
11
12
  /**
12
13
  * Authentication modes supported by the server
13
14
  */
@@ -28,6 +29,7 @@ export const AUTH_ENV_VARS = {
28
29
  API_TOKEN: "F5XC_API_TOKEN",
29
30
  P12_FILE: "F5XC_P12_FILE",
30
31
  P12_PASSWORD: "F5XC_P12_PASSWORD",
32
+ PROFILE: "F5XC_PROFILE",
31
33
  };
32
34
  /**
33
35
  * URL normalization patterns
@@ -86,22 +88,98 @@ export function extractTenantFromUrl(url) {
86
88
  * Credential Manager
87
89
  *
88
90
  * Manages authentication credentials for F5 Distributed Cloud API.
89
- * Reads configuration from environment variables and provides
90
- * normalized credentials for API access.
91
+ * Supports dual-layer credential loading with priority:
92
+ * 1. Environment variables (highest priority - overrides all)
93
+ * 2. Named profiles from ~/.f5xc/credentials.json
94
+ * 3. No credentials (documentation mode - lowest priority)
91
95
  */
92
96
  export class CredentialManager {
93
97
  credentials;
94
- constructor() {
98
+ activeProfile = null;
99
+ configManager;
100
+ constructor(configManager) {
101
+ this.configManager = configManager ?? new ConfigManager();
95
102
  this.credentials = this.loadCredentials();
96
103
  }
97
104
  /**
98
105
  * Load credentials from environment variables
99
106
  */
100
- loadCredentials() {
101
- const apiUrl = process.env[AUTH_ENV_VARS.API_URL];
102
- const token = process.env[AUTH_ENV_VARS.API_TOKEN];
103
- const p12File = process.env[AUTH_ENV_VARS.P12_FILE];
104
- const p12Password = process.env[AUTH_ENV_VARS.P12_PASSWORD];
107
+ loadFromEnvironment() {
108
+ return {
109
+ apiUrl: process.env[AUTH_ENV_VARS.API_URL],
110
+ token: process.env[AUTH_ENV_VARS.API_TOKEN],
111
+ p12File: process.env[AUTH_ENV_VARS.P12_FILE],
112
+ p12Password: process.env[AUTH_ENV_VARS.P12_PASSWORD],
113
+ };
114
+ }
115
+ /**
116
+ * Load credentials from configuration file
117
+ */
118
+ loadFromConfigFile() {
119
+ try {
120
+ const config = this.configManager.readSync();
121
+ if (!config || Object.keys(config.profiles).length === 0) {
122
+ return null;
123
+ }
124
+ const profileName = this.selectProfile(config);
125
+ if (!profileName) {
126
+ return null;
127
+ }
128
+ const profile = config.profiles[profileName];
129
+ if (!profile) {
130
+ return null;
131
+ }
132
+ this.activeProfile = profileName;
133
+ // Touch the profile to update lastUsedAt (async, but don't block)
134
+ this.configManager.touchProfile(profileName).catch(() => {
135
+ // Silently ignore touch errors
136
+ });
137
+ return {
138
+ apiUrl: profile.apiUrl,
139
+ token: profile.apiToken,
140
+ p12File: profile.p12File,
141
+ p12Password: profile.p12Password,
142
+ };
143
+ }
144
+ catch (error) {
145
+ logger.debug("Failed to load credentials from config file", {
146
+ error: error instanceof Error ? error.message : String(error),
147
+ });
148
+ return null;
149
+ }
150
+ }
151
+ /**
152
+ * Select which profile to use based on environment or config
153
+ */
154
+ selectProfile(config) {
155
+ // Check if F5XC_PROFILE is explicitly set
156
+ const envProfile = process.env[AUTH_ENV_VARS.PROFILE];
157
+ if (envProfile && config.profiles[envProfile]) {
158
+ return envProfile;
159
+ }
160
+ // Fall back to default profile if set
161
+ return config.defaultProfile ?? null;
162
+ }
163
+ /**
164
+ * Merge raw credentials from environment and config
165
+ * Environment variables override profile settings
166
+ */
167
+ mergeCredentials(envCreds, profileCreds) {
168
+ return {
169
+ apiUrl: envCreds.apiUrl ?? profileCreds.apiUrl,
170
+ token: envCreds.token ?? profileCreds.token,
171
+ p12File: envCreds.p12File ?? profileCreds.p12File,
172
+ p12Password: envCreds.p12Password ?? profileCreds.p12Password,
173
+ };
174
+ }
175
+ /**
176
+ * Build credentials object from raw credentials
177
+ */
178
+ buildCredentials(rawCreds) {
179
+ const apiUrl = rawCreds.apiUrl;
180
+ const token = rawCreds.token;
181
+ const p12File = rawCreds.p12File;
182
+ const p12Password = rawCreds.p12Password;
105
183
  // Determine authentication mode
106
184
  let mode = AuthMode.NONE;
107
185
  let normalizedUrl = null;
@@ -134,13 +212,6 @@ export class CredentialManager {
134
212
  mode = AuthMode.TOKEN;
135
213
  }
136
214
  }
137
- const tenant = normalizedUrl ? extractTenantFromUrl(normalizedUrl) : null;
138
- logger.info("Credentials loaded", {
139
- mode,
140
- tenant,
141
- hasToken: Boolean(token),
142
- hasP12: Boolean(p12Certificate),
143
- });
144
215
  return {
145
216
  mode,
146
217
  apiUrl: normalizedUrl,
@@ -149,6 +220,57 @@ export class CredentialManager {
149
220
  p12Password: p12Password ?? null,
150
221
  };
151
222
  }
223
+ /**
224
+ * Load credentials with priority order:
225
+ * 1. Environment variables (highest)
226
+ * 2. Profile from config file
227
+ * 3. No credentials - documentation mode (lowest)
228
+ */
229
+ loadCredentials() {
230
+ // Step 1: Try environment variables first (highest priority)
231
+ const envCreds = this.loadFromEnvironment();
232
+ if (envCreds.apiUrl && (envCreds.token || envCreds.p12File)) {
233
+ const credentials = this.buildCredentials(envCreds);
234
+ const tenant = credentials.apiUrl ? extractTenantFromUrl(credentials.apiUrl) : null;
235
+ logger.info("Credentials loaded from environment variables", {
236
+ mode: credentials.mode,
237
+ tenant,
238
+ profile: this.activeProfile,
239
+ });
240
+ return credentials;
241
+ }
242
+ // Step 2: Try config file profile (medium priority)
243
+ const profileCreds = this.loadFromConfigFile();
244
+ if (profileCreds) {
245
+ const merged = this.mergeCredentials(envCreds, profileCreds);
246
+ const credentials = this.buildCredentials(merged);
247
+ if (credentials.mode !== AuthMode.NONE) {
248
+ const tenant = credentials.apiUrl ? extractTenantFromUrl(credentials.apiUrl) : null;
249
+ logger.info("Credentials loaded from config profile", {
250
+ mode: credentials.mode,
251
+ tenant,
252
+ profile: this.activeProfile,
253
+ });
254
+ return credentials;
255
+ }
256
+ }
257
+ // Step 3: No credentials - documentation mode (lowest priority)
258
+ logger.info("No credentials configured - running in documentation mode");
259
+ return {
260
+ mode: AuthMode.NONE,
261
+ apiUrl: null,
262
+ token: null,
263
+ p12Certificate: null,
264
+ p12Password: null,
265
+ };
266
+ }
267
+ /**
268
+ * Get the active profile name (if any)
269
+ * Returns null if credentials are from environment variables or no profile is active
270
+ */
271
+ getActiveProfile() {
272
+ return this.activeProfile;
273
+ }
152
274
  /**
153
275
  * Get the current authentication mode
154
276
  */
@@ -1 +1 @@
1
- {"version":3,"file":"credential-manager.js","sourceRoot":"","sources":["../../src/auth/credential-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C;;GAEG;AACH,MAAM,CAAN,IAAY,QAOX;AAPD,WAAY,QAAQ;IAClB,kDAAkD;IAClD,yBAAa,CAAA;IACb,+BAA+B;IAC/B,2BAAe,CAAA;IACf,4CAA4C;IAC5C,uCAA2B,CAAA;AAC7B,CAAC,EAPW,QAAQ,KAAR,QAAQ,QAOnB;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,OAAO,EAAE,cAAc;IACvB,SAAS,EAAE,gBAAgB;IAC3B,QAAQ,EAAE,eAAe;IACzB,YAAY,EAA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,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;IAChC,CAAC;IAED;;OAEG;IACH,iBAAiB;QACf,OAAO,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC;IACzC,CAAC;IAED;;OAEG;IACH,cAAc;QACZ,OAAO,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC;IACtC,CAAC;IAED;;OAEG;IACH,cAAc;QACZ,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;IAChD,CAAC;IAED;;;OAGG;IACH,MAAM;QACJ,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;IAC5C,CAAC;CACF"}
1
+ {"version":3,"file":"credential-manager.js","sourceRoot":"","sources":["../../src/auth/credential-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGnD;;GAEG;AACH,MAAM,CAAN,IAAY,QAOX;AAPD,WAAY,QAAQ;IAClB,kDAAkD;IAClD,yBAAa,CAAA;IACb,+BAA+B;IAC/B,2BAAe,CAAA;IACf,4CAA4C;IAC5C,uCAA2B,CAAA;AAC7B,CAAC,EAPW,QAAQ,KAAR,QAAQ,QAOnB;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,OAAO,EAAE,cAAc;IACvB,SAAS,EAAE,gBAAgB;IAC3B,QAAQ,EAAE,eAAe;IACzB,YAAY,EAAE,mBAAmB;IACjC,OAAO,EAAE,cAAc;CACf,CAAC;AA6BX;;GAEG;AACH,MAAM,YAAY,GAAG;IACnB,0EAA0E;IAC1E,UAAU,EAAE,oDAAoD;IAChE,qDAAqD;IACrD,YAAY,EAAE,kEAAkE;IAChF,mCAAmC;IACnC,g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,EAAE,CAAC;IAC5C,CAAC;CACF"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * CLI command dispatcher for F5XC API MCP
3
+ */
4
+ /**
5
+ * Parse command-line arguments and execute appropriate action
6
+ */
7
+ export declare function handleCliCommand(args: string[]): Promise<void>;
8
+ /**
9
+ * Show version information
10
+ */
11
+ export declare function showVersion(): void;
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAWH;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA8DpE;AA4CD;;GAEG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAGlC"}
@@ -0,0 +1,110 @@
1
+ /**
2
+ * CLI command dispatcher for F5XC API MCP
3
+ */
4
+ import { runSetupWizard, listProfiles, deleteProfile, setDefaultProfile, showConfig, testProfile, } from "./setup.js";
5
+ /**
6
+ * Parse command-line arguments and execute appropriate action
7
+ */
8
+ export async function handleCliCommand(args) {
9
+ const command = args[0];
10
+ switch (command) {
11
+ case "--setup":
12
+ await runSetupWizard();
13
+ break;
14
+ case "--list-profiles":
15
+ await listProfiles();
16
+ break;
17
+ case "--show-config":
18
+ await showConfig();
19
+ break;
20
+ case "--delete-profile":
21
+ if (!args[1]) {
22
+ console.log("Error: Profile name required\n");
23
+ console.log("Usage: f5xc-api-mcp --delete-profile <name>\n");
24
+ process.exit(1);
25
+ }
26
+ await deleteProfile(args[1]);
27
+ break;
28
+ case "--set-default":
29
+ if (!args[1]) {
30
+ console.log("Error: Profile name required\n");
31
+ console.log("Usage: f5xc-api-mcp --set-default <name>\n");
32
+ process.exit(1);
33
+ }
34
+ await setDefaultProfile(args[1]);
35
+ break;
36
+ case "--test-profile":
37
+ if (!args[1]) {
38
+ console.log("Error: Profile name required\n");
39
+ console.log("Usage: f5xc-api-mcp --test-profile <name>\n");
40
+ process.exit(1);
41
+ }
42
+ await testProfile(args[1]);
43
+ break;
44
+ case "--help":
45
+ case "-h":
46
+ showHelp();
47
+ break;
48
+ case "--version":
49
+ case "-v":
50
+ showVersion();
51
+ break;
52
+ default:
53
+ if (command?.startsWith("-")) {
54
+ console.log(`Unknown command: ${command}\n`);
55
+ showHelp();
56
+ process.exit(1);
57
+ }
58
+ // No recognized CLI command, return false to indicate should start server
59
+ return undefined;
60
+ }
61
+ }
62
+ /**
63
+ * Show help information
64
+ */
65
+ function showHelp() {
66
+ console.log(`
67
+ F5XC API MCP Server - Profile-Based Credential Management
68
+
69
+ USAGE:
70
+ f5xc-api-mcp [COMMAND]
71
+
72
+ COMMANDS:
73
+ --setup Interactive setup wizard to create profiles
74
+ --list-profiles List all configured profiles
75
+ --show-config Display current configuration
76
+ --delete-profile Delete a profile by name
77
+ --set-default Set default profile
78
+ --test-profile Test connection with a profile
79
+ --help, -h Show this help message
80
+ --version, -v Show version information
81
+
82
+ EXAMPLES:
83
+ # Interactive setup with auto-detection
84
+ f5xc-api-mcp --setup
85
+
86
+ # List all profiles
87
+ f5xc-api-mcp --list-profiles
88
+
89
+ # Set staging as default
90
+ f5xc-api-mcp --set-default staging
91
+
92
+ # Test production profile
93
+ f5xc-api-mcp --test-profile production
94
+
95
+ ENVIRONMENT VARIABLES:
96
+ F5XC_PROFILE Select which profile to use
97
+ F5XC_API_URL Override profile API URL
98
+ F5XC_API_TOKEN Override profile API token
99
+
100
+ For more information, visit: https://github.com/robinmordasiewicz/f5xc-api-mcp
101
+ `);
102
+ }
103
+ /**
104
+ * Show version information
105
+ */
106
+ export function showVersion() {
107
+ // Version will be injected by the caller from package.json
108
+ console.log("f5xc-api-mcp");
109
+ }
110
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,cAAc,E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AAI,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC;YACD,MAAM,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;YAC3B,MAAM;QAER,KAAK,QAAQ,CAAC;QACd,KAAK,IAAI;YACP,QAAQ,EAAE,CAAC;YACX,MAAM;QAER,KAAK,WAAW,CAAC;QACjB,KAAK,IAAI;YACP,WAAW,EAAE,CAAC;YACd,MAAM;QAER;YACE,IAAI,OAAO,EAAE,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC7B,OAAO,CAAC,GAAG,CAAC,oBAAoB,OAAO,IAAI,CAAC,CAAC;gBAC7C,QAAQ,EAAE,CAAC;gBACX,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC;YACD,0EAA0E;YAC1E,OAAO,SAAS,CAAC;IACrB,CAAC;AACH,CAAC;AAED;;GAEG;AACH,SAAS,QAAQ;IACf,OAAO,CAAC,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCb,CAAC,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW;IACzB,2DAA2D;IAC3D,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;AAC9B,CAAC"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Interactive CLI setup wizard for F5XC API MCP credentials
3
+ *
4
+ * Features:
5
+ * - Auto-detection of existing environment variables
6
+ * - Interactive profile creation with validation
7
+ * - Profile management (list, delete, set default)
8
+ */
9
+ /**
10
+ * Run the interactive setup wizard
11
+ */
12
+ export declare function runSetupWizard(): Promise<void>;
13
+ /**
14
+ * List all configured profiles
15
+ */
16
+ export declare function listProfiles(): Promise<void>;
17
+ /**
18
+ * Delete a profile
19
+ */
20
+ export declare function deleteProfile(name: string): Promise<void>;
21
+ /**
22
+ * Set default profile
23
+ */
24
+ export declare function setDefaultProfile(name: string): Promise<void>;
25
+ /**
26
+ * Show current configuration
27
+ */
28
+ export declare function showConfig(): Promise<void>;
29
+ /**
30
+ * Test connection with a specific profile
31
+ */
32
+ export declare function testProfile(name: string): Promise<void>;
33
+ //# sourceMappingURL=setup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/cli/setup.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAyOH;;GAEG;AACH,wBAAsB,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CAyCpD;AAED;;GAEG;AACH,wBAAsB,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CAmClD;AAED;;GAEG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAU/D;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAUnE;AAED;;GAEG;AACH,wBAAsB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAehD;AAED;;GAEG;AACH,wBAAsB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAgC7D"}