kovidgoyal/kitty · error · SystemExit
No custom kitten named {kitten} found
Error message
No custom kitten named {kitten} found What it means
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.
Source
Thrown at kitty/conf/generate.py:739
return '\n'.join(lines)
def main() -> None:
# To use run it as:
# kitty +runpy 'from kitty.conf.generate import main; main()' /path/to/kitten/file.py
import importlib
import sys
from kittens.runner import path_to_custom_kitten, resolved_kitten
from kitty.constants import config_dir
kitten = sys.argv[-1]
if not kitten.endswith('.py'):
kitten += '.py'
kitten = resolved_kitten(kitten)
path = os.path.realpath(path_to_custom_kitten(config_dir, kitten))
if not os.path.dirname(path):
raise SystemExit(f'No custom kitten named {kitten} found')
sys.path.insert(0, os.path.dirname(path))
package_name = os.path.basename(os.path.dirname(path))
m = importlib.import_module('kitten_options_definition')
defn = getattr(m, 'definition')
loc = package_name
cls, tc = generate_class(defn, loc)
with open(os.path.join(os.path.dirname(path), 'kitten_options_types.py'), 'w') as f:
f.write(f'{cls}\n')
with open(os.path.join(os.path.dirname(path), 'kitten_options_parse.py'), 'w') as f:
f.write(f'{tc}\n')
View on GitHub (pinned to 6d5d0c4406)
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
Example fix
# before python -m kitty.conf.generate my_kitten # after mkdir -p ~/.config/kittens/my_kitten && python -m kitty.conf.generate my_kitten
Defensive patterns
Strategy: validation
Validate before calling
import os from kitty.constants import config_dir candidate = os.path.join(config_dir, 'kittens', kitten_name) # adjust per path_to_custom_kitten exists = os.path.isdir(candidate) or os.path.isfile(candidate + '.py')
Prevention
- Verify the custom kitten is installed in the config dir before generating docs
- Keep kitten names consistent between file system and generator invocation
When it happens
Trigger: Running the options-definitions generator with a kitten name that has no corresponding file/directory in the custom kittens config folder.
Common situations: Generating docs/type stubs for a custom kitten that was renamed, not installed in ~/.config/kittens, or invoked from the wrong config dir.
Related errors
- Could not find the geninclude file: {val}, ignoring
- Could not find included config file: {val}, ignoring
- The PNG image: %s could not be opened with error: %s
- This should be run as kitten broadcast
- No option named: {k}
AI-assisted analysis of kovidgoyal/kitty@6d5d0c4406 (2026-08-27).
Data as JSON: /api/errors/da3cd5d7779d09c9.
Report an issue: GitHub.