Galaxy Quest is a 1999 American satirical science fiction comedy film directed by Dean Parisot and written by David Howard and Robert Gordon. It stars Tim Allen, Sigourney Weaver, Alan Rickman, Tony Shalhoub, Sam Rockwell, and Daryl Mitchell. A parody of and homage to science-fiction films and series, especially Star Trek and its fandom, the film depicts the cast of a fictional cult television series, Galaxy Quest, who are drawn into a real interstellar conflict by aliens who think the series is a documentary. Galaxy Quest was a modest box office success and received positive reviews.
https://en.wikipedia.org/wiki/Galaxy_Quest