I enter an image and in the suggestions bar under the image, one of the suggestions is "Edge detect". I click on it and a nice cell with all the options comes up. How do I get the code for all of what Mathematica returns? Clicking "Done" merely returns the value of the variables on the sliders.
After you get the image (or the data) the way you want it, choose the "roll up" icon and it writes the Mathematica code for you.
The roll-up icon is the little squiggle just to the right of the word "more". If you want to roll your own, you can do it easily using