MCPcopy Index your code
hub / github.com/cameri/nostream / runConfigGet

Function runConfigGet

src/cli/commands/config.ts:99–120  ·  view source on GitHub ↗
(path: string, options: { json?: boolean } = {})

Source from the content-addressed store, hash-verified

97}
98
99export const runConfigGet = async (path: string, options: { json?: boolean } = {}): Promise<number> => {
100 const settings = loadMergedSettings() as unknown as Record<string, unknown>
101 const value = getByPath(settings, path)
102
103 if (value === undefined) {
104 if (options.json) {
105 process.stderr.write(`${JSON.stringify({ error: { message: `Path not found: ${path}`, code: 1 } })}\n`)
106 return 1
107 }
108
109 logError(`Path not found: ${path}`)
110 return 1
111 }
112
113 if (options.json) {
114 logInfo(toJson(value))
115 return 0
116 }
117
118 logInfo(serialize(value))
119 return 0
120}
121
122export const runConfigSet = async (
123 path: string,

Callers 2

index.tsFile · 0.90
runConfigureMenuFunction · 0.90

Calls 6

loadMergedSettingsFunction · 0.90
getByPathFunction · 0.90
logErrorFunction · 0.90
logInfoFunction · 0.90
toJsonFunction · 0.85
serializeFunction · 0.85

Tested by

no test coverage detected