Repository navigation
Expand file tree
/
Copy pathplugin.yaml
More file actions
114 lines (108 loc) · 4.76 KB
/
Copy pathplugin.yaml
File metadata and controls
114 lines (108 loc) · 4.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
api_version: 1
name: sync
lerd: ">=1.38"
version: 0.2.0
description: Sync a site's files and database with its servers over SSH, both ways, with an environment per server, a side-by-side file browser and backups of everything replaced
docs: DOCS.md
icon: icon.svg
screenshots: [docs/tab.png]
# lerd sync:setup | pull | push | status | diff | backups
commands:
- name: setup
usage: "Save one of the site's servers, or list them with no options: setup [--env production] --ssh user@host --path /remote/project [--url https://example.com] [--files a,b] [--sanitize file.sql] [--database --db-user --db-password] | --env name --remove"
run: bin/setup
- name: pull
usage: "Pull the database and files from one of the site's servers, or just some files: pull [site] [--env name] [--db-only | --files-only | --paths a,b]"
run: bin/pull
- name: push
usage: "Send the listed folders, or just some files, to a server, and with --db replace its database after a backup: push [site] --env name [--files | --paths a,b] [--db] [--dry-run] [--yes]"
run: bin/push
- name: status
usage: "List what is only here, only on the server, or differs: status [site] [--env name] [--dir wp-content] [--all]"
run: bin/status
- name: diff
usage: "Show how one file differs between the server and this site: diff <file> [--env name] [--site name]"
run: bin/diff
- name: backups
usage: "List the backups and snapshots, or show, restore or remove one: backups [site] [--env name] [--files id | --restore id | --remove id] [--yes]"
run: bin/backups
site_commands:
- name: pull
label: Pull from server
description: Replace this site's database with a fresh copy from its production server, or its first environment, after a snapshot, and sync its uploaded files
confirm: true
run: bin/pull
mcp:
skill: SKILL.md
tools:
- name: pull
description: Replace a lerd site's local database with a fresh dump from its production or staging server over SSH, after a before-sync-pull snapshot, then sync its configured upload folders. The server is set once by the user with lerd sync:setup
input_schema:
type: object
required: [site]
properties:
site: {type: string, description: lerd site name}
what: {type: string, enum: [both, db, files], description: What to pull; both when omitted}
env: {type: string, description: "Environment to pull from, like production or staging; needed only when the site has more than one"}
paths: {type: array, items: {type: string}, description: "Pull only these files or folders, relative to the project, instead of the database and the configured folders; what they replace is backed up"}
run: bin/pull
timeout: 10m
- name: status
description: List what differs between a lerd site and its server under one folder, files only on this site, only on the server, or the same name with a different size. Read only
input_schema:
type: object
required: [site]
properties:
site: {type: string, description: lerd site name}
env: {type: string, description: "Environment to compare with; needed only when the site has more than one"}
dir: {type: string, description: "Folder inside the project to look in; the project root when omitted"}
all: {type: boolean, description: "Look through everything under the folder, not just one level; refused past 5000 entries"}
run: bin/status
timeout: 2m
- name: backups
description: List what sync has kept for a lerd site, files a push or pull replaced on either side, the server's database backups and lerd's snapshots of the local database, each with the id to restore it by. Read only; restoring is for the user, from the terminal or the Sync tab
input_schema:
type: object
required: [site]
properties:
site: {type: string, description: lerd site name}
env: {type: string, description: "Environment whose server backups to list; needed only when the site has more than one"}
run: bin/backups
timeout: 2m
requires: [ssh, rsync, diff]
api:
- path: state
methods: [GET]
run: bin/api
loopback_only: true
- path: ls
methods: [GET]
run: bin/api
loopback_only: true
- path: count
methods: [GET]
run: bin/api
loopback_only: true
- path: file
methods: [GET]
run: bin/api
loopback_only: true
- path: backups
methods: [GET]
run: bin/api
loopback_only: true
- path: scrub
methods: [GET]
run: bin/api
loopback_only: true
- path: env
methods: [POST]
run: bin/api
loopback_only: true
- path: run
methods: [POST]
run: bin/api
loopback_only: true
timeout: 10m
ui:
site_tab: {title: Sync, entry: ui/site.html}