Editor
Edit files with a shell and Python beside them, all in this tab
⏳Loading...
About the Editor
A file open on one side and the thing that runs it on the other. Write a script in the editor and press Run, or Ctrl+Enter, and it is saved and run at the prompt underneath as sh deploy.sh or python report.py, which you can also just type. Whatever it writes appears in the tree beside it, because there is one filesystem here rather than one per panel.
This is the same session as the Command Line tool, not a copy of it. A file made by typing touch notes.md shows up in the tree a moment later; a file saved in the editor can be read by the next cat. If a command rewrites a file you have open and have not typed into, the editor takes the change in rather than sitting on the older of two answers. If you have typed into it, your typing stays and the change is left on disk, which is the trade every editor makes.
What runs here
A shell. Pipes, redirects, &&, variables, arrays, if, for, while, case, functions, heredocs and getopts. Around sixty commands, each downloaded the first time you type it. A script here is a script, not a macro.
Python. Real CPython built for WebAssembly, so a traceback is a traceback and the standard library is the standard library. python a.py runs a file, python on its own opens the prompt, and both see the files in the tree: a script that writes out.csv leaves it where you can open it.
JavaScript. The engine the browser already has, so the language is whatever version it speaks and await works at the top of a file. js build.js runs one. It sees the same tree through an fs object with read, write, list and the rest, and it runs somewhere with no network and no storage: a script here can read the files it was handed and print, and that is the whole list.
The editor itself
CodeMirror, with completion, bracket matching, search on Ctrl+F and colouring for Python, shell, JavaScript, JSON, YAML, XML and Markdown. The language is worked out from the file name, or from a #! line when the name says nothing, so a script called deploy with no suffix is still coloured as one.
Tabs across the top, with a dot on any file that has changes you have not saved. Ctrl+S, or Cmd+S on a Mac, saves the one you are looking at. Undo is per file. The plus button above the tree makes a new file beside whatever is open.
Run appears for a file this session can run, which is Python, shell and JavaScript, and is the same thing as pressing Ctrl+Enter. It saves first, since running the version before the change you just made is a confusing half hour. It goes grey while the prompt is in the middle of something, because a line arriving there would land inside a half-typed loop rather than after it.
Where your files live
In this browser, and nowhere else. They are kept between visits, so closing the tab and coming back tomorrow finds the tree where you left it. There is no account, no server and no upload; what is kept is kept on this machine, and only this page can reach it.
The plain version of that: a file you write here is on the disk of the computer you wrote it on until you remove it. rm removes one at the prompt, and Forget everything under the tree removes all of them and the record of them together. On a shared machine, that button is the thing to reach for.
Files only. Variables, functions and Python’s names last as long as the tab, which is the split every real machine makes: what is in a file is on the disk, and what is in a shell dies with the shell.
The same split decides what happens with two tabs open. One disk, so a file written in the Command Line in another window appears in this tree straight away, and a file removed there disappears from it. Two shells, so each tab keeps its own working directory, variables and Python names. Editors on a real machine work the same way, and so does Forget everything: it empties every window, not the one it was pressed in.
Saving in two windows at once does not cost you either save. Each window keeps the files it changed and they are put together, which covers the case that actually happens, two tabs on different files. A file both windows changed in the same moment is the one thing that has to be decided: this window wins it, and a line under the tree says which file it was. What you have open in a tab here is never at risk either way, because a draft you have not saved is not a file yet.
To take work off this machine, save report.py downloads a file the ordinary way, save on its own takes the whole tree as a zip, and load opens a file picker to bring files back in.
What it is not
There is no npm install and no pip install. This site talks to no other host, which is why the Python runtime is served from here rather than from a CDN, and a package manager is a request to somebody else’s server by definition. What you get is the language and its standard library, which is enough for a surprising amount and is not enough for a project with a dependency list.
There is no git and no preview server. There is also no npm install, no require and no import, for the reason there is no pip: a package manager is a request to somebody else’s server by definition, and this site makes none.
Frequently Asked Questions
What is the Editor tool?
It is a code editor with a file tree on one side and a working shell underneath it, all running in the browser tab. You write a script and press Run, or Ctrl+Enter, and it is saved and run at the prompt below as "sh deploy.sh" or "python report.py", which you are equally free to type yourself. Whatever the script writes appears in the tree, because the editor, the prompt and Python are all looking at one filesystem rather than at three copies of one. It shares that filesystem with the Command Line tool, so a file made at either place is available at the other.
What languages can I actually run?
Three, and all of them are real. The shell is a shell: pipes, redirects, variables, if, for, while, case, functions, heredocs and getopts, with around sixty commands behind them. Python is CPython compiled to WebAssembly, so it is the actual interpreter with the actual standard library, and a traceback is the traceback you would get anywhere else. JavaScript is your browser's own engine, reached with "js build.js", with top-level await and a small fs object for the files. All three read and write the same tree, so a script that produces out.csv leaves it somewhere you can open and look at. What none of them has is a package manager: no pip, no npm, no require and no import, because fetching a package means asking somebody else's server for it.
Are my files uploaded anywhere?
No. Everything runs inside the tab: there is no server behind this page, no account, and no request to any other host. Your files are kept, but they are kept in this browser and nowhere else, so a reload or a visit tomorrow finds them where you left them and nobody else ever sees them. The plain version: a file you write here is on the disk of the computer you wrote it on until you remove it, so on a shared machine use the Forget everything button under the file tree, which deletes every file and the record of them together. "rm" removes one at a time. Only files are kept; variables, functions and Python names go when the tab does. To take work off the machine, "save" downloads a file, "save" on its own downloads the whole tree as a zip, and "load" brings files back in.
Is it safe to run a JavaScript file somebody sent me?
Safer than running it anywhere else, and still not a reason to stop reading it. A script runs in a worker built for that one run and killed afterwards, so it never touches the page, the terminal or the next script. Inside it there is no network and no storage: fetch, XMLHttpRequest, WebSocket, indexedDB and caches are all absent, and so is Worker, which is what stops a script starting a fresh one and getting them back. So it can read the files it was handed and print, and that is the list. Two honest caveats. That list is a list, written down in the source, and a browser that grows a new way out grows it there too. And "the files it was handed" is your whole home directory, so a script can still quietly rewrite or delete your work, exactly as a shell script could. Ctrl+C stops one that will not end.
Can I install a package with pip or npm?
No, and the same answer covers require and import. This site makes no requests to any other host, which is why the Python runtime is served from here rather than from a CDN, and a package manager is a request to somebody else's server by definition. So what you have is each language and what it brings with it: Python's standard library, which is json, re, csv, datetime, itertools, collections, math, decimal, hashlib and the rest of it, and JavaScript's built-ins, which is everything from JSON and Intl to crypto.subtle. That covers a surprising amount of the scripting people actually do. What it does not cover is a project with a dependency list, and this is the wrong tool for one.
What happens if a command changes a file I have open?
If you have not typed into it, the editor takes the change in and shows you the new text, so a sed or a Python script that rewrote the file is visible immediately rather than being the older of two answers on your screen. If you have typed into it, your typing stays and the change is left on disk, because throwing away unsaved work to make room for a command is the one thing no editor is forgiven for. A file that gets deleted keeps its tab, and saving it puts the file back. The same three answers cover a command run in another tab of this site, since both windows are looking at one filesystem.
Can I have the Editor open in two tabs at once?
Yes, and both are looking at the same files rather than at two copies. A file written in one window appears in the other tree straight away, and one deleted disappears from it, with the rules above deciding what happens to anything you have open: a clean tab takes the new text, a tab you have typed into keeps your typing. Each window keeps its own working directory, variables and Python names, because those belong to a shell rather than to a disk. Saving in both at once does not cost you either save: each window keeps the files it changed and the two are put together, which covers two tabs working on different files. A file changed in both windows in the same moment is the one case that has to be decided, and this window wins it, with a line under the tree naming the file so you are not left to find out later. Forget everything empties every window at once.
How do I rename or delete a file?
Right-click it in the tree for Rename and Delete, or use "mv old.py new.py" and "rm old.py" at the prompt, which is the same filesystem either way and so the same result. A rename brings the open tab with it rather than closing it; a delete asks a second time first, and closes whatever tabs were open under it. Folders work the same, and a folder with anything in it says so instead of taking it with it. "mkdir" makes one.
How do I run the file I am editing?
Press Run at the top of the editor, or Ctrl+Enter. It saves the file first and then types the line at the prompt below, so what runs is what is on your screen rather than the version before the change you just made. Run only appears for a file this session can run, which means Python and shell, worked out from the suffix or from a "#!" line when the name says nothing. It goes grey while the prompt is busy, in the middle of a block, or at the Python prompt, because a line arriving in any of those lands somewhere other than where it was meant to. Nothing stops you typing "python report.py" yourself, and the button is only ever typing it for you.