plugship 1.0.1 → 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 -101
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,173 +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.
|
|
25
|
-
3.
|
|
21
|
+
1. Go to **Plugins > Add New > Upload Plugin** in WordPress admin
|
|
22
|
+
2. Upload the ZIP file
|
|
23
|
+
3. Activate **PlugShip Receiver**
|
|
26
24
|
|
|
27
|
-
###
|
|
28
|
-
|
|
29
|
-
1. Go to **Users > Profile** in WordPress admin
|
|
30
|
-
2. Scroll to **Application Passwords**
|
|
31
|
-
3. Enter a name (e.g. "plugship") and click **Add New Application Password**
|
|
32
|
-
4. Copy the generated password
|
|
33
|
-
|
|
34
|
-
### 3. Configure a Site
|
|
25
|
+
### 3. Configure Your Site
|
|
35
26
|
|
|
36
27
|
```bash
|
|
37
28
|
plugship init
|
|
38
29
|
```
|
|
39
30
|
|
|
40
|
-
You
|
|
41
|
-
|
|
42
|
-
-
|
|
43
|
-
-
|
|
44
|
-
-
|
|
45
|
-
- **Application password** — the password from step 2
|
|
46
|
-
|
|
47
|
-
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)
|
|
48
36
|
|
|
49
|
-
|
|
37
|
+
### 4. Deploy
|
|
50
38
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
Navigate to your WordPress plugin directory and run:
|
|
39
|
+
Navigate to your plugin directory and run:
|
|
54
40
|
|
|
55
41
|
```bash
|
|
56
42
|
plugship deploy
|
|
57
43
|
```
|
|
58
44
|
|
|
59
|
-
|
|
45
|
+
Done! Your plugin is deployed and activated.
|
|
46
|
+
|
|
47
|
+
---
|
|
60
48
|
|
|
61
|
-
|
|
62
|
-
2. Create a ZIP archive in the `build/` directory
|
|
63
|
-
3. Upload and install the plugin on the remote site
|
|
64
|
-
4. Activate the plugin
|
|
49
|
+
## Commands
|
|
65
50
|
|
|
66
|
-
|
|
51
|
+
### `plugship deploy`
|
|
67
52
|
|
|
68
|
-
|
|
53
|
+
Deploy the plugin from the current directory.
|
|
69
54
|
|
|
70
55
|
```bash
|
|
71
|
-
plugship deploy
|
|
72
|
-
plugship deploy --
|
|
73
|
-
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
|
|
74
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
|
|
75
61
|
```
|
|
76
62
|
|
|
77
|
-
###
|
|
63
|
+
### `plugship init`
|
|
78
64
|
|
|
79
|
-
|
|
65
|
+
Add a new WordPress site.
|
|
80
66
|
|
|
81
67
|
```bash
|
|
82
|
-
plugship
|
|
83
|
-
plugship status --site <name> # Check a specific site
|
|
68
|
+
plugship init
|
|
84
69
|
```
|
|
85
70
|
|
|
86
|
-
###
|
|
71
|
+
### `plugship status`
|
|
72
|
+
|
|
73
|
+
Check if a site is ready for deployment.
|
|
87
74
|
|
|
88
75
|
```bash
|
|
89
|
-
plugship
|
|
90
|
-
plugship
|
|
91
|
-
plugship sites set-default <name> # Set the default site
|
|
76
|
+
plugship status # Check default site
|
|
77
|
+
plugship status --site staging # Check specific site
|
|
92
78
|
```
|
|
93
79
|
|
|
94
|
-
|
|
80
|
+
### `plugship sites`
|
|
95
81
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
| `plugship sites list` | List all saved sites |
|
|
104
|
-
| `plugship sites remove <name>` | Remove a saved site |
|
|
105
|
-
| `plugship sites set-default <name>` | Set the default site |
|
|
106
|
-
| `plugship ignore` | Create `.plugshipignore` with default template |
|
|
107
|
-
| `plugship ignore <patterns...>` | Add patterns to `.plugshipignore` |
|
|
108
|
-
| `plugship --help` | Show help |
|
|
109
|
-
| `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
|
+
```
|
|
110
89
|
|
|
111
|
-
|
|
90
|
+
### `plugship ignore`
|
|
112
91
|
|
|
113
|
-
|
|
92
|
+
Exclude files from deployment.
|
|
114
93
|
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* Plugin Name: My Plugin
|
|
119
|
-
* Version: 1.0.0
|
|
120
|
-
* Text Domain: my-plugin
|
|
121
|
-
*/
|
|
94
|
+
```bash
|
|
95
|
+
plugship ignore # Create .plugshipignore template
|
|
96
|
+
plugship ignore "src/**" "*.map" # Add patterns
|
|
122
97
|
```
|
|
123
98
|
|
|
124
|
-
|
|
99
|
+
---
|
|
125
100
|
|
|
126
101
|
## Ignoring Files
|
|
127
102
|
|
|
128
|
-
|
|
103
|
+
Create a `.plugshipignore` file to exclude files from deployment:
|
|
129
104
|
|
|
130
105
|
```bash
|
|
131
106
|
plugship ignore
|
|
132
107
|
```
|
|
133
108
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
```bash
|
|
137
|
-
plugship ignore "src/**" "*.map" composer.json
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
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:
|
|
141
110
|
|
|
142
111
|
```
|
|
143
112
|
# .plugshipignore
|
|
144
113
|
src/**
|
|
145
|
-
|
|
146
|
-
webpack.config.js
|
|
114
|
+
*.map
|
|
147
115
|
package.json
|
|
148
|
-
package-lock.json
|
|
149
116
|
composer.json
|
|
150
|
-
|
|
151
|
-
|
|
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
|
|
152
143
|
```
|
|
153
144
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
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
|
+
---
|
|
158
172
|
|
|
159
|
-
|
|
173
|
+
## Security
|
|
160
174
|
|
|
161
|
-
|
|
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
|
+
---
|
|
162
181
|
|
|
163
182
|
## Configuration
|
|
164
183
|
|
|
165
|
-
|
|
184
|
+
Config file: `~/.plugship/config.json`
|
|
166
185
|
|
|
167
186
|
```json
|
|
168
187
|
{
|
|
169
|
-
"defaultSite": "
|
|
188
|
+
"defaultSite": "production",
|
|
170
189
|
"sites": {
|
|
190
|
+
"production": {
|
|
191
|
+
"url": "https://example.com",
|
|
192
|
+
"username": "admin",
|
|
193
|
+
"appPassword": "xxxx xxxx xxxx xxxx"
|
|
194
|
+
},
|
|
171
195
|
"staging": {
|
|
172
196
|
"url": "https://staging.example.com",
|
|
173
197
|
"username": "admin",
|
|
@@ -177,14 +201,42 @@ Site credentials are stored in `~/.plugship/config.json` with `0600` file permis
|
|
|
177
201
|
}
|
|
178
202
|
```
|
|
179
203
|
|
|
180
|
-
|
|
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
|
+
---
|
|
181
232
|
|
|
182
|
-
|
|
233
|
+
## Links
|
|
183
234
|
|
|
184
|
-
-
|
|
185
|
-
-
|
|
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)
|
|
186
238
|
|
|
187
|
-
|
|
239
|
+
---
|
|
188
240
|
|
|
189
241
|
## License
|
|
190
242
|
|