Seperate your code into a new structure matching the following:
cmd
`- todo
lib
Where lib
contains a package called todo
which will contain your librairy code and cmd/todo
contains your cli implementation.
Create a new folder cmd/todod
where you can put a net/http
based server that will serve up a static web application which will interact with a http based JSON API that you will write within cmd/todod
.