Question: Let $S$ be a smooth cubic surface defined by $f\in \mathbb Q[x,y,z,w]$. Is there an algorithm to write down the 27 lines on $S$? Or at least find a field extension of $\mathbb Q$ over which these lines are defined?

Answer: 
This work from the Mainz Algebraic Geometry Group may help:

> 
> Duco van Straten and Oliver Labs. *A Visual Introduction to Cubic Surfaces Using the Computer Software Spicy*. Springer Berlin Heidelberg, 2003.
>    
> 
>  Short (12-page) 2001 Dagstuhl article: [PDF download link](http://www.oliverlabs.net/data/dagstuhl_proceedings_2001_10_OliverLabs.pdf).
> 
> 
> 

---

![DagstuhlFig6](https://i.stack.imgur.com/g7BIZ.png)

---

Here is a little snippet from p.6 (of their Dagstuhl article).
They take as input six points $\{P\_1,\ldots,P\_6\} \subset \mathbb{P}^2$
in the plane in general position:

---

![CompAlgPart](https://i.stack.imgur.com/2LSW4.png)

---
Here is yet another place to look for an algorithm: you can find a description of how to compute homogeneous equations for the Plücker coordinates of the lines on a cubic surface in the Macaulay 2 tutorial at

<http://www.math.uiuc.edu/Macaulay2/doc/Macaulay2-1.6/share/doc/Macaulay2/Macaulay2Doc/html/___Tutorial_co_sp__Fano_spvarieties.html>.

What you will find there is essentially is the same procedure as in Jim Carlson's Sage code mentioned in the comments above, but perhaps it is a bit easier to read. The tutorial also discusses the general problem of computing equations for the Fano variety (scheme) of a projective variety.