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

Function printServerProfiles

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

Source from the content-addressed store, hash-verified

2192};
2193
2194const printServerProfiles = () =>
2195 Effect.gen(function* () {
2196 const store = yield* readCliServerConnectionStore();
2197 if (store.profiles.length === 0) {
2198 console.log("No server profiles configured.");
2199 console.log(`Add one: ${cliPrefix} server add local ${DEFAULT_BASE_URL} --default`);
2200 return;
2201 }
2202
2203 const rows = store.profiles.map((profile) => ({
2204 marker: profile.name === store.defaultProfile ? "*" : " ",
2205 name: profile.name,
2206 kind: profile.connection.kind,
2207 origin: profile.connection.origin,
2208 displayName: profile.connection.displayName,
2209 auth: profile.connection.auth ? "stored-auth" : "env-auth",
2210 }));
2211 const nameWidth = rows.reduce((max, row) => Math.max(max, row.name.length), 4);
2212 const kindWidth = rows.reduce((max, row) => Math.max(max, row.kind.length), 4);
2213
2214 for (const row of rows) {
2215 console.log(
2216 `${row.marker} ${row.name.padEnd(nameWidth)} ${row.kind.padEnd(kindWidth)} ${row.origin} ${row.displayName} ${row.auth}`,
2217 );
2218 }
2219 });
2220
2221const serverAddCommand = Command.make(
2222 "add",

Callers 1

main.tsFile · 0.85

Calls 2

logMethod · 0.80

Tested by

no test coverage detected