Lyrics is a bash command proxy server designed for AI Agents to securely execute Agent Skills commands in containerized environments.
Agent Skills need a secure bash environment to:
- Execute document processing (PDF, Excel, etc.)
- Run Python scripts and utilities
- Manage file system operations
- Maintain persistent shell sessions
βββββββββββββββββββββββββββββββββββββββ
β FastAPI Server β
β β’ REST API (/api/v1/*) β
β β’ Health checks β
βββββββββββββββββββββββββββββββββββββββ€
β Service Layer β
β β’ Business logic β
β β’ Thread pool management β
βββββββββββββββββββββββββββββββββββββββ€
β Command Processing β File System β
β β’ Security validationβ Path resolve β
β β’ Shell sessions β Access controlβ
βββββββββββββββββββββββββββββββββββββββ€
β Agent Skills (/skills) β
β βββββββββββ βββββββββββ βββββββββββ β
β β pdf β β xlsx β β Custom β β
β βββββββββββ βββββββββββ βββββββββββ β
βββββββββββββββββββββββββββββββββββββββ
- CommandParser: Validates bash commands with security checks
- CommandExecutor: Executes commands using persistent shell sessions
- PathResolver: Resolves skill/workspace paths
- PathValidator: Enforces security policies
pip install ailyrics# Clone project
git clone https://github.com/your-org/lyrics.git
cd lyrics
# Install dependencies
uv sync# PyPI installation
python -m lyrics.server --host 0.0.0.0 --port 8870
# Source development
uv run python -m lyrics.server --host 0.0.0.0 --port 8870
# Docker mode (source only)
make docker-upcurl http://localhost:8870/api/v1/health
# Returns: {"status": "healthy", "service": "lyrics", "api_version": "v1"}| Method | Endpoint | Description |
|---|---|---|
GET |
/api/v1/health |
Health check |
POST |
/api/v1/bash/execute |
Execute bash commands |
GET |
/api/v1/skills |
List all skills |
GET |
/api/v1/skills/{name} |
Get specific skill |
curl -X POST http://localhost:8870/api/v1/bash/execute \
-H "Content-Type: application/json" \
-d '{"command": "ls -la /skills/public"}'skill-name/
βββ SKILL.md # YAML metadata + instructions (required)
βββ scripts/ # Utility scripts (optional)
βββ reference/ # Reference docs (optional)
βββ data/ # Data files (optional)
---
name: pdf-processing
description: PDF toolkit for text extraction, form filling, etc.
license: MIT
---
# PDF Processing Guide
...detailed content...- pdf: PDF document processing (text extraction, form filling)
- xlsx: Excel spreadsheet processing (formulas, data analysis)
The system blocks dangerous patterns for security:
- Shell operators:
;,&&,||,|,$,`,>,<,&β - Path traversal:
../../../etc/passwdβ - Command injection attempts β
Alternative: Use Python
# β
Correct way
python3 -c "with open('file.txt', 'w') as f: f.write('content')"import asyncio
import httpx
async def main():
async with httpx.Client() as client:
# Health check
health = await client.get("http://localhost:8870/api/v1/health")
print(f"Service status: {health.json()['status']}")
# Execute command
result = await client.post(
"http://localhost:8870/api/v1/bash/execute",
json={"command": "echo 'Hello Lyrics!'"}
)
print(f"Output: {result.json()['stdout']}")
asyncio.run(main())src/lyrics/
βββ server.py # FastAPI main server
βββ bash/ # Bash command processing
βββ filesystem/ # File system operations
βββ commands/ # Command handlers
# Full integration tests (recommended)
make docker-test
# Unit tests
make testmake fmt # Format code
make check # Check code quality| Variable | Default | Description |
|---|---|---|
SKILLS_PATH |
/skills |
Skills directory |
WORKSPACE_PATH |
/workspace |
Working directory |
LOG_LEVEL |
INFO |
Log level |
HOST |
0.0.0.0 |
Server host |
PORT |
8870 |
Server port |
- Fork the project
- Create feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Create Pull Request
MIT License - see the LICENSE file for details.
Built for the Agent Skills ecosystem π