MCPcopy Index your code
hub / github.com/deepnote/deepnote / createInspectAction

Function createInspectAction

packages/cli/src/commands/inspect.ts:12–35  ·  view source on GitHub ↗
(
  _program: Command
)

Source from the content-addressed store, hash-verified

10}
11
12export function createInspectAction(
13 _program: Command
14): (path: string | undefined, options: InspectOptions) => Promise<void> {
15 return async (path, options) => {
16 try {
17 debug(`Inspecting file: ${path}`)
18 debug(`Options: ${JSON.stringify(options)}`)
19 await inspectDeepnoteFile(path, options)
20 } catch (error) {
21 const message = error instanceof Error ? error.message : String(error)
22 // Use InvalidUsage for file resolution and parse errors (user input), Error for runtime failures
23 const exitCode =
24 error instanceof FileResolutionError || error instanceof ParseError ? ExitCode.InvalidUsage : ExitCode.Error
25 if (options.output === 'json') {
26 outputJson({ success: false, error: message })
27 } else if (options.output === 'toon') {
28 outputToon({ success: false, error: message })
29 } else {
30 logError(message)
31 }
32 process.exit(exitCode)
33 }
34 }
35}
36
37async function inspectDeepnoteFile(path: string | undefined, options: InspectOptions): Promise<void> {
38 const { absolutePath } = await resolvePathToDeepnoteFile(path)

Callers 2

registerCommandsFunction · 0.90
inspect.test.tsFile · 0.90

Calls 4

debugFunction · 0.90
outputJsonFunction · 0.90
outputToonFunction · 0.90
inspectDeepnoteFileFunction · 0.85

Tested by

no test coverage detected