Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Lapis Console

An interactive console for the Lapis web framework.

-- app.moon
lapis = require "lapis"
console = require "lapis.console"

class extends lapis.Application
  "/console": console.make!
$ lapis server development

Hit http://localhost:8080/console



Each command executes on the server. The print function has been overwritten to print to the browser. It has also been enhanced, you can print tables and get an interactive version that you can open and close in the browser. Just click on the bold { ... } to open the table up.

Any SQL queries that take place when running the code you submit will also be captured and printed as part of the result.

The input field is a full multi-line text editor. You can write an entire program in it.

The code that runs is not restricted in any way. If you run while true it will run forever. If someone malicious gets access to it then they can do damage to you system.

The console is only accessible in the "development" environment. It will return a 404 if accessed in any other environment. You can bypass this protection by passing {env = "all"} as the first argument of make_console.


Uses Tup, the build system.

$ tup init
$ tup upd

On UNIX or Linux systems, you might need to remove the .lua source files first to get tup to build properly:

$ find . -name "*.lua" -exec rm {} \;


Author: Leaf Corcoran (leafo) (@moonscript)
License: MIT


Lapis Console includes the following libraries:

jQuery v1.9.1 | (c) 2005, 2012 jQuery Foundation, Inc. |
CodeMirror 3.1 Copyright (C) 2013 by Marijn Haverbeke <>