{"_id":"1panel-skill","name":"1panel-skill","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"1panel-skill","version":"1.0.0","description":"Comprehensive 1Panel API skill for AI agents - 580+ endpoints","main":"dist/index.js","types":"dist/index.d.ts","type":"module","scripts":{"build":"tsc","dev":"tsc --watch","test":"node --test dist/**/*.test.js","lint":"eslint src/**/*.ts","prepare":"npm run build"},"keywords":["1panel","skill","mcp","ai","server-management","docker","linux","api-client"],"author":{"name":"EaveLuo"},"license":"MIT","engines":{"node":">=18.0.0"},"repository":{"type":"git","url":"git+https://github.com/EaveLuo/1panel-skill.git"},"bugs":{"url":"https://github.com/EaveLuo/1panel-skill/issues"},"homepage":"https://github.com/EaveLuo/1panel-skill#readme","dependencies":{},"devDependencies":{"@types/node":"^20.19.37","typescript":"^5.9.3"},"_id":"1panel-skill@1.0.0","gitHead":"bc96fdedac57eae5472fbba921e5216e8e99eda6","_nodeVersion":"22.22.0","_npmVersion":"10.9.4","dist":{"integrity":"sha512-a141C9930gbHHf8s8aaXCu5B0Izf+IS1AGUtUPVcpucIu2rpIAPE13cQDE8zru47FLdAJs4wDAdEDVwFDLMg5Q==","shasum":"74cf1bb624c9f0143c828e6ddf23114116fd5c88","tarball":"https://registry.npmjs.org/1panel-skill/-/1panel-skill-1.0.0.tgz","fileCount":303,"unpackedSize":689965,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCRmz1WwUmDZBLwgl15xg5kgRWSKYSAvTgRMpfiInepVwIhANjFQOGuvETgBQdRqdJM5f9zzTBsnj1th3+V2erxhfgW"}]},"_npmUser":{"name":"eaveluo","email":"eaveluo@gmail.com"},"directories":{},"maintainers":[{"name":"eaveluo","email":"eaveluo@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/1panel-skill_1.0.0_1773939209991_0.3975075470396279"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-19T16:53:29.990Z","1.0.0":"2026-03-19T16:53:30.199Z","modified":"2026-03-19T16:53:30.444Z"},"maintainers":[{"name":"eaveluo","email":"eaveluo@gmail.com"}],"description":"Comprehensive 1Panel API skill for AI agents - 580+ endpoints","homepage":"https://github.com/EaveLuo/1panel-skill#readme","keywords":["1panel","skill","mcp","ai","server-management","docker","linux","api-client"],"repository":{"type":"git","url":"git+https://github.com/EaveLuo/1panel-skill.git"},"author":{"name":"EaveLuo"},"bugs":{"url":"https://github.com/EaveLuo/1panel-skill/issues"},"license":"MIT","readme":"# 1Panel Skill\n\n[![npm version](https://img.shields.io/npm/v/1panel-skill.svg)](https://www.npmjs.com/package/1panel-skill)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nA comprehensive TypeScript skill for managing 1Panel servers through AI agents.\n\n## Features\n\n- **TypeScript** - Type-safe implementation\n- **Modular Design** - 38 organized API modules\n- **Promise-based** - Modern async/await API\n- **Full API Coverage** - 580+ 1Panel API endpoints\n- **XPack Support** - Professional version features included\n\n## Installation\n\n```bash\nnpm install 1panel-skill\n```\n\n## Quick Start\n\n```typescript\nimport { OnePanelClient } from '1panel-skill';\n\nconst client = new OnePanelClient({\n  host: 'localhost',\n  port: 8080,\n  apiKey: 'your-api-key',\n  protocol: 'http'\n});\n\n// List containers\nconst containers = await client.container.list();\n\n// Create website\nconst website = await client.website.create({\n  primaryDomain: 'example.com',\n  type: 'deployment'\n});\n```\n\n## Configuration\n\n### Environment Variables\n\n```bash\nONEPANEL_HOST=localhost      # 1Panel host\nONEPANEL_PORT=8080           # 1Panel port\nONEPANEL_API_KEY=xxx         # API key (required)\nONEPANEL_PROTOCOL=http       # http or https\n```\n\n### Getting API Key\n\n1. Login to 1Panel web interface\n2. Go to Profile → API\n3. Generate or copy your API key\n\n## API Modules\n\n### Container & Docker\n\n```typescript\n// List containers\nconst containers = await client.container.list();\n\n// Create container\nconst container = await client.container.create({\n  name: 'my-app',\n  image: 'nginx:latest'\n});\n\n// Start/Stop/Restart\nawait client.container.start(container.id);\nawait client.container.stop(container.id);\nawait client.container.restart(container.id);\n\n// Get logs\nconst logs = await client.container.getLogs(container.id, 100);\n\n// Docker Compose\nconst composes = await client.compose.list();\nawait client.compose.create('my-app', dockerComposeContent);\n\n// Images\nconst images = await client.image.list();\nawait client.image.pull('nginx:latest');\n\n// Networks\nconst networks = await client.network.list();\nawait client.network.create('my-network');\n\n// Volumes\nconst volumes = await client.volume.list();\nawait client.volume.create('my-volume');\n```\n\n### Website Management\n\n```typescript\n// List websites\nconst websites = await client.website.list();\n\n// Create website\nconst website = await client.website.create({\n  primaryDomain: 'example.com',\n  type: 'deployment'\n});\n\n// Manage domains\nawait client.websiteDomain.create({\n  websiteId: website.id,\n  domain: 'www.example.com'\n});\n\n// SSL certificates\nawait client.websiteSSL.create({\n  websiteId: website.id,\n  type: 'auto'\n});\n\n// Renew SSL\nawait client.websiteSSL.renew(sslId);\n```\n\n### Database Management\n\n```typescript\n// MySQL\nconst databases = await client.databaseMysql.list();\nawait client.databaseMysql.create({\n  name: 'mydb',\n  username: 'dbuser',\n  password: 'secure-password'\n});\n\n// PostgreSQL\nawait client.database.create('postgresql', {\n  name: 'mydb',\n  username: 'dbuser'\n});\n\n// Redis\nconst conf = await client.databaseRedis.getConf(redisId);\nawait client.databaseRedis.changePassword(redisId, 'new-password');\n```\n\n### File Operations\n\n```typescript\n// List files\nconst files = await client.file.list('/opt');\n\n// Get file content\nconst content = await client.file.getContent('/opt/config.json');\n\n// Save file\nawait client.file.save('/opt/config.json', fileContent);\n\n// Compress\nawait client.file.compress({\n  files: ['/opt/app1', '/opt/app2'],\n  dst: '/opt/backups',\n  name: 'backup.tar.gz',\n  type: 'tar.gz'\n});\n\n// Decompress\nawait client.file.decompress({\n  path: '/opt/backups/backup.tar.gz',\n  dst: '/opt/restore',\n  type: 'tar.gz'\n});\n\n// File permissions\nawait client.file.chmod({ path: '/opt/app', mode: '755' });\nawait client.file.chown({ path: '/opt/app', user: 'root', group: 'root' });\n```\n\n### System Management\n\n```typescript\n// System info\nconst info = await client.system.getInfo();\n\n// Dashboard\nconst baseInfo = await client.dashboard.getBaseInfo();\nconst currentInfo = await client.dashboard.getCurrentInfo();\n\n// Settings\nconst settings = await client.settings.getAll();\nawait client.settings.update({ key: 'value' });\n\n// Monitor\nconst monitorData = await client.monitor.getData();\nawait client.monitor.updateStatus(true);\n\n// Device\nconst deviceInfo = await client.device.getInfo();\nawait client.device.updateHostname('new-hostname');\n```\n\n### Security\n\n```typescript\n// Firewall\nconst rules = await client.firewall.listRules();\nawait client.firewall.createRule({\n  protocol: 'tcp',\n  port: '8080',\n  strategy: 'accept'\n});\n\n// Fail2Ban\nconst status = await client.fail2ban.getStatus();\nawait client.fail2ban.updateStatus(true);\nconst bannedIPs = await client.fail2ban.getBannedIPs();\n\n// SSH\nconst sshInfo = await client.ssh.getInfo();\nawait client.ssh.updateStatus(true);\n```\n\n### Backup & Recovery\n\n```typescript\n// Backups\nconst backups = await client.backup.list();\nawait client.backup.create({ name: 'daily-backup' });\nawait client.backup.restore(backupId);\n\n// Snapshots\nconst snapshots = await client.snapshot.list();\nawait client.snapshot.create({ name: 'system-snapshot' });\n\n// Recycle Bin\nconst items = await client.recycleBin.list();\nawait client.recycleBin.restore(itemId);\n```\n\n### Applications\n\n```typescript\n// App Store\nconst apps = await client.app.listStore();\nconst installed = await client.app.listInstalled();\n\n// Install app\nawait client.app.install({\n  key: 'wordpress',\n  name: 'my-wordpress'\n});\n\n// Runtimes\nconst runtimes = await client.runtime.list();\nawait client.php.create({ version: '8.2' });\nawait client.node.create({ version: '18' });\n```\n\n### XPack Features (Professional)\n\n```typescript\n// OpenResty\nconst status = await client.openresty.getStatus();\nawait client.openresty.reload();\n\n// GPU\nconst gpuInfo = await client.gpu.getInfo();\n\n// AI Agent\nconst agents = await client.ai.list();\nawait client.ai.create({ name: 'my-agent' });\n\n// MCP Server\nconst servers = await client.ai.listMCPServers();\n\n// Ollama\nconst models = await client.ollama.listModels();\nawait client.ollama.pullModel('llama2');\n```\n\n## Available Modules\n\n### Core Modules (38 total)\n\n| Module | Description |\n|--------|-------------|\n| `client.container` | Docker container management |\n| `client.image` | Docker image management |\n| `client.network` | Docker network management |\n| `client.volume` | Docker volume management |\n| `client.compose` | Docker Compose management |\n| `client.app` | App Store management |\n| `client.runtime` | Runtime environments |\n| `client.php` | PHP management |\n| `client.node` | Node.js management |\n| `client.website` | Website management |\n| `client.websiteDomain` | Domain management |\n| `client.websiteSSL` | SSL certificate management |\n| `client.database` | Generic database operations |\n| `client.databaseMysql` | MySQL specific |\n| `client.databaseRedis` | Redis specific |\n| `client.file` | File system operations |\n| `client.recycleBin` | Recycle bin |\n| `client.system` | System information |\n| `client.systemSetting` | System settings |\n| `client.dashboard` | Dashboard data |\n| `client.settings` | Global settings |\n| `client.logs` | System logs |\n| `client.monitor` | System monitor |\n| `client.device` | Device management |\n| `client.backup` | Backup operations |\n| `client.backupAccount` | Backup account management |\n| `client.snapshot` | System snapshots |\n| `client.firewall` | Firewall management |\n| `client.fail2ban` | Fail2Ban management |\n| `client.ssh` | SSH management |\n| `client.cronjob` | Cronjob management |\n| `client.process` | Process management |\n| `client.terminal` | Terminal sessions |\n| `client.task` | Task management |\n| `client.disk` | Disk management |\n| `client.ftp` | FTP management |\n| `client.clam` | ClamAV antivirus |\n| `client.host` | Remote host management |\n| `client.sshKey` | SSH key management |\n| `client.openresty` | OpenResty management |\n| `client.gpu` | GPU management |\n| `client.ai` | AI Agent management |\n| `client.ollama` | Ollama management |\n\n## Error Handling\n\n```typescript\ntry {\n  await client.container.create(config);\n} catch (error) {\n  if (error.message.includes('UNAUTHORIZED')) {\n    console.error('Invalid API key');\n  } else {\n    console.error('API Error:', error.message);\n  }\n}\n```\n\n## TypeScript Support\n\nAll modules include full TypeScript type definitions:\n\n```typescript\nimport { OnePanelClient, OnePanelConfig } from '1panel-skill';\n\nconst config: OnePanelConfig = {\n  host: 'localhost',\n  port: 8080,\n  apiKey: 'your-api-key',\n  protocol: 'http'\n};\n\nconst client = new OnePanelClient(config);\n```\n\n## API Coverage\n\n| Category | Modules | Endpoints |\n|----------|---------|-----------|\n| Container & Docker | 5 | ~80 |\n| Applications | 4 | ~60 |\n| Website | 3 | ~50 |\n| Database | 3 | ~40 |\n| File Management | 2 | ~30 |\n| System | 7 | ~100 |\n| Backup & Recovery | 3 | ~40 |\n| Security | 3 | ~50 |\n| Tools | 6 | ~80 |\n| Host Management | 2 | ~30 |\n| XPack Features | 4 | ~40 |\n| **Total** | **38** | **~580+** |\n\n## License\n\nMIT\n\n## Links\n\n- [npm](https://www.npmjs.com/package/1panel-skill)\n- [GitHub](https://github.com/EaveLuo/1panel-skill)\n- [1Panel](https://1panel.cn/)\n","readmeFilename":"README.md","_rev":"1-7ec400e8654c826d8171ce41b192c3e2"}