diff --git a/asahi_firmware/update.py b/asahi_firmware/update.py
index 8d4c480..7d89353 100644
--- a/asahi_firmware/update.py
+++ b/asahi_firmware/update.py
@@ -30,7 +30,7 @@ def update_firmware(source, dest, manifest):
 
     pkg.save_manifest(manifest)
 
-if __name__ == "__main__":
+def main():
     import argparse
     import logging
     logging.basicConfig()
@@ -46,3 +46,7 @@ if __name__ == "__main__":
     args = parser.parse_args()
 
     update_firmware(args.source, args.dest, args.manifest)
+
+if __name__ == "__main__":
+   main()
+
diff --git a/setup.py b/setup.py
index 45ada19..1b371ba 100644
--- a/setup.py
+++ b/setup.py
@@ -9,4 +9,5 @@ setup(name='asahi_firmware',
       author_email='marcan@marcan.st',
       url='https://github.com/AsahiLinux/asahi-installer/',
       packages=['asahi_firmware'],
+      entry_points={"console_scripts": ["asahi-fwextract = asahi_firmware.update:main"]}
      )
