The Raspberry Pi Foundation documentation for connecting to WiFi from the command line is here: https://www.raspberrypi.org/documentati ... ess-cli.md
To allow others to cover the basics: what model of RPi? Does it have a built-in wi-fi interface, or have you added a usb dongle? If the latter, do you know it is supported by Raspbian?
For diagnostic purposes, even if it is not your target configuration, have you considered installing the full (desktop) version of Raspbian, thus avoiding the 'chicken and egg' conundrum while initially setting up the system?