For cheap, there are plenty of options: the San Francisco public library has many branches, is clean, quiet, and does not restrict what protocols you use on their wifi. (e.g., ssh is allowed) If you're willing to pay for a coffee, the Capital One 360 Café at 101 Post St also has wifi with unrestricted protocols, as well as any Philz coffee location.
For something that resembles an office, try NextSpace, which is $25 for a day-pass, at 28 2nd Street near Market Street.
Definitely stop by Ritual Roasters on Valencia St for an authentic SF coffee-shop experience. [Don't count on a power outlet, though!]