I finally fixed this. Turns out I was getting bitten by my AutoLogin setup, which doesn't work in CLI mode. I can disable that in LocalSettings.php, run the scripts, then enable it again. Hmm. I wonder if there's any good way to conditionally include lines in LocalSettings.php so it won't include those lines when run by CLI.
joe