hsync-cli 1.0.0 → 1.0.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 +152 -0
  2. package/package.json +1 -1
package/README.md ADDED
@@ -0,0 +1,152 @@
1
+ # hsync-cli
2
+
3
+ > Premium, zero-dependency cross-device file synchronization and storage manager terminal client.
4
+
5
+ `hsync-cli` is a powerful, lightweight command-line companion for **File Sync V2**. It allows you to manage buckets, transfer files, and orchestrate automated, real-time bidirectional synchronization directly from your terminal.
6
+
7
+ ---
8
+
9
+ ## 🚀 Installation
10
+
11
+ Install the package globally via your preferred Node package manager:
12
+
13
+ ```bash
14
+ npm install -g hsync-cli
15
+ ```
16
+
17
+ *Note: Once installed, the `hsync` command will be globally symlinked to your shell environment.*
18
+
19
+ ---
20
+
21
+ ## 🛠️ Setup & Authentication
22
+
23
+ Before running synchronization tasks, configure the CLI to target your Express API server and authenticate.
24
+
25
+ ### 1. Set API Server Target
26
+ Specify the URL of the running File Sync V2 API server:
27
+ ```bash
28
+ hsync config set-server http://localhost:3000
29
+ ```
30
+
31
+ ### 2. Login & Authenticate
32
+ Log in securely to generate and download your persistent personal API key (`X-API-Key`):
33
+ ```bash
34
+ hsync login
35
+ ```
36
+ *Note: You can skip interactive prompts in script/headless environments by passing a pre-generated API key directly:*
37
+ ```bash
38
+ hsync login --api-key hmd_xxxxxxxxxxxxxxxxxxxx
39
+ ```
40
+
41
+ ### 3. Check Connection
42
+ Verify your authenticated session details:
43
+ ```bash
44
+ hsync me
45
+ ```
46
+
47
+ ### 4. Logout
48
+ Remove credentials and invalidate the active API key session locally:
49
+ ```bash
50
+ hsync logout
51
+ ```
52
+
53
+ ---
54
+
55
+ ## 📁 Managing Storage Buckets
56
+
57
+ Storage buckets are logical sandboxes backed by pluggable providers (Local folders or Amazon S3 buckets).
58
+
59
+ ### List Buckets
60
+ See all buckets registered under your account:
61
+ ```bash
62
+ hsync bucket list
63
+ ```
64
+
65
+ ### Create a Bucket
66
+ Register a new storage sandbox:
67
+ ```bash
68
+ # Create a Local folder provider bucket
69
+ hsync bucket create "My Projects" my-projects --provider local --rootPath /data/my-projects
70
+
71
+ # Create an Amazon S3 provider bucket
72
+ hsync bucket create "Cloud Backups" backups --provider s3 --bucket my-aws-s3-bucket-name
73
+ ```
74
+
75
+ ### Delete a Bucket
76
+ Permanently destroy a storage bucket (this also wipes files inside):
77
+ ```bash
78
+ hsync bucket delete my-projects
79
+ ```
80
+
81
+ ---
82
+
83
+ ## ⚡ Direct File Transfers (Push & Pull)
84
+
85
+ You can run immediate, one-off file or folder transfers without setting up persistent schedules.
86
+
87
+ ### Push (Upload to Server)
88
+ Upload a local folder or file to a specific remote bucket target (e.g. `bucket-slug:optional-remote-path`):
89
+ ```bash
90
+ hsync push ./my-local-code projects-bucket:active-source
91
+ ```
92
+ *Tip: Skip conflict resolution prompts and force overwrites using `-y` or `--yes`:*
93
+ ```bash
94
+ hsync push ./my-local-code projects-bucket:active-source --yes
95
+ ```
96
+
97
+ ### Pull (Download to Machine)
98
+ Download a folder or file from a remote bucket directly to your local machine:
99
+ ```bash
100
+ hsync pull projects-bucket:active-source ./downloaded-code
101
+ ```
102
+
103
+ ---
104
+
105
+ ## 🔄 Automated Folder Synchronization
106
+
107
+ The sync engine uses local SQLite trackers to orchestrate continuous synchronization cycles, keeping folders on multiple devices automatically in sync with the remote server.
108
+
109
+ ### 1. Register a Sync Profile
110
+ Define a persistent local-to-remote folder synchronization job:
111
+ ```bash
112
+ hsync sync add /path/to/local/dir bucket-slug:remote-path \
113
+ --name project-sync \
114
+ --direction bidirectional \
115
+ --strategy newer-wins \
116
+ --interval 10
117
+ ```
118
+
119
+ #### Sync Config Flags:
120
+ * `-n, --name <jobName>`: A unique name identifier for your job.
121
+ * `-d, --direction <push|pull|bidirectional>`: Sync direction format.
122
+ * `-s, --strategy <local-wins|server-wins|newer-wins>`: Rules on resolving file modifications conflicts.
123
+ * `-i, --interval <seconds>`: Frequency of the background scan cycle (default: `10` seconds).
124
+ * `--no-conflict-copy`: Disable saving conflict backup files (`filename.conflict-YYYY-MM-DD.ext`).
125
+
126
+ ### 2. List Registered Sync Jobs
127
+ List all synchronization jobs configured on your machine:
128
+ ```bash
129
+ hsync sync list
130
+ ```
131
+
132
+ ### 3. Remove a Sync Job
133
+ Stop tracking a registered sync job:
134
+ ```bash
135
+ hsync sync remove project-sync
136
+ ```
137
+
138
+ ### 4. Start the Synchronization Scheduler
139
+ Launch the active sync loop to scan and synchronize folders automatically in the background:
140
+ ```bash
141
+ # Start all registered sync jobs
142
+ hsync sync start
143
+
144
+ # Start a specific sync job by name
145
+ hsync sync start project-sync
146
+ ```
147
+
148
+ ---
149
+
150
+ ## 🛡️ License
151
+
152
+ MIT License. Designed with antigravity by the Advanced Agentic Coding team.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hsync-cli",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "hsync CLI for file sync operations",
5
5
  "bin": {
6
6
  "hsync": "./dist/bin.js"