Add shebang and CLI mode check