Skip to Content

Code Execution API & Terminal

Backend and compiled language apps run on the cdbx Code Execution API — a server-side execution service that streams output back to your browser in real time.

How it works

When you click Run (or press ⌘ ↵ / Ctrl ↵), cdbx sends your code to the Code Execution API, which executes it inside an isolated container and streams stdout and stderr back line by line. The output appears in the Output panel on the right side of the editor.

There is no build step — the Code Execution API compiles and executes your code directly.

Supported languages

30 languages, all running the same way — isolated container, no network, streamed output:

Python, Go, JavaScript (Node 20), TypeScript (Bun), Rust, C#, Java, Kotlin, Ruby, C, C++, PHP, Perl, Lua, R, Swift, Scala, Haskell, Elixir, Clojure, Bash, D, Nim, Zig, OCaml, F#, Julia, Dart, Crystal, Groovy.

Execution limits

LimitValue
TimeUp to 5 minutes per run
Memory1 GB
OutputStreamed as it prints, up to 10 MB
NetworkDisabled inside containers
File systemIsolated per run

Each run starts in a clean container — no state carries over between runs.

The Output panel

  • The run line shows the command and how the run ended: ”✓ Exited 0 · 0.8s”, ”✗ Exited 1”, “Stopped”, “Time limit” or “Out of memory”. While it runs, a timer counts up.
  • stdout is everything your program prints; stderr (error output) is in red.
  • Colours and progress lines work like in a terminal: ANSI colour codes show as colours, and print(f"\r{i}%", end="") updates one line in place. Large output stays fast.
  • “Waiting for a free runner…” shows when every runner is busy; your program starts as soon as one is free.
  • Line numbers in an error are links — click “line 13” to jump to that line in the editor.
  • Stop: while a program runs, Run becomes Stop (⌘ .). It ends the program on the server too. Pressing ⌘ ↵ while it runs stops it and runs it again.
  • Clear output (the bin icon) empties the panel.
  • Input: open the Input drawer at the bottom to give your program text to read (stdin). It’s sent each time the program runs.

Multi-file programs

The Code Execution API receives all files in your app. Your entry file (e.g. main.py, main.go) is the execution target. You can split code across multiple files and import them normally — it writes all files to the container before executing.

AI assistance

The AI chat is aware you’re working in a backend context. It will write code for your language, read your files, and fix errors from the Output panel.

When a run fails, a card under the output says what went wrong in one plain sentence and where (“KeyError: ‘dya’ on line 13 of main.py”). Ask AI to fix sends the error to the chat; the AI changes the code and the program runs again by itself, up to three tries. Go to line jumps to the line.

Last updated on