plugship 1.0.0 → 1.0.2
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.
- package/README.md +153 -100
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,172 +1,197 @@
|
|
|
1
1
|
# plugship
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> Deploy WordPress plugins from your terminal to any WordPress site instantly.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
A simple CLI tool to deploy local WordPress plugins to remote WordPress sites. No FTP, no cPanel — just `plugship deploy`.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- A WordPress site with REST API enabled
|
|
9
|
-
- An Administrator account with an [Application Password](https://make.wordpress.org/core/2020/11/05/application-passwords-integration-guide/)
|
|
7
|
+
## Quick Start
|
|
10
8
|
|
|
11
|
-
|
|
9
|
+
### 1. Install
|
|
12
10
|
|
|
13
11
|
```bash
|
|
14
12
|
npm install -g plugship
|
|
15
13
|
```
|
|
16
14
|
|
|
17
|
-
|
|
15
|
+
### 2. Install Receiver Plugin
|
|
18
16
|
|
|
19
|
-
|
|
17
|
+
Download and install the companion plugin on your WordPress site:
|
|
20
18
|
|
|
21
|
-
|
|
19
|
+
**[Download plugship-receiver.zip](https://github.com/shamim0902/plugship-receiver/releases/latest/download/plugship-receiver.zip)**
|
|
22
20
|
|
|
23
|
-
1.
|
|
24
|
-
2.
|
|
21
|
+
1. Go to **Plugins > Add New > Upload Plugin** in WordPress admin
|
|
22
|
+
2. Upload the ZIP file
|
|
23
|
+
3. Activate **PlugShip Receiver**
|
|
25
24
|
|
|
26
|
-
###
|
|
27
|
-
|
|
28
|
-
1. Go to **Users > Profile** in WordPress admin
|
|
29
|
-
2. Scroll to **Application Passwords**
|
|
30
|
-
3. Enter a name (e.g. "plugship") and click **Add New Application Password**
|
|
31
|
-
4. Copy the generated password
|
|
32
|
-
|
|
33
|
-
### 3. Configure a Site
|
|
25
|
+
### 3. Configure Your Site
|
|
34
26
|
|
|
35
27
|
```bash
|
|
36
28
|
plugship init
|
|
37
29
|
```
|
|
38
30
|
|
|
39
|
-
You
|
|
40
|
-
|
|
41
|
-
-
|
|
42
|
-
-
|
|
43
|
-
-
|
|
44
|
-
- **Application password** — the password from step 2
|
|
45
|
-
|
|
46
|
-
The command will verify the connection, credentials, and receiver plugin status.
|
|
31
|
+
You'll be prompted for:
|
|
32
|
+
- Site alias (e.g., "production")
|
|
33
|
+
- WordPress site URL
|
|
34
|
+
- Admin username
|
|
35
|
+
- [Application Password](https://make.wordpress.org/core/2020/11/05/application-passwords-integration-guide/) (create one in Users > Profile)
|
|
47
36
|
|
|
48
|
-
|
|
37
|
+
### 4. Deploy
|
|
49
38
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
Navigate to your WordPress plugin directory and run:
|
|
39
|
+
Navigate to your plugin directory and run:
|
|
53
40
|
|
|
54
41
|
```bash
|
|
55
42
|
plugship deploy
|
|
56
43
|
```
|
|
57
44
|
|
|
58
|
-
|
|
45
|
+
Done! Your plugin is deployed and activated.
|
|
46
|
+
|
|
47
|
+
---
|
|
59
48
|
|
|
60
|
-
|
|
61
|
-
2. Create a ZIP archive in the `build/` directory
|
|
62
|
-
3. Upload and install the plugin on the remote site
|
|
63
|
-
4. Activate the plugin
|
|
49
|
+
## Commands
|
|
64
50
|
|
|
65
|
-
|
|
51
|
+
### `plugship deploy`
|
|
66
52
|
|
|
67
|
-
|
|
53
|
+
Deploy the plugin from the current directory.
|
|
68
54
|
|
|
69
55
|
```bash
|
|
70
|
-
plugship deploy
|
|
71
|
-
plugship deploy --
|
|
72
|
-
plugship deploy --dry-run # Preview what would be deployed without uploading
|
|
56
|
+
plugship deploy # Deploy to default site
|
|
57
|
+
plugship deploy --site staging # Deploy to specific site
|
|
73
58
|
plugship deploy --all # Deploy to all configured sites
|
|
59
|
+
plugship deploy --dry-run # Preview without uploading
|
|
60
|
+
plugship deploy --no-activate # Deploy without activating
|
|
74
61
|
```
|
|
75
62
|
|
|
76
|
-
###
|
|
63
|
+
### `plugship init`
|
|
77
64
|
|
|
78
|
-
|
|
65
|
+
Add a new WordPress site.
|
|
79
66
|
|
|
80
67
|
```bash
|
|
81
|
-
plugship
|
|
82
|
-
plugship status --site <name> # Check a specific site
|
|
68
|
+
plugship init
|
|
83
69
|
```
|
|
84
70
|
|
|
85
|
-
###
|
|
71
|
+
### `plugship status`
|
|
72
|
+
|
|
73
|
+
Check if a site is ready for deployment.
|
|
86
74
|
|
|
87
75
|
```bash
|
|
88
|
-
plugship
|
|
89
|
-
plugship
|
|
90
|
-
plugship sites set-default <name> # Set the default site
|
|
76
|
+
plugship status # Check default site
|
|
77
|
+
plugship status --site staging # Check specific site
|
|
91
78
|
```
|
|
92
79
|
|
|
93
|
-
|
|
80
|
+
### `plugship sites`
|
|
94
81
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
| `plugship sites list` | List all saved sites |
|
|
103
|
-
| `plugship sites remove <name>` | Remove a saved site |
|
|
104
|
-
| `plugship sites set-default <name>` | Set the default site |
|
|
105
|
-
| `plugship ignore` | Create `.plugshipignore` with default template |
|
|
106
|
-
| `plugship ignore <patterns...>` | Add patterns to `.plugshipignore` |
|
|
107
|
-
| `plugship --help` | Show help |
|
|
108
|
-
| `plugship --version` | Show version |
|
|
82
|
+
Manage your saved sites.
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
plugship sites list # List all sites
|
|
86
|
+
plugship sites set-default staging # Set default site
|
|
87
|
+
plugship sites remove staging # Remove a site
|
|
88
|
+
```
|
|
109
89
|
|
|
110
|
-
|
|
90
|
+
### `plugship ignore`
|
|
111
91
|
|
|
112
|
-
|
|
92
|
+
Exclude files from deployment.
|
|
113
93
|
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* Plugin Name: My Plugin
|
|
118
|
-
* Version: 1.0.0
|
|
119
|
-
* Text Domain: my-plugin
|
|
120
|
-
*/
|
|
94
|
+
```bash
|
|
95
|
+
plugship ignore # Create .plugshipignore template
|
|
96
|
+
plugship ignore "src/**" "*.map" # Add patterns
|
|
121
97
|
```
|
|
122
98
|
|
|
123
|
-
|
|
99
|
+
---
|
|
124
100
|
|
|
125
101
|
## Ignoring Files
|
|
126
102
|
|
|
127
|
-
|
|
103
|
+
Create a `.plugshipignore` file to exclude files from deployment:
|
|
128
104
|
|
|
129
105
|
```bash
|
|
130
106
|
plugship ignore
|
|
131
107
|
```
|
|
132
108
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
```bash
|
|
136
|
-
plugship ignore "src/**" "*.map" composer.json
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
You can also manually create or edit `.plugshipignore` in your plugin directory to exclude files and folders from the deployment ZIP:
|
|
109
|
+
This creates a template with common exclusions. Edit it to add your own:
|
|
140
110
|
|
|
141
111
|
```
|
|
142
112
|
# .plugshipignore
|
|
143
113
|
src/**
|
|
144
|
-
|
|
145
|
-
webpack.config.js
|
|
114
|
+
*.map
|
|
146
115
|
package.json
|
|
147
|
-
package-lock.json
|
|
148
116
|
composer.json
|
|
149
|
-
|
|
150
|
-
|
|
117
|
+
webpack.config.js
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
**Already excluded by default:**
|
|
121
|
+
`node_modules`, `.git`, `.env`, `*.log`, `.vscode`, `.idea`, `tests`, `.github`, `build`
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## How It Works
|
|
126
|
+
|
|
127
|
+
1. **Detects your plugin** from the WordPress plugin header in your PHP files
|
|
128
|
+
2. **Creates a ZIP** with only the files you need (excludes dev files)
|
|
129
|
+
3. **Uploads via REST API** to the WordPress site using the receiver plugin
|
|
130
|
+
4. **Installs and activates** the plugin automatically
|
|
131
|
+
|
|
132
|
+
The [plugship-receiver](https://github.com/shamim0902/plugship-receiver) plugin adds secure REST endpoints to accept the upload. Only admin users with Application Passwords can deploy.
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## Examples
|
|
137
|
+
|
|
138
|
+
### Deploy to Staging
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
cd my-plugin/
|
|
142
|
+
plugship deploy --site staging
|
|
151
143
|
```
|
|
152
144
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
145
|
+
### Deploy to All Sites
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
plugship deploy --all
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### Preview What Would Be Deployed
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
plugship deploy --dry-run
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### Check Connection Before Deploying
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
plugship status
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## Requirements
|
|
166
|
+
|
|
167
|
+
- **Node.js** 18 or higher
|
|
168
|
+
- **WordPress** 5.8 or higher
|
|
169
|
+
- **Admin account** with Application Passwords enabled
|
|
170
|
+
|
|
171
|
+
---
|
|
157
172
|
|
|
158
|
-
|
|
173
|
+
## Security
|
|
159
174
|
|
|
160
|
-
|
|
175
|
+
- All credentials are stored locally in `~/.plugship/config.json` with `0600` permissions
|
|
176
|
+
- Uses WordPress Application Passwords (not your main password)
|
|
177
|
+
- Only users with `install_plugins` capability can deploy
|
|
178
|
+
- All uploads are authenticated via WordPress REST API
|
|
179
|
+
|
|
180
|
+
---
|
|
161
181
|
|
|
162
182
|
## Configuration
|
|
163
183
|
|
|
164
|
-
|
|
184
|
+
Config file: `~/.plugship/config.json`
|
|
165
185
|
|
|
166
186
|
```json
|
|
167
187
|
{
|
|
168
|
-
"defaultSite": "
|
|
188
|
+
"defaultSite": "production",
|
|
169
189
|
"sites": {
|
|
190
|
+
"production": {
|
|
191
|
+
"url": "https://example.com",
|
|
192
|
+
"username": "admin",
|
|
193
|
+
"appPassword": "xxxx xxxx xxxx xxxx"
|
|
194
|
+
},
|
|
170
195
|
"staging": {
|
|
171
196
|
"url": "https://staging.example.com",
|
|
172
197
|
"username": "admin",
|
|
@@ -176,14 +201,42 @@ Site credentials are stored in `~/.plugship/config.json` with `0600` file permis
|
|
|
176
201
|
}
|
|
177
202
|
```
|
|
178
203
|
|
|
179
|
-
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
## Troubleshooting
|
|
207
|
+
|
|
208
|
+
### "Receiver plugin not found"
|
|
209
|
+
|
|
210
|
+
The plugship-receiver plugin isn't active on your WordPress site.
|
|
211
|
+
|
|
212
|
+
1. Download: https://github.com/shamim0902/plugship-receiver/releases/latest/download/plugship-receiver.zip
|
|
213
|
+
2. Upload and activate in WordPress admin
|
|
214
|
+
|
|
215
|
+
### "Authentication failed"
|
|
216
|
+
|
|
217
|
+
Your Application Password is incorrect.
|
|
218
|
+
|
|
219
|
+
1. Go to **Users > Profile** in WordPress admin
|
|
220
|
+
2. Generate a new Application Password
|
|
221
|
+
3. Run `plugship init` again
|
|
222
|
+
|
|
223
|
+
### "Cannot reach REST API"
|
|
224
|
+
|
|
225
|
+
Your WordPress REST API isn't accessible.
|
|
226
|
+
|
|
227
|
+
- Check that `https://yoursite.com/wp-json/` loads
|
|
228
|
+
- Disable security plugins temporarily to test
|
|
229
|
+
- Check for firewall/hosting restrictions
|
|
230
|
+
|
|
231
|
+
---
|
|
180
232
|
|
|
181
|
-
|
|
233
|
+
## Links
|
|
182
234
|
|
|
183
|
-
-
|
|
184
|
-
-
|
|
235
|
+
- [npm package](https://www.npmjs.com/package/plugship)
|
|
236
|
+
- [Receiver plugin](https://github.com/shamim0902/plugship-receiver)
|
|
237
|
+
- [Report issues](https://github.com/shamim0902/plugship/issues)
|
|
185
238
|
|
|
186
|
-
|
|
239
|
+
---
|
|
187
240
|
|
|
188
241
|
## License
|
|
189
242
|
|