MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / printServerProfiles

Function printServerProfiles

apps/cli/src/main.ts:2243–2271  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2241};
2242
2243const printServerProfiles = () =>
2244 Effect.gen(function* () {
2245 const store = yield* readCliServerConnectionStore();
2246 if (store.profiles.length === 0) {
2247 console.log("No server profiles configured.");
2248 console.log(`Add one: ${cliPrefix} server add local ${DEFAULT_BASE_URL} --default`);
2249 return;
2250 }
2251
2252 const rows = store.profiles.map((profile) => ({
2253 marker: profile.name === store.defaultProfile ? "*" : " ",
2254 name: profile.name,
2255 kind: profile.connection.kind,
2256 origin: profile.connection.origin,
2257 displayName: profile.connection.displayName,
2258 auth: profile.connection.auth ? "stored-auth" : "env-auth",
2259 headers: profile.connection.headers
2260 ? `${Object.keys(profile.connection.headers).length} header-env`
2261 : "no-headers",
2262 }));
2263 const nameWidth = rows.reduce((max, row) => Math.max(max, row.name.length), 4);
2264 const kindWidth = rows.reduce((max, row) => Math.max(max, row.kind.length), 4);
2265
2266 for (const row of rows) {
2267 console.log(
2268 `${row.marker} ${row.name.padEnd(nameWidth)} ${row.kind.padEnd(kindWidth)} ${row.origin} ${row.displayName} ${row.auth} ${row.headers}`,
2269 );
2270 }
2271 });
2272
2273const serverAddCommand = Command.make(
2274 "add",

Callers 1

main.tsFile · 0.85

Calls 2

logMethod · 0.80

Tested by

no test coverage detected