{"record":{"id":"eaef25822c304454","repo":"kovidgoyal/kitty","slug":"usage-kitty-launch-script-py-arguments-to-be-pa","errorCode":null,"errorMessage":"usage: kitty +launch script.py [arguments to be passed to script.py ...]\\n\\nscript.py will be run with full access to kitty code. If script.py is prefixed with a : it will be searched for in PATH. If script.py is a directory the __main__.py file inside it is run just as with the normal Python interpreter.","messagePattern":"usage: kitty \\+launch script\\.py \\[arguments to be passed to script\\.py \\.\\.\\.\\]\\\\n\\\\nscript\\.py will be run with full access to kitty code\\. If script\\.py is prefixed with a : it will be searched for in PATH\\. If script\\.py is a directory the __main__\\.py file inside it is run just as with the normal Python interpreter\\.","errorType":"console","errorClass":"SystemExit","httpStatus":null,"severity":"warning","filePath":"kitty/entry_points.py","lineNumber":64,"sourceCode":"    os.execvp(kitten_exe(), args)\n\n\ndef open_urls(args: list[str]) -> None:\n    setattr(sys, 'cmdline_args_for_open', True)\n    sys.argv = ['kitty'] + args[1:]\n    from kitty.main import main as kitty_main\n\n    kitty_main()\n\n\ndef launch(args: list[str]) -> None:\n    import runpy\n\n    sys.argv = args[1:]\n    try:\n        exe = args[1]\n    except IndexError:\n        raise SystemExit(\n            'usage: kitty +launch script.py [arguments to be passed to script.py ...]\\n\\n'\n            'script.py will be run with full access to kitty code. If script.py is '\n            'prefixed with a : it will be searched for in PATH. If script.py is a directory '\n            'the __main__.py file inside it is run just as with the normal Python interpreter.'\n        )\n    if exe.startswith(':'):\n        import shutil\n\n        q = shutil.which(exe[1:])\n        if not q:\n            raise SystemExit(f'{exe[1:]} not found in PATH')\n        exe = q\n    if not os.path.exists(exe):\n        raise SystemExit(f'{exe} does not exist')\n    runpy.run_path(exe, run_name='__main__')\n\n\ndef shebang(args: list[str]) -> None:","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kitty/entry_points.py#L46-L82","documentation":"The kitty +launch entry point prints its usage and exits (SystemExit) when no script argument is given (args[1] missing).","triggerScenarios":"Running `kitty +launch` with no script path.","commonSituations":"Empty script variable in wrapper scripts, or misunderstanding that +launch requires an explicit script path. A leading ':' searches PATH; directories run their __main__.py.","solutions":["Pass the script: kitty +launch script.py","Use :name form to resolve from PATH","Verify the script variable is set in wrapper scripts"],"exampleFix":"# before\nkitty +launch\n# after\nkitty +launch :my-kitty-script arg1","handlingStrategy":"validation","validationCode":"import sys\nif len(sys.argv) < 2 or not sys.argv[1]:\n    sys.exit('usage: kitty +launch script.py [args ...]')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pass the script path explicitly","Remember ':' means PATH lookup, directories run __main__.py"],"tags":["kitty","cli","usage","launch"],"backgroundTag":"missing-cli-argument","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}