@fabioplunser/epd 0.5.18 → 0.5.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +0,0 @@
1
- import DefaultTheme from "vitepress/theme";
2
- import "./style.css";
3
- import DeployAnimation from "./DeployAnimation.vue";
4
-
5
- export default {
6
- extends: DefaultTheme,
7
- enhanceApp({ app }: { app: any }) {
8
- app.component("DeployAnimation", DeployAnimation);
9
- },
10
- };
@@ -1,151 +0,0 @@
1
- /**
2
- * Custom styles & Brand theme for EPD Documentation
3
- */
4
-
5
- :root {
6
- --vp-c-brand-1: #6366f1;
7
- --vp-c-brand-2: #4f46e5;
8
- --vp-c-brand-3: #4338ca;
9
- --vp-c-brand-soft: rgba(99, 102, 241, 0.12);
10
-
11
- --vp-home-hero-name-color: transparent;
12
- --vp-home-hero-name-background: linear-gradient(135deg, #6366f1 10%, #a855f7 60%, #ec4899 100%);
13
-
14
- --vp-home-hero-image-filter: drop-shadow(0 0 40px rgba(99, 102, 241, 0.3));
15
- }
16
-
17
- .dark {
18
- --vp-c-brand-1: #818cf8;
19
- --vp-c-brand-2: #6366f1;
20
- --vp-c-brand-3: #4f46e5;
21
- --vp-c-brand-soft: rgba(129, 140, 248, 0.16);
22
-
23
- --vp-home-hero-name-background: linear-gradient(135deg, #a5b4fc 10%, #c084fc 60%, #f472b6 100%);
24
- }
25
-
26
- /* Tighten excessive spacing between navbar and hero */
27
- .VPHome {
28
- margin-bottom: 1.5rem !important;
29
- }
30
-
31
- .VPHero {
32
- padding-top: calc(var(--vp-nav-height) + 12px) !important;
33
- padding-bottom: 16px !important;
34
- }
35
-
36
- .VPHero .container {
37
- padding-top: 0 !important;
38
- padding-bottom: 0 !important;
39
- max-width: 1040px !important;
40
- }
41
-
42
- @media (min-width: 960px) {
43
- .VPHero {
44
- padding-top: calc(var(--vp-nav-height) + 16px) !important;
45
- padding-bottom: 20px !important;
46
- }
47
- }
48
-
49
- .VPHero .name {
50
- font-size: 48px !important;
51
- line-height: 1.1 !important;
52
- margin-bottom: 4px !important;
53
- }
54
-
55
- .VPHero .text {
56
- font-size: 36px !important;
57
- line-height: 1.15 !important;
58
- margin-bottom: 6px !important;
59
- }
60
-
61
- .VPHero .tagline {
62
- font-size: 16px !important;
63
- margin-top: 4px !important;
64
- margin-bottom: 16px !important;
65
- max-width: 640px !important;
66
- line-height: 1.45 !important;
67
- }
68
-
69
- .VPHero .actions {
70
- padding-top: 4px !important;
71
- padding-bottom: 0 !important;
72
- }
73
-
74
- /* Custom Guide Navigation Grid */
75
- .guide-grid {
76
- display: grid;
77
- grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
78
- gap: 1.25rem;
79
- margin: 1.5rem 0 2.5rem;
80
- }
81
-
82
- .guide-card {
83
- display: flex;
84
- flex-direction: column;
85
- padding: 1.25rem 1.5rem;
86
- background-color: var(--vp-c-bg-soft);
87
- border: 1px solid var(--vp-c-border);
88
- border-radius: 12px;
89
- text-decoration: none !important;
90
- color: var(--vp-c-text-1) !important;
91
- transition: all 0.2s ease-in-out;
92
- }
93
-
94
- .guide-card:hover {
95
- border-color: var(--vp-c-brand-1);
96
- transform: translateY(-2px);
97
- box-shadow: 0 6px 20px rgba(99, 102, 241, 0.1);
98
- }
99
-
100
- .guide-card-icon {
101
- font-size: 1.75rem;
102
- margin-bottom: 0.5rem;
103
- }
104
-
105
- .guide-card-title {
106
- font-size: 1.1rem;
107
- font-weight: 600;
108
- margin-bottom: 0.35rem;
109
- color: var(--vp-c-brand-1);
110
- }
111
-
112
- .guide-card-desc {
113
- font-size: 0.9rem;
114
- color: var(--vp-c-text-2);
115
- line-height: 1.45;
116
- margin: 0;
117
- }
118
-
119
- /* Code blocks polish */
120
- .vp-doc [class*='language-'] {
121
- border-radius: 10px;
122
- }
123
-
124
- /* Tables styling */
125
- .vp-doc table {
126
- display: table;
127
- width: 100%;
128
- border-collapse: collapse;
129
- margin: 1.5rem 0;
130
- }
131
-
132
- .vp-doc th {
133
- background-color: var(--vp-c-bg-soft);
134
- font-weight: 600;
135
- }
136
-
137
- @media (max-width: 640px) {
138
- .guide-grid {
139
- grid-template-columns: 1fr;
140
- gap: 0.85rem;
141
- }
142
- .guide-card {
143
- padding: 1rem 1.15rem;
144
- }
145
- .VPHero .name {
146
- font-size: 38px !important;
147
- }
148
- .VPHero .text {
149
- font-size: 28px !important;
150
- }
151
- }
package/docs/agents.md DELETED
@@ -1,166 +0,0 @@
1
- # AI agent guide
2
-
3
- The installed CLI includes a setup guide. Run `epd agent --guide` to read it,
4
- or `epd agent --write-guide EPD_AGENT.md` to export it without overwriting a file.
5
- `epd agent` launches an installed Codex or Claude CLI with that guide and a setup
6
- task. `--cli <executable>` selects another CLI that accepts a positional prompt.
7
- The agent keeps its normal permissions and asks before provisioning or deploying.
8
- Both `epd` and `edp` are supported command names.
9
-
10
- `epd init` starts the full configuration wizard in a terminal. Use `--yes` and
11
- explicit flags for scripts. Set `container_engine: auto`, `podman`, `docker`,
12
- `nerdctl` or a custom Docker-compatible executable in `epd.yml`.
13
- `EPD_CONTAINER_ENGINE` overrides the YAML value. This selects the local engine;
14
- remote servers still use Docker. Use the bundled guide and installed command
15
- help as the reference for the current CLI version.
16
-
17
-
18
- > How AI coding agents (Cursor, Windsurf, Claude Code, Cline, Roo, Copilot, Antigravity) use EPD to provision servers and deploy applications autonomously.
19
-
20
- ---
21
-
22
- ## The Philosophy: Why CLI & curl > MCP for Deployments
23
-
24
- Many platforms attempt to build heavy **MCP (Model Context Protocol)** servers for deployments. We deliberately chose **not** to do this.
25
-
26
- Here is why a clean CLI and raw `curl` is a strictly superior abstraction for AI coding agents:
27
-
28
- 1. **Native Shell Capabilities**: Modern AI coding models (Claude 3.7 / Sonnet, OpenAI o3, Gemini, DeepSeek) are exceptionally skilled at running shell commands via their native terminal tools (`bash`, `run_command`).
29
- 2. **Zero MCP Configuration Bloat**: MCP requires installing daemon processes, registering JSON configurations (`.cursor/mcp.json`, `claude_desktop_config.json`), handling Node.js socket bridges, and debugging RPC schema mismatches. A CLI requires **zero setup**:
30
- ```bash
31
- curl -fsSL https://epd.peppi.dev/install.sh | bash
32
- ```
33
- 3. **Universal Portability**: The exact same commands work in Cursor, Windsurf, Claude Code, GitHub Actions CI/CD, local terminals, and remote SSH jump boxes without installing specialized tool plugins.
34
- 4. **Machine-Readable Output**: EPD provides structured flags like `--json` (`epd status --json`), predictable exit codes (0 = success, 1 = config, 2 = network, 3 = healthcheck timeout), and clean stdout/stderr streams that LLMs parse with near 100% accuracy.
35
-
36
- ---
37
-
38
- ## LLM Documentation Feeds (`llms.txt`)
39
-
40
- AI agents do **not** need to scrape HTML pages or navigate complex client-rendered web apps. EPD provides standardized, token-efficient, plain-markdown feeds:
41
-
42
- | Endpoint | Description | Command |
43
- |---|---|---|
44
- | [`/llms.txt`](/llms.txt) | Concise index of core documentation & CLI commands | `curl -s https://epd.peppi.dev/llms.txt` |
45
- | [`/llms-full.txt`](/llms-full.txt) | Complete single-file markdown reference with full schema & recipes | `curl -s https://epd.peppi.dev/llms-full.txt` |
46
-
47
- If an AI agent needs to understand how a specific EPD command or `epd.yml` property works, instruct it to fetch:
48
- ```bash
49
- curl -s https://epd.peppi.dev/llms.txt
50
- ```
51
-
52
- ---
53
-
54
- ## Agent System Prompt Snippet
55
-
56
- You can copy and paste this snippet directly into your project's `.cursorrules`, `CLAUDE.md`, or `AGENTS.md` file:
57
-
58
- ```markdown
59
- ### Deployment & Server Operations (EPD)
60
- When asked to deploy, inspect, or manage server infrastructure:
61
- 1. Always use the `epd` CLI (`curl -fsSL https://epd.peppi.dev/install.sh | bash` if not installed).
62
- 2. For documentation lookups, fetch raw markdown directly from:
63
- - `curl -s https://epd.peppi.dev/llms.txt`
64
- - `curl -s https://epd.peppi.dev/llms-full.txt`
65
- 3. Before deploying, run `epd doctor --local` to validate `epd.yml` and container settings.
66
- 4. Deploy with `epd deploy`. EPD performs zero-downtime blue/green container switching fronted by Traefik.
67
- 5. Verify deployment health using `epd status --json`.
68
- 6. If a deployment fails or health checks timeout, execute `epd rollback` to revert traffic instantly.
69
- ```
70
-
71
- ---
72
-
73
- ## Automated AI Agent Playbook
74
-
75
- Here is the standard 5-step lifecycle an AI agent should execute when deploying a repository:
76
-
77
- ### 1. Initialize Project Configuration
78
- If `epd.yml` does not exist in the repository, the agent should run `epd init` non-interactively:
79
-
80
- ```bash
81
- epd init \
82
- --name "my-saas" \
83
- --host "159.69.120.45" \
84
- --domain "app.example.com" \
85
- --port 3000 \
86
- --dockerfile
87
- ```
88
-
89
- This creates an optimized multi-stage `Dockerfile` (if absent) and an `epd.yml` configured for zero-downtime blue/green deployments.
90
-
91
- ### 2. Pre-flight Validation
92
- The agent validates local tooling, Dockerfile syntax, and environment configurations without initiating remote SSH connections:
93
-
94
- ```bash
95
- epd doctor --local
96
- epd config
97
- ```
98
-
99
- ### 3. Server Provisioning (Clean VPS)
100
- If deploying to a fresh Ubuntu or Debian server for the first time, the agent provisions Docker, Traefik, Let's Encrypt, and CrowdSec security with one command:
101
-
102
- ```bash
103
- epd setup --host 159.69.120.45
104
- ```
105
-
106
- ### 4. Zero-Downtime Deployment
107
- The agent triggers the build and live cutover:
108
-
109
- ```bash
110
- epd deploy
111
- ```
112
-
113
- During this command:
114
- - EPD builds the container on the target server.
115
- - Boots the new container slot (e.g. `green`).
116
- - Probes `/health` repeatedly until HTTP 200 OK is received.
117
- - Hot-swaps Traefik routing dynamically without dropping a single active HTTP connection.
118
- - Drains and stops the old slot (`blue`).
119
-
120
- ### 5. Verification & JSON Parsing
121
- The agent inspects the running cluster state in machine-readable JSON:
122
-
123
- ```bash
124
- epd status --json
125
- ```
126
-
127
- Example JSON response:
128
- ```json
129
- {
130
- "project": "my-saas",
131
- "activeSlot": "green",
132
- "activeVersion": "v1.2.4",
133
- "domain": "app.example.com",
134
- "ssl": "active",
135
- "slots": {
136
- "green": { "status": "running", "replicas": 2, "healthy": true, "port": 3001 },
137
- "blue": { "status": "stopped", "replicas": 0, "healthy": false, "port": 3000 }
138
- },
139
- "accessories": {
140
- "postgres": { "status": "healthy", "port": 5432 }
141
- }
142
- }
143
- ```
144
-
145
- If issues are detected:
146
- ```bash
147
- # View last 50 log lines
148
- epd logs -n 50
149
-
150
- # Revert immediately to previous working slot
151
- epd rollback
152
- ```
153
-
154
- ---
155
-
156
- ## Exit Codes Reference for Scripting
157
-
158
- AI agents should evaluate standard shell exit codes (`$?`):
159
-
160
- | Exit Code | Meaning | Agent Action |
161
- |---|---|---|
162
- | `0` | **Success** | Continue task or report deployment URL. |
163
- | `1` | **Configuration Error** | Read error output, inspect `epd.yml` or `Dockerfile`, fix syntax. |
164
- | `2` | **SSH / Network Failure** | Check server IP, SSH key permissions (`chmod 600 ~/.ssh/id_rsa`), or firewall. |
165
- | `3` | **Healthcheck Timeout** | Check application logs (`epd logs -n 50`), verify internal port and `/health` route. Run `epd rollback`. |
166
- | `4` | **Deployment Lock Active** | Another deployment is in progress. Inspect lock with `epd lock status`. |
package/docs/ci-cd.md DELETED
@@ -1,152 +0,0 @@
1
- # Automated Deployments with GitHub Actions (CI/CD)
2
-
3
- `epd` is designed to be executed directly inside GitHub Actions. Because your entire deployment configuration (services, replicas, ports, health probes, zero-downtime blue/green slots, accessories, domains, and DNS sync) is declared in `epd.yml`, your CI/CD workflow is concise and maintainable.
4
-
5
- ---
6
-
7
- ## 1. Quick Setup
8
-
9
- Generate a preconfigured workflow automatically with:
10
-
11
- ```bash
12
- epd init --ci
13
- ```
14
-
15
- This creates `.github/workflows/deploy.yml` in your repository.
16
-
17
- ---
18
-
19
- ## 2. Complete Workflow Example
20
-
21
- Create `.github/workflows/deploy.yml`:
22
-
23
- ```yaml
24
- name: Deploy
25
-
26
- on:
27
- push:
28
- branches: [main]
29
-
30
- concurrency:
31
- group: deploy-${{ github.ref }}
32
- cancel-in-progress: false # Do not cancel in-flight deployments
33
-
34
- jobs:
35
- deploy:
36
- runs-on: ubuntu-latest
37
- steps:
38
- - name: Checkout repository
39
- uses: actions/checkout@v4
40
-
41
- - name: Configure SSH Agent
42
- uses: webfactory/ssh-agent@v0.9.0
43
- with:
44
- ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
45
-
46
- - name: Deploy with EPD
47
- run: npx @fabioplunser/epd deploy
48
- env:
49
- # DNS & Cloud Provider Tokens (if used in epd.yml)
50
- CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
51
- HETZNER_API_TOKEN: ${{ secrets.HETZNER_API_TOKEN }}
52
- HETZNER_DNS_API_TOKEN: ${{ secrets.HETZNER_DNS_API_TOKEN }}
53
- # Application Secrets referenced in epd.yml
54
- DATABASE_URL: ${{ secrets.DATABASE_URL }}
55
- SESSION_SECRET: ${{ secrets.SESSION_SECRET }}
56
- ```
57
-
58
- ---
59
-
60
- ## 3. Configuring SSH Deploy Keys
61
-
62
- To allow GitHub Actions to securely communicate with your server(s):
63
-
64
- ### 1. Generate an SSH Key Pair
65
- Run on your local machine:
66
- ```bash
67
- ssh-keygen -t ed25519 -C "github-actions-epd" -f /tmp/epd_deploy_key
68
- ```
69
-
70
- ### 2. Add the Public Key to Your Server
71
- Copy the contents of `/tmp/epd_deploy_key.pub` to `/root/.ssh/authorized_keys` on each server configured in `epd.yml`.
72
-
73
- ### 3. Add the Private Key to GitHub Secrets
74
- In your GitHub repository:
75
- 1. Go to **Settings** → **Secrets and variables** → **Actions**.
76
- 2. Click **New repository secret**.
77
- 3. Name: `SSH_PRIVATE_KEY`
78
- 4. Secret: Paste the entire contents of `/tmp/epd_deploy_key` (including `-----BEGIN OPENSSH PRIVATE KEY-----` and `-----END OPENSSH PRIVATE KEY-----`).
79
-
80
- ---
81
-
82
- ## 4. Docker Image Strategies in CI/CD
83
-
84
- `epd` gives you three flexible approaches for handling Docker container images in GitHub Actions:
85
-
86
- ### Strategy A: Zero Registry (Easiest)
87
- If you do not specify a `registry:` in `epd.yml`:
88
- - The image is built on GitHub's runner.
89
- - It is saved and streamed directly over SSH to the target server (`docker save | ssh docker load`).
90
- - **No container registry account or setup required.**
91
-
92
- ### Strategy B: GitHub Container Registry (`ghcr.io`)
93
- If deploying to multiple servers or wanting fast image caching:
94
-
95
- In `epd.yml`:
96
- ```yaml
97
- image: ghcr.io/${{ github.repository }}/app
98
- registry:
99
- server: ghcr.io
100
- username: ${{ github.actor }}
101
- password: GITHUB_TOKEN
102
- ```
103
-
104
- In `.github/workflows/deploy.yml`:
105
- ```yaml
106
- - name: Deploy with EPD
107
- run: npx @fabioplunser/epd deploy
108
- env:
109
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
110
- ```
111
-
112
- ### Strategy C: Remote Server Build
113
- Build the image directly on the remote server using host CPU/memory and local layer cache:
114
-
115
- ```yaml
116
- # epd.yml
117
- build:
118
- remote: true
119
- ```
120
-
121
- ---
122
-
123
- ## 5. Multi-Environment Deployments (Staging vs. Production)
124
-
125
- Use `epd` destination overlays:
126
-
127
- ```yaml
128
- # .github/workflows/deploy-staging.yml
129
- on:
130
- push:
131
- branches: [develop]
132
-
133
- jobs:
134
- deploy:
135
- runs-on: ubuntu-latest
136
- steps:
137
- - uses: actions/checkout@v4
138
- - uses: webfactory/ssh-agent@v0.9.0
139
- with:
140
- ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY_STAGING }}
141
- - run: npx @fabioplunser/epd deploy -d staging
142
- ```
143
-
144
- This applies `epd.staging.yml` over your base `epd.yml`.
145
-
146
- ---
147
-
148
- ## Related Documentation
149
-
150
- - **[Getting Started Guide](/guide/getting-started)**: Step-by-step onboarding walkthrough.
151
- - **[Hetzner Cloud & DNS](/hetzner-dns)**: Provision servers and sync DNS records automatically.
152
- - **[CLI Commands Reference](/reference/cli)**: Command-line reference for `epd deploy`.