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

Function printServerProfiles

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

Source from the content-addressed store, hash-verified

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

Callers 1

main.tsFile · 0.85

Calls 2

logMethod · 0.80

Tested by

no test coverage detected