The minimal “lite” image of Debian 8 (Jessie) is an excellent choice for a headless Raspberry Pi. After downloading to the SD card, these notes from Dmytro Bobkov covers the basic initial setup, while wifi setup from the command line is explained here. More details on CLI wifi on Debian in a previous post here.
If there is no screen or keyboard available, the SD card have to be prepared before the initial boot. Mainly to make sure SSH is running, so you can log in. This discussion covers the topic. However, if things are not working at once, a few debug statements can help. E.g., add as needed in the config file (change the IP as needed to your laptop or machine):
echo "$_IP" | nc 192.168.1.100 10100
echo "ssh has started" | nc 192.168.1.100 10100
On the other end, receive the messages by:
while true; do nc -l 192.168.1.100 10100; done
Finally, you might want to add a few extra packages, based on what you want to use the device for. These might come in handy:
apt-get install htop itop atop git tig tree autossh nmap rsync lynx links emacs