{"record":{"id":"58fbb031f8de0f5e","repo":"laurent22/joplin","slug":"cannot-find-s-58fbb0","errorCode":null,"errorMessage":"Cannot find \"%s\".","messagePattern":"Cannot find \"(.+?)\"\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/app-cli/app/command-cat.ts","lineNumber":25,"sourceCode":"\nclass Command extends BaseCommand {\n\tpublic override usage() {\n\t\treturn 'cat <note>';\n\t}\n\n\tpublic override description() {\n\t\treturn _('Displays the given note.');\n\t}\n\n\tpublic override options() {\n\t\treturn [['-v, --verbose', _('Displays the complete information about note.')]];\n\t}\n\n\tpublic override async action(args: { note: string; options: { verbose?: boolean } }) {\n\t\tconst title = args['note'];\n\n\t\tconst item = await app().loadItem(ModelType.Note, title, { parent: app().currentFolder() });\n\t\tif (!item) throw new Error(_('Cannot find \"%s\".', title));\n\n\t\tlet content = '';\n\n\t\tif (item.encryption_applied) {\n\t\t\tcontent = BaseItem.displayTitle(item);\n\t\t} else {\n\t\t\tcontent = args.options.verbose ? await Note.serialize(item) : await Note.serializeForEdit(item);\n\t\t}\n\n\t\tthis.stdout(content);\n\t\tapp().gui().showConsole();\n\t\tapp().gui().maximizeConsole();\n\t}\n}\n\nmodule.exports = Command;\n","sourceCodeStart":7,"sourceCodeEnd":42,"githubUrl":"https://github.com/laurent22/joplin/blob/2654b33620775080d1d59c552259d41e33dad3d2/packages/app-cli/app/command-cat.ts#L7-L42","documentation":"The 'cat' command loads the target note via app().loadItem scoped to the current notebook; if the result is null it throws 'Cannot find'. The message is i18n-translated.","triggerScenarios":"Running 'cat <note>' where <note> matches no note title or id in the current notebook.","commonSituations":"Typo in the title; note in a different notebook; note not synced; note deleted.","solutions":["Verify the title/id with 'ls'.","Switch notebooks with 'use <notebook>'.","Sync to pull missing notes.","Use the note id if the title is ambiguous."],"exampleFix":"# before\n#   joplin cat \"metting\"   # typo\n# after\n#   joplin cat \"meeting\"","handlingStrategy":"validation","validationCode":"const item = await app().loadItem(ModelType.Note, title, { parent: app().currentFolder() });\nif (!item) {\n  console.error(`Note not found: ${title}`);\n  return;\n}","typeGuard":null,"tryCatchPattern":"try {\n  await command.action(args);\n} catch (e) {\n  if (/Cannot find/.test(e.message)) console.error(e.message);\n}","preventionTips":["Confirm the note title/id with 'ls' before 'cat'.","Ensure the correct notebook is current with 'use'.","Sync before reading recently created remote notes."],"tags":["cli","cat-command","item-lookup","i18n"],"backgroundTag":null,"analyzedSha":"2654b33620775080d1d59c552259d41e33dad3d2","analyzedAt":"2026-08-12T14:26:46.263Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}