You're correct that it has to do with adding to your .bashrc. You want to set an alias.

Make sure your code has an appropriate shebang line at the top, ex. #!/usr/bin/python3
Add the following to .bashrc, ex. alias test=python3 /path/to/test.py

From there, you can use sys.argv in your code to handle arguments within the program.
I'm not sure what to search for this.
I am writing a piece of code using python fire to create a command line interface.
python test.py function argument
is there a way to make the shell interpret the following like the command above:
test function argument
Similar to how I can just call jupyter lab and it will open a notebook etc.
I have a feeling this is more to do with setting up my bashrc or similar instead of something I can do in Python.
Command line interface for python module