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

Function printServerProfiles

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

Source from the content-addressed store, hash-verified

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

Callers 1

main.tsFile · 0.85

Calls 2

logMethod · 0.80

Tested by

no test coverage detected