@mohamed1_1ibrahim/dcli 1.1.0 → 1.1.1

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.
Files changed (2) hide show
  1. package/README.md +92 -7
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -11,6 +11,13 @@
11
11
  - **add** — Register a database URI in the auto-ping list (with optional name)
12
12
  - **remove** — Remove a database by URI or friendly name
13
13
  - **auto-ping** — Schedule `dcli ping` to run automatically on Windows logon
14
+ - **view** — Browse collections and documents in a styled table
15
+ - **show** — Display the auto-ping or auto-clone database list
16
+ - **clone-add** — Register a database URI in the auto-clone list
17
+ - **clone-remove** — Remove a database from the auto-clone list
18
+ - **clone** — Clone a single database by friendly name to JSON
19
+ - **auto-clone** — Clone all databases in the clone list to JSON files
20
+ - **gui** — Launch the web GUI in your browser
14
21
 
15
22
  ## Installation
16
23
 
@@ -103,17 +110,93 @@ dcli remove dbName # remove by friendly name
103
110
 
104
111
  ### auto-ping
105
112
 
106
- Schedule `dcli ping` to run automatically 5 minutes after Windows logon.
107
- Requires administrator privileges to create the task.
113
+ Schedule `dcli ping` to run automatically. Requires administrator privileges.
108
114
 
109
115
  ```bash
110
- dcli auto-ping # create the task (run terminal as Admin)
111
- dcli auto-ping --remove # remove the task (run terminal as Admin)
116
+ dcli auto-ping # ONLOGON, 5 min delay (default)
117
+ dcli auto-ping --remove # remove the task
118
+ dcli auto-ping --schedule DAILY --at 09:00
119
+ dcli auto-ping --schedule HOURLY --every 2
120
+ dcli auto-ping --schedule ONCE --at 18:00
121
+ dcli auto-ping --schedule ONLOGON --delay 10
112
122
  ```
113
123
 
114
- ## Config File
124
+ | Option | Description |
125
+ |--------|-------------|
126
+ | `--remove` | Remove the scheduled task |
127
+ | `--schedule <type>` | `ONLOGON`, `DAILY`, `HOURLY`, or `ONCE` (default: `ONLOGON`) |
128
+ | `--at <time>` | Time for `DAILY`/`ONCE` schedules (24h, e.g. `09:00`) |
129
+ | `--every <n>` | Interval in hours for `HOURLY` (default: 1) |
130
+ | `--delay <n>` | Delay in minutes for `ONLOGON` (default: 5) |
131
+
132
+ ### view
133
+
134
+ Browse collections and documents in a styled table.
135
+
136
+ ```bash
137
+ dcli view "mongodb://localhost:27017/mydb" # list collections
138
+ dcli view "mongodb://localhost:27017/mydb" users # browse documents
139
+ dcli view "mongodb://..." users --limit 5
140
+ dcli view "mongodb://..." users --fields name,email --sort name
141
+ dcli view "mongodb://..." users --all --json
142
+ ```
143
+
144
+ | Option | Description |
145
+ |--------|-------------|
146
+ | `--limit <n>` | Maximum documents (default: 10) |
147
+ | `--fields <fields>` | Comma-separated fields to display |
148
+ | `--sort <field>` | Sort ascending by field |
149
+ | `--all` | Show all documents (no limit) |
150
+ | `--json` | Output raw JSON instead of a table |
115
151
 
116
- `~/.dcli/refresh.json`:
152
+ ### show
153
+
154
+ Display the auto-ping or auto-clone database list.
155
+
156
+ ```bash
157
+ dcli show # show ping list (~/.dcli/refresh.json)
158
+ dcli show --clone # show clone list (~/.dcli/auto-clone.json)
159
+ ```
160
+
161
+ ### clone-add / clone-remove
162
+
163
+ Manage the auto-clone list (`~/.dcli/auto-clone.json`).
164
+
165
+ ```bash
166
+ dcli clone-add "mongodb://..." -n dbName
167
+ dcli clone-remove dbName
168
+ ```
169
+
170
+ ### clone
171
+
172
+ Clone a single database from the clone list to a JSON file.
173
+
174
+ ```bash
175
+ dcli clone dbName
176
+ dcli clone dbName -o ./backups
177
+ ```
178
+
179
+ ### auto-clone
180
+
181
+ Clone all databases in the clone list to JSON files.
182
+
183
+ ```bash
184
+ dcli auto-clone
185
+ dcli auto-clone -o ./backups
186
+ ```
187
+
188
+ ### gui
189
+
190
+ Launch the web GUI in your browser (port defaults to 3456).
191
+
192
+ ```bash
193
+ dcli gui
194
+ dcli gui -p 8080
195
+ ```
196
+
197
+ ## Config Files
198
+
199
+ **Ping list** — `~/.dcli/refresh.json`:
117
200
 
118
201
  ```json
119
202
  {
@@ -124,7 +207,9 @@ dcli auto-ping --remove # remove the task (run terminal as Admin)
124
207
  }
125
208
  ```
126
209
 
127
- Entries can be objects with `uri` and optional `name`, or plain strings (backward compatible).
210
+ **Clone list** `~/.dcli/auto-clone.json` (same format as above).
211
+
212
+ Entries can be objects with `uri` and optional `name`, or plain strings (backward compatible). Many commands also accept a **friendly name** in place of a URI (e.g. `dcli ping dbName`).
128
213
 
129
214
  ## Export Format
130
215
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mohamed1_1ibrahim/dcli",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Database CLI - MongoDB data management tool (export, import, ping, info)",
5
5
  "main": "src/main.js",
6
6
  "bin": {