Asymptote code may be sent to the
https://asymptote.ualberta.ca server directly from the command
line. The public endpoint is
https://asymptote.ualberta.ca/cli
Send your .asy source as the POST body (for example with
curl --data-binary) and choose the output format with the f
(or outformat) query argument; additional asy command-line
options are passed as further query arguments. A GET to the
endpoint returns the server’s asy -version string.
curl --data-binary 'import venn;' 'https://asymptote.ualberta.ca/cli?f=svg' | display -
curl --data-binary 'import venn;' 'https://asymptote.ualberta.ca/cli?f=pdf' -o venn.pdf
curl --data-binary @/usr/local/share/doc/asymptote/examples/Klein.asy 'https://asymptote.ualberta.ca/cli' -o Klein.html
curl --data-binary 'import teapot;' 'https://asymptote.ualberta.ca/cli?f=v3d' -o teapot.v3d
curl --data-binary 'import teapot;' 'https://asymptote.ualberta.ca/cli?f=pdf&v3d' -o teapot.pdf
curl --data-binary 'import teapot;' 'https://asymptote.ualberta.ca/cli?f=pdf' -o teapot.pdf
curl --data-binary 'import teapot;' 'https://asymptote.ualberta.ca/cli?f=pdf&render=4' -o teapot.pdf
curl --data-binary 'import teapot;' 'https://asymptote.ualberta.ca/cli?f=prc' -o teapot.prc
curl --data-binary 'import teapot;' 'https://asymptote.ualberta.ca/cli?f=pdf&prc' -o teapot.pdf
curl --data-binary 'import teapot;' 'https://asymptote.ualberta.ca/cli?f=pdf&prc&render=4' -o teapot.pdf
The same requests are also accepted over plain HTTP directly on port
10007 (for example
curl --data-binary 'import venn;' 'http://asymptote.ualberta.ca:10007?f=svg').
The HTTPS endpoint above is preferred; the direct port will eventually be discontinued.
The source code for the command-line interface is available at https://github.com/vectorgraphics/asymptote-http-server.