SuperAPI AI Directory

code-executor

Coding & development

View repository

Updated 10-15 17:26

About this skill

Code Executor 🔥

INFINITE POWER. The bot can write and execute code to solve any problem.

What Does It Do?

If the bot needs to do something it doesn't have a skill for:

  1. It writes the code needed
  2. It runs it in a sandbox
  3. It returns the result

Commands

# Ejecutar código directamente
run python "print('Hello World')"
run js "console.log(2+2)"
run bash "ls -la"
Run file

run ~/script.py execute ~/automation.js

The bot decides what code to write

solve "calculate the factorial of 100" compute "generate 10 prime numbers"


## Ejemplo Real

User: calculate how many days are left until my birthday (March 15)

Bot: ⚡ I need to calculate this...

 📝 Código generado:
 ```python
 from datetime import date
 
 today = date.today()
 birthday = date(today.year, 3, 15)
 
 if birthday < today:
     birthday = date(today.year + 1, 3, 15)
 
 days = (birthday - today).days
 print(f"Faltan {days} días para tu cumpleaños")
 ```
 
 ⚡ Ejecutando...
 
 ✅ Resultado:
 Faltan 40 días para tu cumpleaños (15 de marzo, 2026)

## Resolución de Problemas

User: I need to rename 500 files by adding the date

Bot: ⚡ Generating script...

 ```python
 import os
 from datetime import datetime
 
 folder = "/ruta/a/archivos"
 date_str = datetime.now().strftime("%Y%m%d")
 
 for filename in os.listdir(folder):
     name, ext = os.path.splitext(filename)
     new_name = f"{date_str}_{name}{ext}"
     os.rename(
         os.path.join(folder, filename),
         os.path.join(folder, new_name)
     )
     print(f"Renamed: {filename} -> {new_name}")
 ```
 
 ⚠️ Este script renombrará 500 archivos.
 ¿Ejecutar? [Sí] [Ver preview] [Cancelar]

## Lenguajes Soportados

| Lenguaje | Runtime |
|----------|---------|
| Python | python3 |
| JavaScript | node |
| TypeScript | ts-node |
| Bash | bash/sh |
| SQL | sqlite3 |

## Modo Interactivo

User: open a Python REPL

Bot: ⚡ Python REPL started:

 >>> 
 

User: import math; math.pi

Bot: >>> import math; math.pi 3.141592653589793

User: exit

Bot: ⚡ REPL closed


## Instalación de Dependencias

User: I need to use pandas to analyze this CSV

Bot: ⚡ pandas is not installed

 ¿Instalar pandas? [Sí] [No]

User: yes

Bot: ⚡ pip install pandas ✅ pandas installed

 Continuando con el análisis...

## Seguridad

```bash
CODE_SANDBOX=true           # Ejecutar en sandbox
CODE_TIMEOUT=30             # Timeout en segundos
CODE_ALLOW_NETWORK=false    # Bloquear red por defecto
CODE_ALLOW_FILESYSTEM=read  # Solo lectura por defecto
CODE_REQUIRE_CONFIRM=true   # Confirmar antes de ejecutar

Use Cases

  1. Complex calculations that don't have any skill
  2. Data transformation custom
  3. One-off automations that don't warrant a skill
  4. Rapid prototyping of solutions
  5. Debugging and testing