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

Function printServerProfiles

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

Source from the content-addressed store, hash-verified

2254};
2255
2256const printServerProfiles = () =>
2257 Effect.gen(function* () {
2258 const store = yield* readCliServerConnectionStore();
2259 if (store.profiles.length === 0) {
2260 console.log("No server profiles configured.");
2261 console.log(`Add one: ${cliPrefix} server add local ${DEFAULT_BASE_URL} --default`);
2262 return;
2263 }
2264
2265 const rows = store.profiles.map((profile) => ({
2266 marker: profile.name === store.defaultProfile ? "*" : " ",
2267 name: profile.name,
2268 kind: profile.connection.kind,
2269 origin: profile.connection.origin,
2270 displayName: profile.connection.displayName,
2271 auth: profile.connection.auth ? "stored-auth" : "env-auth",
2272 headers: profile.connection.headers
2273 ? `${Object.keys(profile.connection.headers).length} header-env`
2274 : "no-headers",
2275 }));
2276 const nameWidth = rows.reduce((max, row) => Math.max(max, row.name.length), 4);
2277 const kindWidth = rows.reduce((max, row) => Math.max(max, row.kind.length), 4);
2278
2279 for (const row of rows) {
2280 console.log(
2281 `${row.marker} ${row.name.padEnd(nameWidth)} ${row.kind.padEnd(kindWidth)} ${row.origin} ${row.displayName} ${row.auth} ${row.headers}`,
2282 );
2283 }
2284 });
2285
2286const serverAddCommand = Command.make(
2287 "add",

Callers 1

main.tsFile · 0.85

Calls 2

logMethod · 0.80

Tested by

no test coverage detected