百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
C

codapi

> 编程语言
开源

交互式代码示例

2.1K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

交互式代码示例

Interactive code examples

Codapi is a lightweight sandbox server for interactive documentation and learning.

With Codapi, you can add interactive code snippets right into your product documentation, online course, or blog post. Codapi is also great for trying out new programming languages, databases, or tools in a safe sandbox environment.

┌───────────────────────────────┐
│ def greet(name):              │
│   print(f"Hello, {name}!")    │
│                               │
│ greet("World")                │
└───────────────────────────────┘
  Run ►  Edit  ✓ Done
┌───────────────────────────────┐
│ Hello, World!                 │
└───────────────────────────────┘

Codapi manages sandboxes (isolated execution environments) and provides an API to execute code in these sandboxes. It also provides a JavaScript widget codapi-js for easier integration.

For an introduction to Codapi, see this post: Interactive code examples for fun and profit.

Installation

To run Codapi locally, follow these steps:

  1. Install Docker (or Podman/OrbStack) for your operating system.
  2. Install the latest Codapi release (change the linux_amd64 part according to your OS):
mkdir ~/codapi && cd ~/codapi
curl -L -o codapi.tar.gz "https://github.com/nalgeon/codapi/releases/latest/download/codapi_0.13.1_linux_amd64.tar.gz"
tar xvzf codapi.tar.gz
rm -f codapi.tar.gz
  1. Build the sample ash sandbox image:
docker build --file sandboxes/ash/Dockerfile --tag codapi/ash:latest sandboxes/ash
  1. Start the server:
./codapi

Usage

See Adding a sandbox to add a sandbox from the registry or create a custom one.

See API to run sandboxed code using the HTTP API.

See codapi-js to embed the JavaScript widget into a web page.

Production

Running in production is a bit more involved. See these guides:

  • Installing Codapi
  • Updating Codapi
  • Deploying to production

Contributing

Contributions are welcome. For anything other than bugfixes, please first open an issue to discuss what you want to change.

Be sure to add or update tests as appropriate.

Support

Codapi is mostly a one-man project, not backed by a VC fund or anything.

If you find Codapi useful, please star it on GitHub and spread the word among your peers. It really helps to move the project forward.

★ Subscribe to stay on top of new features.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Gocode-playgroundinteractive-codeinteractive-snippetsplayground

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言