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

Function printServerProfiles

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

Source from the content-addressed store, hash-verified

2114};
2115
2116const printServerProfiles = () =>
2117 Effect.gen(function* () {
2118 const store = yield* readCliServerConnectionStore();
2119 if (store.profiles.length === 0) {
2120 console.log("No server profiles configured.");
2121 console.log(`Add one: ${cliPrefix} server add local ${DEFAULT_BASE_URL} --default`);
2122 return;
2123 }
2124
2125 const rows = store.profiles.map((profile) => ({
2126 marker: profile.name === store.defaultProfile ? "*" : " ",
2127 name: profile.name,
2128 kind: profile.connection.kind,
2129 origin: profile.connection.origin,
2130 displayName: profile.connection.displayName,
2131 auth: profile.connection.auth ? "stored-auth" : "env-auth",
2132 }));
2133 const nameWidth = rows.reduce((max, row) => Math.max(max, row.name.length), 4);
2134 const kindWidth = rows.reduce((max, row) => Math.max(max, row.kind.length), 4);
2135
2136 for (const row of rows) {
2137 console.log(
2138 `${row.marker} ${row.name.padEnd(nameWidth)} ${row.kind.padEnd(kindWidth)} ${row.origin} ${row.displayName} ${row.auth}`,
2139 );
2140 }
2141 });
2142
2143const serverAddCommand = Command.make(
2144 "add",

Callers 1

main.tsFile · 0.85

Calls 2

logMethod · 0.80

Tested by

no test coverage detected