Quick reference for AI agents working with the Shannot codebase. For detailed architecture and contribution guidelines, see CONTRIBUTING.md.
Shannot is a sandboxed system administration tool for LLM agents using PyPy sandbox architecture with syscall-level virtualization.
Key Facts:
- Python 3.11+ host code, Python 3.6 sandboxed code
- Zero runtime dependencies (stdlib only)
- Test directory is
test/(nottests/)
# Core workflow
shannot run SCRIPT # Execute Python script in sandbox
shannot approve [SESSION] # Interactive approval TUI
shannot status # Check runtime and pending sessions
# Setup (interactive menu or subcommands)
shannot setup # Interactive setup menu
shannot setup runtime # Install PyPy 3.6 stdlib
shannot setup remote add NAME # Add SSH remote target
shannot setup remote list # List configured remotes
shannot setup remote test NAME # Test SSH connection
shannot setup mcp install # Install MCP integrationKey Options: --target NAME, --dry-run, --color/--no-color
# Environment
make install # Install runtime dependencies
make install-dev # Install with dev dependencies + hooks
# Testing
make test # Run all tests
make test-unit # Skip integration tests
make test-integration # Integration tests only (requires PyPy)
make test-coverage # Run with coverage
# Code Quality
make lint # Lint with Ruff
make format # Format with Ruff
make type-check # Type check with Basedpyright
# Documentation
make docs # Build MkDocs (output to site/)
make docs-serve # Serve at http://127.0.0.1:8000
# Building
make clean # Clean build artifacts
make build # Build wheel + sdist
make build-binary # Build Nuitka binary (Linux)# Use modern Python 3.11+ syntax
from pathlib import Path
def example(path: Path | str | None = None) -> dict[str, Path]:
"""Use numpy-style docstrings with full type annotations."""
...Style:
- 4-space indents, 100-char line limit
- Double quotes for strings
- Use
Pathfor filesystem ops (not string concatenation) - Use
@pytest.mark.integrationfor tests requiring PyPy sandbox
- Check module docstrings for high-level purpose
- Verify import structure - stdlib vs local imports
- Look for type annotations to understand data flow
- Check
__init__.pyfor public API exports
- Read existing code first - match patterns and style
- Run tests after changes -
make test - Format before committing -
make format+make lint - Update documentation if adding features
- Add tests - unit for logic, integration for PyPy sandbox
- Verify zero-dependency policy - no new pip requirements at runtime
- Check backward compatibility
- Validate test coverage
- Review security implications
- Ensure documentation accuracy
| Path | Purpose |
|---|---|
~/.config/shannot/config.toml |
Global configuration (profile, audit, remotes) |
.shannot/config.toml |
Project configuration (takes precedence) |
~/.local/share/shannot/runtime/ |
PyPy stdlib |
~/.local/share/shannot/sessions/ |
Session data |
~/.local/share/shannot/audit/ |
Audit logs (JSONL) |
- CONTRIBUTING.md - Architecture, module details, coding patterns
- README.md - User documentation and quick start
- BUILDING.md - Nuitka binary build guide
- docs/ - Full MkDocs documentation
- Bug reports: https://github.com/corv89/shannot/issues
- Discussions: https://github.com/corv89/shannot/discussions