{"record":{"id":"da3cd5d7779d09c9","repo":"kovidgoyal/kitty","slug":"no-custom-kitten-named-kitten-found","errorCode":null,"errorMessage":"No custom kitten named {kitten} found","messagePattern":"No custom kitten named (.+?) found","errorType":"console","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"kitty/conf/generate.py","lineNumber":739,"sourceCode":"    return '\\n'.join(lines)\n\n\ndef main() -> None:\n    # To use run it as:\n    # kitty +runpy 'from kitty.conf.generate import main; main()' /path/to/kitten/file.py\n    import importlib\n    import sys\n\n    from kittens.runner import path_to_custom_kitten, resolved_kitten\n    from kitty.constants import config_dir\n\n    kitten = sys.argv[-1]\n    if not kitten.endswith('.py'):\n        kitten += '.py'\n    kitten = resolved_kitten(kitten)\n    path = os.path.realpath(path_to_custom_kitten(config_dir, kitten))\n    if not os.path.dirname(path):\n        raise SystemExit(f'No custom kitten named {kitten} found')\n    sys.path.insert(0, os.path.dirname(path))\n    package_name = os.path.basename(os.path.dirname(path))\n    m = importlib.import_module('kitten_options_definition')\n    defn = getattr(m, 'definition')\n    loc = package_name\n    cls, tc = generate_class(defn, loc)\n    with open(os.path.join(os.path.dirname(path), 'kitten_options_types.py'), 'w') as f:\n        f.write(f'{cls}\\n')\n    with open(os.path.join(os.path.dirname(path), 'kitten_options_parse.py'), 'w') as f:\n        f.write(f'{tc}\\n')\n","sourceCodeStart":721,"sourceCodeEnd":750,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kitty/conf/generate.py#L721-L750","documentation":"The conf generator entry point for custom kittens resolves the kitten source under the kitty config dir; if resolved_kitten/path_to_custom_kitten yields no directory, it raises SystemExit saying no custom kitten of that name exists.","triggerScenarios":"Running the options-definitions generator with a kitten name that has no corresponding file/directory in the custom kittens config folder.","commonSituations":"Generating docs/type stubs for a custom kitten that was renamed, not installed in ~/.config/kittens, or invoked from the wrong config dir.","solutions":["Verify the kitten file exists under the custom kittens directory","Pass the correct kitten name (with or without .py consistently)","Set KITTY_CONFIG_DIRECTORY to the right config dir"],"exampleFix":"# before\npython -m kitty.conf.generate my_kitten\n# after\nmkdir -p ~/.config/kittens/my_kitten && python -m kitty.conf.generate my_kitten","handlingStrategy":"validation","validationCode":"import os\nfrom kitty.constants import config_dir\ncandidate = os.path.join(config_dir, 'kittens', kitten_name)  # adjust per path_to_custom_kitten\nexists = os.path.isdir(candidate) or os.path.isfile(candidate + '.py')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify the custom kitten is installed in the config dir before generating docs","Keep kitten names consistent between file system and generator invocation"],"tags":["kitty","custom-kitten","config","file-not-found"],"backgroundTag":"missing-config-file","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}