{"_rev":"3-6cbada944cb00dbafceba6b60f507127","time":{"created":"2026-02-18T17:18:39.378Z","modified":"2026-02-18T17:18:39.930Z","0.1.1":"2026-02-17T15:20:46.301Z","0.1.2":"2026-02-18T17:18:39.664Z"},"_id":"@aid-on/aidify","name":"@aid-on/aidify","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.2":{"name":"@aid-on/aidify","version":"0.1.2","description":"CLI for Aid-On Platform - Amplify-like deployment for Google Cloud + CDKTF + Cloudflare","type":"module","bin":{"aidify":"bin/aidify.js"},"scripts":{"build":"tsc","typecheck":"tsc --noEmit","test":"vitest run","test:watch":"vitest","prepublishOnly":"npm run build","local-install":"npm run build && npm link","local-uninstall":"npm unlink -g @aid-on/aidify"},"dependencies":{"@cdktf/provider-cloudflare":"^11.0.0","@cdktf/provider-google":"^13.0.0","@clack/prompts":"^0.8.2","@iarna/toml":"^2.2.5","@types/figlet":"^1.7.0","boxen":"^8.0.1","cdktf":"^0.20.0","cdktf-cli":"^0.20.0","chalk":"^5.3.0","commander":"^12.0.0","execa":"^8.0.1","figlet":"^1.9.4","fs-extra":"^11.2.0","ora":"^8.0.1","tsx":"^4.19.2","yaml":"^2.4.5","zod":"^3.23.0"},"devDependencies":{"@types/fs-extra":"^11.0.4","@types/node":"^22.10.2","typescript":"^5.7.2","vitest":"^2.1.8"},"engines":{"node":">=20.0.0"},"_id":"@aid-on/aidify@0.1.2","_nodeVersion":"20.19.6","_npmVersion":"10.8.2","dist":{"integrity":"sha512-tv48/uILYdVRfPSbEoNLmSzBAdLiipvNprA1oo0UkhKEi/MtWoC9T3ipUtimI81eM+dhH84V7eylMGmJeK0Ohw==","shasum":"819dfcee25dd067f752cb59e4b2c9b73c10a50a5","tarball":"https://registry.npmjs.org/@aid-on/aidify/-/aidify-0.1.2.tgz","fileCount":320,"unpackedSize":407293,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCQZ9nStTdZV5A2QNncv5WEmm7SPmko6m/mZUfdzG12+AIgA2gu6iNZXi1YDNMcWC/3xzzgTKjjQhwXDapOhWcqIXY="}]},"_npmUser":{"name":"aid-on","email":"hiromi.motodera@aid-on.org"},"directories":{},"maintainers":[{"name":"aid-on","email":"hiromi.motodera@aid-on.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/aidify_0.1.2_1771435119493_0.9332579734243716"},"_hasShrinkwrap":false}},"maintainers":[{"name":"aid-on","email":"hiromi.motodera@aid-on.org"}],"description":"CLI for Aid-On Platform - Amplify-like deployment for Google Cloud + CDKTF + Cloudflare","readme":"# @aid-on/aidify\n\n<div align=\"center\">\n\n[![npm version](https://img.shields.io/npm/v/@aid-on/aidify.svg?style=flat-square&color=00DC82)](https://www.npmjs.com/package/@aid-on/aidify)\n[![TypeScript](https://img.shields.io/badge/TypeScript-5.7-3178C6?style=flat-square&logo=typescript&logoColor=white)](https://www.typescriptlang.org/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](https://opensource.org/licenses/MIT)\n[![Node](https://img.shields.io/badge/Node-%3E%3D20.0.0-339933?style=flat-square&logo=node.js&logoColor=white)](https://nodejs.org/)\n\n<br />\n\n<h3>\n<b>aidify</b> - Amplify-like Deployment for Cloudflare + CDKTF\n</h3>\n\n<p align=\"center\">\n<b>One command to rule your edge deployment.</b><br/>\nInfrastructure provisioning, database migrations, and application deploy -- all in a single CLI.\n</p>\n\n<br/>\n\n[**日本語**](./README.ja.md) | **English**\n\n<br/>\n\n</div>\n\n## ✨ Key Features\n\n- **🚀 One-Command Deploy** - Deploy infrastructure and application together\n- **🏗️ Infrastructure as Code** - Declarative infra management with Terraform CDKTF\n- **🔄 Multi-Environment Support** - Easy switching between dev/stg/prod\n- **💾 Database Migrations** - Idempotent migration management for D1\n- **🤝 Team Development** - Terraform State sharing via R2 backend\n- **🔐 Secure Secrets Management** - Safe handling of environment variables and secrets\n- **🩺 Health Checks and Diagnostics** - Built-in tooling to verify deployment status\n\n## 📋 Prerequisites\n\n- Node.js >= 20.0.0\n- npm >= 9.0.0\n- Cloudflare account with the following credentials:\n  - Account ID\n  - API Key\n  - Email\n  - Zone ID (when using custom domains)\n\n## 🚀 Quick Start\n\n### 1. Installation\n\n```bash\n# Global install\nnpm install -g @aid-on/aidify\n\n# Or as a dev dependency\nnpm install --save-dev @aid-on/aidify\n```\n\n### 2. Configure Credentials\n\n```bash\n# Interactive configuration (saved to ~/.aidify)\naidify configure\n\n# Or set environment variables\nexport CLOUDFLARE_ACCOUNT_ID=\"your-account-id\"\nexport CLOUDFLARE_API_KEY=\"your-api-key\"\nexport CLOUDFLARE_EMAIL=\"your-email\"\nexport CLOUDFLARE_ZONE_ID=\"your-zone-id\"  # Optional\n```\n\n### 3. Create a New Project\n\n```bash\n# Interactive project creation\naidify init my-app\ncd my-app\n\n# Verify configuration\naidify configure  # Check and set credentials\n```\n\n### 4. Deploy\n\n```bash\n# Deploy to development\naidify deploy dev\n\n# Deploy to production (confirmation prompt)\naidify deploy prod\n\n# Auto-approve mode\naidify deploy dev --auto-approve\n```\n\n## 📁 Project Structure\n\n```\nmy-app/\n├── aidify.config.ts      # Aidify configuration\n├── src/\n│   └── index.ts         # Application entry point\n├── migrations/          # D1 database migrations\n│   └── 001_initial.sql\n├── public/             # Static files\n└── wrangler.toml       # Wrangler config (auto-generated)\n```\n\n## ⚙️ Configuration (aidify.config.ts)\n\n```typescript\nimport { defineConfig } from \"@aid-on/aidify\";\n\nexport default defineConfig({\n  name: \"my-app\",\n  framework: \"qwik\",  // qwik, remix, astro, etc.\n\n  // Enable features\n  features: [\n    \"d1-database\",      // D1 SQLite database\n    \"r2-storage\",       // R2 object storage\n    \"kv-namespace\",     // KV key-value store\n    \"vectorize\",        // Vectorize vector search\n    \"workers-ai\",       // Workers AI\n    \"durable-objects\",  // Durable Objects\n  ],\n\n  // Environment configuration\n  environments: {\n    dev: {\n      subdomain: \"my-app-dev\",\n      primary: false,\n    },\n    stg: {\n      subdomain: \"my-app-stg\",\n      primary: false,\n    },\n    prod: {\n      subdomain: \"my-app\",\n      primary: true,  // Production flag\n    }\n  },\n\n  // Terraform State for team development (recommended)\n  state: {\n    type: \"r2\",\n    bucket: \"terraform-state-bucket\",\n    region: \"auto\"\n  },\n\n  // Build settings\n  build: {\n    command: \"npm run build\",\n    output: \"dist\"\n  },\n\n  // Secrets\n  secrets: [\n    \"API_KEY\",\n    \"DATABASE_URL\"\n  ]\n});\n```\n\n## 🔧 Core Commands\n\n### Project Management\n\n```bash\n# Create a new project\naidify init <project-name>\n\n# Check status\naidify status\n\n# Health check\naidify health dev\naidify health dev --json  # JSON output\n\n# Dependency check\naidify doctor\n```\n\n### Environment Management\n\n```bash\n# Show current environment\naidify env get\n\n# Switch environment\naidify env checkout dev\n\n# List environments\naidify env list\n\n# Add a new environment\naidify env add staging\n\n# Remove an environment\naidify env remove staging\n```\n\n### Deployment\n\n```bash\n# Full deploy (infrastructure + application)\naidify deploy dev\n\n# Infrastructure only\naidify infra deploy dev\n\n# Application only\naidify app deploy dev\n\n# Dry run (no actual deploy)\naidify deploy dev --dry-run\n```\n\n### Database Migrations\n\n```bash\n# Create a migration\naidify migration create \"create users table\"\n\n# Run migrations\naidify migration run dev\n\n# Check migration status\naidify migration status dev\n\n# Rollback\naidify migration rollback dev\n```\n\n### Resource Management\n\n```bash\n# Destroy environment resources\naidify destroy dev\n\n# Destroy application only\naidify app destroy dev\n\n# Destroy infrastructure only\naidify infra destroy dev\n```\n\n## 🤝 Team Development\n\n### Terraform State Management\n\nFor team development, using the R2 backend for State management is strongly recommended:\n\n1. **Create an R2 bucket**\n```bash\nwrangler r2 bucket create terraform-state-prod\n```\n\n2. **Set credentials**\n```bash\nexport AWS_ACCESS_KEY_ID=<r2-access-key>\nexport AWS_SECRET_ACCESS_KEY=<r2-secret-key>\n```\n\n3. **Configure in aidify.config.ts**\n```typescript\nstate: {\n  type: \"r2\",\n  bucket: \"terraform-state-prod\",\n  region: \"auto\"\n}\n```\n\nSee [docs/terraform-state.md](docs/terraform-state.md) for details.\n\n## 🏗️ Supported Frameworks\n\n- **Qwik** - Edge-optimized framework\n- **Remix** - Full-stack web framework\n- **Astro** - Content-focused static site generator\n- **Vanilla** - No framework\n\n## 🌟 Cloudflare Features\n\n### Data Storage\n- **D1 Database** - SQLite-based serverless SQL\n- **R2 Storage** - S3-compatible object storage\n- **KV Namespace** - Globally distributed key-value store\n- **Durable Objects** - Strongly consistent stateful objects\n\n### AI/ML\n- **Vectorize** - Vector database and similarity search\n- **Workers AI** - AI model inference at the edge\n\n### Other\n- **Authentication** - Google OAuth integration\n- **LLM Integration** - LLM integration via unilmp\n- **Monitoring** - OpenTelemetry support\n\n## 📚 Advanced Usage\n\n### CI/CD Pipeline\n\nExample automated deployment with GitHub Actions:\n\n```yaml\nname: Deploy\non:\n  push:\n    branches: [main]\n\njobs:\n  deploy:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v3\n      - uses: actions/setup-node@v3\n        with:\n          node-version: 20\n\n      - run: npm ci\n      - run: npm run build\n\n      - name: Deploy to Production\n        env:\n          CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }}\n          CLOUDFLARE_API_KEY: ${{ secrets.CF_API_KEY }}\n          CLOUDFLARE_EMAIL: ${{ secrets.CF_EMAIL }}\n        run: npx aidify deploy prod --auto-approve\n```\n\n### Custom Domain Configuration\n\n```typescript\n// aidify.config.ts\nenvironments: {\n  prod: {\n    subdomain: \"www\",\n    customDomain: \"example.com\",\n    primary: true\n  }\n}\n```\n\n### Environment Variable Management\n\n```bash\n# .env.dev\nDATABASE_URL=dev-database-url\nAPI_ENDPOINT=https://api-dev.example.com\n\n# .env.prod\nDATABASE_URL=prod-database-url\nAPI_ENDPOINT=https://api.example.com\n```\n\n## 🔍 Troubleshooting\n\n### Authentication Errors\n```bash\n# Reconfigure credentials\naidify configure\n\n# Show current settings\naidify configure --show\n```\n\n### Deploy Errors\n```bash\n# Check health status\naidify health dev --verbose\n\n# View logs\nwrangler pages deployment list --project-name=<project>\n```\n\n### Migration Errors\n```bash\n# Check migration status\naidify migration status dev\n\n# Validate migrations\naidify migration validate dev\n```\n\n## 🐛 Known Issues\n\n- Vectorize deletion requires direct API usage as Wrangler CLI does not support it\n- Durable Objects namespaces are automatically cleaned up on Worker deletion\n\n## 📄 License\n\nMIT © Aid-On\n\n## 🤝 Contributing\n\nIssues and pull requests are welcome!\n\n1. Fork this repository\n2. Create a feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a pull request\n\n## 📮 Support\n\n- Issues: [GitHub Issues](https://github.com/Aid-On/aid-on-platform/issues)\n- Docs: [Documentation](https://docs.aid-on.org/aidify)\n\n---\n\n<div align=\"center\">\n\n**Deploy to the edge. Manage with confidence.**\n\n<br/>\n\n[NPM](https://www.npmjs.com/package/@aid-on/aidify) •\n[GitHub](https://github.com/Aid-On/aid-on-platform)\n\n</div>\n","readmeFilename":"README.md"}