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

Function printServerProfiles

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

Source from the content-addressed store, hash-verified

2170};
2171
2172const printServerProfiles = () =>
2173 Effect.gen(function* () {
2174 const store = yield* readCliServerConnectionStore();
2175 if (store.profiles.length === 0) {
2176 console.log("No server profiles configured.");
2177 console.log(`Add one: ${cliPrefix} server add local ${DEFAULT_BASE_URL} --default`);
2178 return;
2179 }
2180
2181 const rows = store.profiles.map((profile) => ({
2182 marker: profile.name === store.defaultProfile ? "*" : " ",
2183 name: profile.name,
2184 kind: profile.connection.kind,
2185 origin: profile.connection.origin,
2186 displayName: profile.connection.displayName,
2187 auth: profile.connection.auth ? "stored-auth" : "env-auth",
2188 }));
2189 const nameWidth = rows.reduce((max, row) => Math.max(max, row.name.length), 4);
2190 const kindWidth = rows.reduce((max, row) => Math.max(max, row.kind.length), 4);
2191
2192 for (const row of rows) {
2193 console.log(
2194 `${row.marker} ${row.name.padEnd(nameWidth)} ${row.kind.padEnd(kindWidth)} ${row.origin} ${row.displayName} ${row.auth}`,
2195 );
2196 }
2197 });
2198
2199const serverAddCommand = Command.make(
2200 "add",

Callers 1

main.tsFile · 0.85

Calls 2

logMethod · 0.80

Tested by

no test coverage detected