@nightowne/tas-cli 1.1.1 → 2.1.0

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 CHANGED
@@ -1,14 +1,25 @@
1
- # TAS — Telegram as Storage
1
+ <p align="center">
2
+ <img src="assets/demo.gif" alt="TAS Demo" width="600">
3
+ </p>
2
4
 
3
- [![CI](https://github.com/ixchio/tas/actions/workflows/ci.yml/badge.svg)](https://github.com/ixchio/tas/actions/workflows/ci.yml)
4
- [![npm](https://img.shields.io/npm/v/@nightowne/tas-cli)](https://www.npmjs.com/package/@nightowne/tas-cli)
5
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
+ <h1 align="center">Telegram as Storage</h1>
6
6
 
7
7
  <p align="center">
8
- <img src="assets/demo.gif" alt="TAS Demo" width="600">
8
+ <strong>Free, encrypted, unlimited cloud storage — inside Telegram.</strong>
9
+ </p>
10
+
11
+ <p align="center">
12
+ <a href="https://github.com/ixchio/tas/actions/workflows/ci.yml"><img src="https://github.com/ixchio/tas/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
13
+ <a href="https://www.npmjs.com/package/@nightowne/tas-cli"><img src="https://img.shields.io/npm/v/@nightowne/tas-cli" alt="npm"></a>
14
+ <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"></a>
15
+ <a href="https://www.npmjs.com/package/@nightowne/tas-cli"><img src="https://img.shields.io/npm/dm/@nightowne/tas-cli" alt="Downloads"></a>
9
16
  </p>
10
17
 
11
- A CLI tool that uses your Telegram bot as encrypted file storage. Files are compressed, encrypted locally, then uploaded to your private bot chat.
18
+ ---
19
+
20
+ I built this because I wanted encrypted cloud storage that's actually free. Google Drive reads your files. Dropbox costs money. Telegram gives you unlimited storage with a bot API — so I wrote a CLI that turns it into a proper encrypted drive.
21
+
22
+ **What this does:** Compresses, encrypts (AES-256-GCM), and uploads your files to your own private Telegram bot chat. Mount it as a folder, sync directories, or share files with expiring links.
12
23
 
13
24
  ```
14
25
  ┌─────────────┐ ┌───────────────┐ ┌──────────────┐
@@ -22,136 +33,130 @@ A CLI tool that uses your Telegram bot as encrypted file storage. Files are comp
22
33
  └─────────────┘ └───────────────┘ └──────────────┘
23
34
  ```
24
35
 
25
- ## Why TAS?
26
-
27
- | Feature | TAS | Session-based tools (e.g. teldrive) |
28
- |---------|:---:|:-----------------------------------:|
29
- | Account ban risk | **None** (Bot API) | High (session hijack detection) |
30
- | Encryption | AES-256-GCM | Usually none |
31
- | Dependencies | SQLite only | Rclone, external DB |
32
- | Setup complexity | 2 minutes | Docker + multiple services |
36
+ ## Quick Start
33
37
 
34
- **Key differences:**
35
- - Uses **Bot API**, not session-based auth — Telegram can't ban your account
36
- - **Encryption by default** — files encrypted before leaving your machine
37
- - **Local-first** — SQLite index, no cloud dependencies
38
- - **FUSE mount** — use Telegram like a folder
39
-
40
- ## Security Model
41
-
42
- | Component | Implementation |
43
- |-----------|----------------|
44
- | Cipher | AES-256-GCM |
45
- | Key derivation | PBKDF2-SHA512, 100,000 iterations |
46
- | Salt | 32 bytes, random per file |
47
- | IV | 12 bytes, random per file |
48
- | Auth tag | 16 bytes (integrity) |
49
-
50
- Your password never leaves your machine. Telegram stores encrypted blobs.
38
+ ```bash
39
+ npm install -g @nightowne/tas-cli
40
+ tas init # 2-minute setup wizard
41
+ tas push secret.pdf
42
+ tas pull secret.pdf
43
+ ```
51
44
 
52
- ## Limitations
45
+ ## 🔥 Features
53
46
 
54
- - **Not a backup** — Telegram can delete content without notice
55
- - **No versioning** — overwriting a file deletes the old version
56
- - **49MB chunks** files split due to Bot API limits
57
- - **FUSE required** — mount feature needs `libfuse` on Linux/macOS
58
- - **Single user** — designed for personal use, not multi-tenant
47
+ ### Mount as a folder
48
+ ```bash
49
+ tas mount ~/cloud # FUSE mount drag & drop files
50
+ tas unmount ~/cloud
51
+ ```
52
+ Requires `libfuse` (`apt install fuse libfuse-dev` on Debian/Ubuntu, `brew install macfuse` on macOS).
59
53
 
60
- ## Quick Start
54
+ ### Auto-sync folders
55
+ ```bash
56
+ tas sync add ~/Documents # Register
57
+ tas sync start # Watch for changes, auto-upload
58
+ tas sync pull # Download everything back
59
+ ```
61
60
 
61
+ ### Share files with expiring links
62
62
  ```bash
63
- # Install
64
- npm install -g @nightowne/tas-cli
63
+ tas share create secret.pdf --expire 1h --max-downloads 3
64
+ # http://localhost:3000/d/a1b2c3d4...
65
65
 
66
- # Setup (creates bot connection + encryption password)
67
- tas init
66
+ tas share list # Active shares
67
+ tas share revoke a1b2c3d4 # Revoke
68
+ ```
69
+ Spins up a local HTTP server. File is downloaded from Telegram, decrypted, and served. Dark-themed download page with file info.
68
70
 
69
- # Upload a file
70
- tas push secret.pdf
71
+ ## 🛡️ Security
71
72
 
72
- # Download a file
73
- tas pull secret.pdf
73
+ | Component | Implementation |
74
+ |-----------|----------------|
75
+ | Cipher | AES-256-GCM |
76
+ | Key derivation | PBKDF2-SHA512, 100k iterations |
77
+ | Salt | 32 bytes, random per file |
78
+ | IV | 12 bytes, random per file |
79
+ | Auth tag | 16 bytes (integrity verification) |
74
80
 
75
- # Mount as folder (requires libfuse)
76
- tas mount ~/cloud
77
- ```
81
+ Your password **never** leaves your machine. Telegram only sees encrypted blobs. Even if someone accesses your bot chat, they get meaningless data without your password.
78
82
 
79
- ### Prerequisites
80
- - Node.js ≥18
81
- - Telegram account + bot token from [@BotFather](https://t.me/BotFather)
82
- - `libfuse` for mount feature:
83
- ```bash
84
- # Debian/Ubuntu
85
- sudo apt install fuse libfuse-dev
86
-
87
- # Fedora
88
- sudo dnf install fuse fuse-devel
89
-
90
- # macOS
91
- brew install macfuse
92
- ```
93
-
94
- ## CLI Reference
83
+ ## 📋 Full CLI Reference
95
84
 
96
85
  ```bash
97
86
  # Core
98
87
  tas init # Setup wizard
99
- tas push <file> # Upload file
100
- tas pull <file|hash> # Download file
101
- tas list [-l] # List files (long format)
102
- tas delete <file|hash> # Remove file
103
- tas status # Show stats
104
-
105
- # Search & Resume (v1.1.0)
106
- tas search <query> # Search by filename
107
- tas search -t <query> # Search by tag
88
+ tas push <file> # Upload
89
+ tas pull <file|hash> # Download
90
+ tas list [-l] # List files
91
+ tas delete <file|hash> # Delete
92
+ tas status # Stats
93
+ tas search <query> # Search files
108
94
  tas resume # Resume interrupted uploads
95
+ tas verify # Check integrity
109
96
 
110
97
  # FUSE Mount
111
98
  tas mount <path> # Mount as folder
112
99
  tas unmount <path> # Unmount
113
100
 
101
+ # Sync
102
+ tas sync add <folder> # Register folder
103
+ tas sync start # Start watching
104
+ tas sync pull # Download all
105
+ tas sync status # Show status
106
+
107
+ # Share
108
+ tas share create <file> # Create download link
109
+ tas share list # Active shares
110
+ tas share revoke <token> # Revoke
111
+
114
112
  # Tags
115
- tas tag add <file> <tags...> # Add tags
116
- tas tag remove <file> <tags...> # Remove tags
117
- tas tag list [tag] # List tags or files by tag
113
+ tas tag add <file> <tags...>
114
+ tas tag remove <file> <tags...>
115
+ tas tag list [tag]
116
+ ```
118
117
 
119
- # Sync (Dropbox-style)
120
- tas sync add <folder> # Register folder for sync
121
- tas sync start # Start watching
122
- tas sync pull # Download all to sync folders
123
- tas sync status # Show sync status
118
+ ## 🤖 Automation
119
+
120
+ ```bash
121
+ # Skip password prompts
122
+ export TAS_PASSWORD="your-password"
123
+ tas push file.pdf
124
124
 
125
- # Verification
126
- tas verify # Check file integrity
125
+ # Or inline
126
+ tas push -p "password" file.pdf
127
127
  ```
128
128
 
129
- ## Auto-Start (systemd)
129
+ Works with cron, GitHub Actions, Docker, or any CI/CD.
130
130
 
131
- See [systemd/README.md](systemd/README.md) for running sync as a service.
131
+ ## ⚠️ Limitations
132
+
133
+ - **Not a backup** — Telegram can delete content without notice
134
+ - **No versioning** — overwriting deletes the old version
135
+ - **49MB chunks** — files split due to Bot API limits
136
+ - **Single user** — personal use, not multi-tenant
137
+ - **FUSE required** — mount feature needs libfuse
132
138
 
133
- ## Development
139
+ ## 🛠️ Development
134
140
 
135
141
  ```bash
136
142
  git clone https://github.com/ixchio/tas
137
- cd tas
138
- npm install
139
- npm test # 28 tests
143
+ cd tas && npm install
144
+ npm test # 43 tests
140
145
  ```
141
146
 
142
- ### Project Structure
143
147
  ```
144
148
  src/
145
- ├── cli.js # Command definitions
149
+ ├── cli.js # Commands
146
150
  ├── index.js # Upload/download pipeline
147
- ├── crypto/ # AES-256-GCM encryption
148
- ├── db/ # SQLite file index
149
- ├── fuse/ # FUSE filesystem mount
151
+ ├── crypto/ # AES-256-GCM
152
+ ├── db/ # SQLite index
153
+ ├── fuse/ # FUSE filesystem
154
+ ├── share/ # HTTP share server
150
155
  ├── sync/ # Folder sync engine
151
156
  ├── telegram/ # Bot API client
152
157
  └── utils/ # Compression, chunking
153
158
  ```
154
159
 
155
- ## License
160
+ ## 📄 License
156
161
 
157
- MIT
162
+ MIT — do whatever you want with it.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nightowne/tas-cli",
3
- "version": "1.1.1",
4
- "description": "📦 Telegram as Storage - Free encrypted cloud storage via Telegram. Mount Telegram as a folder!",
3
+ "version": "2.1.0",
4
+ "description": "Telegram as Storage - Automated encrypted cloud backup. Free, encrypted, scriptable. Mount as folder or use with cron/Docker.",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
7
7
  "bin": {
@@ -54,4 +54,4 @@
54
54
  "engines": {
55
55
  "node": ">=18.0.0"
56
56
  }
57
- }
57
+ }