{"record":{"id":"f5932ee75d258931","repo":"kovidgoyal/kitty","slug":"this-should-be-run-as-kitten-transfer","errorCode":null,"errorMessage":"This should be run as kitten transfer","messagePattern":"This should be run as kitten transfer","errorType":"console","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"kittens/transfer/main.py","lineNumber":124,"sourceCode":"\n\n--confirm-paths -c\ntype=bool-set\nBefore actually transferring files, show a mapping of local file names to remote\nfile names and ask for confirmation.\n\n\n--transmit-deltas -x\ntype=bool-set\nIf a file on the receiving side already exists, use the rsync algorithm to\nupdate it to match the file on the sending side, potentially saving lots of\nbandwidth and also automatically resuming partial transfers. Note that this will\nactually degrade performance on fast links or with small files, so use with care.\n\"\"\"\n\n\ndef main(args: list[str]) -> None:\n    raise SystemExit('This should be run as kitten transfer')\n\n\nif __name__ == '__main__':\n    main(sys.argv)\nelif __name__ == '__doc__':\n    from kitty.simple_cli_definitions import CompletionSpec\n\n    cd = sys.cli_docs  # type: ignore\n    cd['usage'] = usage\n    cd['options'] = option_text\n    cd['help_text'] = help_text\n    cd['short_desc'] = 'Transfer files easily over the TTY device'\n    cd['args_completion'] = CompletionSpec.from_string('type:file group:\"Files\"')\n","sourceCodeStart":106,"sourceCodeEnd":138,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kittens/transfer/main.py#L106-L138","documentation":"The transfer kitten's main() unconditionally raises SystemExit('This should be run as kitten transfer'). Like other kittens, the module's real entry points are wired up by kitty's kitten runner (see the '__doc__'/CompletionSpec branch); the __main__ branch is only a guard telling you to use the proper launcher.","triggerScenarios":"Executing kittens/transfer/main.py with python directly, or importing it and calling main(). Correct usage is `kitten transfer ...` (file transfer between machines, optionally with resume/compression) inside kitty.","commonSituations":"Trying to script transfers by running the kitten file standalone; IDE/debugger run configurations on the file; copy-pasting the module into another project expecting it to be self-contained.","solutions":["Use `kitten transfer [options] src dest` from within kitty (see `kitten transfer --help` for hosts, resume, compression options).","For programmatic use, invoke via subprocess `['kitten', 'transfer', ...]` rather than importing main().","In tests, target the transfer module's helper functions, never main()."],"exampleFix":"# before\npython kittens/transfer/main.py  # SystemExit: This should be run as kitten transfer\n\n# after\nkitten transfer --compress host:/remote/file local_copy","handlingStrategy":"fallback","validationCode":"import shutil, subprocess\n\ndef transfer(src: str, dst: str, *opts: str) -> int:\n    if shutil.which('kitten'):\n        return subprocess.call(['kitten', 'transfer', *opts, src, dst])\n    return subprocess.call(['scp', src, dst])  # fallback outside kitty","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always invoke `kitten transfer` via the kitty binary, not by importing the module.","Wrap kitten-transfer usage with an scp/rsync fallback for non-kitty environments.","Read `kitten transfer --help` for supported flags instead of guessing options."],"tags":["kitty","transfer","kitten","system-exit","standalone-execution"],"backgroundTag":"must-run-via-parent-runner","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}