zammy 1.2.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Aayush Adhikari
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,349 @@
1
+ <div align="center">
2
+
3
+ # Zammy CLI
4
+
5
+ **Your slice-of-life terminal companion**
6
+
7
+ [![Tests](https://github.com/aayushadhikari7/zammy-cli/actions/workflows/test.yml/badge.svg)](https://github.com/aayushadhikari7/zammy-cli/actions/workflows/test.yml)
8
+ [![npm version](https://img.shields.io/npm/v/zammy.svg)](https://www.npmjs.com/package/zammy)
9
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
10
+ [![Node.js](https://img.shields.io/badge/node-%3E%3D18.0.0-brightgreen.svg)](https://nodejs.org/)
11
+ [![TypeScript](https://img.shields.io/badge/TypeScript-5.3-blue.svg)](https://www.typescriptlang.org/)
12
+
13
+ ```
14
+ ███████╗ █████╗ ███╗ ███╗███╗ ███╗██╗ ██╗
15
+ ╚══███╔╝██╔══██╗████╗ ████║████╗ ████║╚██╗ ██╔╝
16
+ ███╔╝ ███████║██╔████╔██║██╔████╔██║ ╚████╔╝
17
+ ███╔╝ ██╔══██║██║╚██╔╝██║██║╚██╔╝██║ ╚██╔╝
18
+ ███████╗██║ ██║██║ ╚═╝ ██║██║ ╚═╝ ██║ ██║
19
+ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝
20
+ ```
21
+
22
+ A delightful, feature-rich terminal companion that combines utility tools, fun commands, and beautiful ASCII art into an interactive CLI experience.
23
+
24
+ [Features](#features) • [Installation](#installation) • [Commands](#commands) • [Contributing](#contributing)
25
+
26
+ </div>
27
+
28
+ ---
29
+
30
+ ## Table of Contents
31
+
32
+ - [Features](#features)
33
+ - [Installation](#installation)
34
+ - [Quick Start](#quick-start)
35
+ - [Commands](#commands)
36
+ - [Utilities](#utilities)
37
+ - [Fun](#fun)
38
+ - [Creative](#creative)
39
+ - [Developer Tools](#developer-tools)
40
+ - [Info](#info)
41
+ - [Enhanced Shell Commands](#enhanced-shell-commands)
42
+ - [Interactive Features](#interactive-features)
43
+ - [Configuration](#configuration)
44
+ - [Development](#development)
45
+ - [Contributing](#contributing)
46
+ - [License](#license)
47
+
48
+ ## Features
49
+
50
+ - **Interactive Command Menu** — Type `/` to browse all commands with arrow key navigation
51
+ - **Tab Autocomplete** — Quick command completion with Tab key
52
+ - **Enhanced Shell Commands** — Supercharged `!` commands with colors, icons, and extra features
53
+ - **Beautiful ASCII Art** — Convert images to ASCII with multiple styles and edge detection
54
+ - **Rich UI** — Colorful output, box drawings, gradients, and Unicode symbols
55
+ - **Cross-Platform** — Works on Windows, macOS, and Linux
56
+ - **Fully Tested** — Comprehensive test suite with 150+ unit tests
57
+
58
+ ## Installation
59
+
60
+ ### From npm
61
+
62
+ ```bash
63
+ npm install -g zammy
64
+ ```
65
+
66
+ ### From Source
67
+
68
+ ```bash
69
+ git clone https://github.com/aayushadhikari7/zammy-cli.git
70
+ cd zammy-cli
71
+ npm install
72
+ npm run build
73
+ npm start
74
+ ```
75
+
76
+ ### Development Installation
77
+
78
+ ```bash
79
+ npm link
80
+ zammy
81
+ ```
82
+
83
+ ## Quick Start
84
+
85
+ ```bash
86
+ # Start Zammy
87
+ zammy
88
+
89
+ # Check version
90
+ zammy --version
91
+
92
+ # Force simple mode (for non-TTY terminals)
93
+ zammy --simple
94
+ ```
95
+
96
+ Once inside Zammy:
97
+
98
+ ```
99
+ zammy❯ /help # See all commands
100
+ zammy❯ /calc 2^10 # Quick math
101
+ zammy❯ /password 16 # Generate secure password
102
+ zammy❯ !ls # Enhanced file listing
103
+ zammy❯ /asciiart @img.png # Convert image to ASCII
104
+ ```
105
+
106
+ ## Commands
107
+
108
+ ### Utilities
109
+
110
+ | Command | Description |
111
+ |---------|-------------|
112
+ | `/help [cmd]` | Show all commands or get help for a specific command |
113
+ | `/exit` | Exit Zammy |
114
+ | `/calc <expr>` | Calculate math expressions (`2+2`, `2^8`, `100%7`) |
115
+ | `/password [len]` | Generate secure passwords with strength indicator |
116
+ | `/stats` | Display system statistics (CPU, memory, uptime) |
117
+ | `/time` | Show current time with ASCII clock |
118
+ | `/countdown <time>` | Start a countdown timer (`30s`, `5m`, `1h30m`) |
119
+ | `/timer [start\|stop\|lap]` | Stopwatch timer |
120
+ | `/todo [add\|done\|rm]` | Persistent todo list |
121
+ | `/history [count\|clear]` | Command history |
122
+
123
+ ### Fun
124
+
125
+ | Command | Description |
126
+ |---------|-------------|
127
+ | `/joke` | Get a random programming joke |
128
+ | `/quote` | Get an inspirational quote |
129
+ | `/fortune` | Get your fortune told (with lucky numbers!) |
130
+ | `/dice [count] [sides]` | Roll dice with ASCII art |
131
+ | `/flip [count]` | Flip coins with visual results |
132
+ | `/pomodoro [start\|stop\|status]` | Pomodoro timer (25/5 technique) |
133
+
134
+ ### Creative
135
+
136
+ | Command | Description |
137
+ |---------|-------------|
138
+ | `/asciiart <image>` | Convert images to ASCII art |
139
+ | `/figlet <text>` | Generate ASCII art text |
140
+ | `/lorem [paragraphs] [sentences]` | Generate Lorem Ipsum text |
141
+ | `/color <hex\|rgb\|random>` | Color converter with preview |
142
+
143
+ **ASCII Art Options:**
144
+
145
+ ```bash
146
+ /asciiart @photo.png --width 100 --style detailed --edges
147
+ ```
148
+
149
+ Available styles: `standard`, `detailed` (default), `blocks`, `simple`, `extended`
150
+
151
+ **Figlet Fonts:**
152
+
153
+ ```bash
154
+ /figlet Hello --font Slant
155
+ ```
156
+
157
+ Available fonts: Standard, Big, Slant, Small, Banner, Block, Bubble, Digital, Mini, Script, Shadow, Speed
158
+
159
+ ### Developer Tools
160
+
161
+ | Command | Description |
162
+ |---------|-------------|
163
+ | `/hash <algo> <text>` | Hash text (md5, sha1, sha256, sha512) |
164
+ | `/uuid [count]` | Generate UUID(s) |
165
+ | `/encode <method> <encode\|decode> <text>` | Encode/decode (base64, url, hex) |
166
+
167
+ ### Info
168
+
169
+ | Command | Description |
170
+ |---------|-------------|
171
+ | `/weather [city]` | Get current weather for a location |
172
+
173
+ ## Enhanced Shell Commands
174
+
175
+ Zammy provides **supercharged shell commands** that go beyond what a standard terminal offers. Prefix commands with `!`:
176
+
177
+ ### File Operations
178
+
179
+ | Command | Description |
180
+ |---------|-------------|
181
+ | `!ls [-la]` | Colorized file listing with file type icons and sizes |
182
+ | `!tree` | Visual directory tree with icons |
183
+ | `!cat <file>` | View files with syntax highlighting |
184
+ | `!find <pattern>` | Find files with colored results |
185
+ | `!grep <pattern>` | Search contents with highlighted matches |
186
+ | `!du` | Disk usage with visual progress bars |
187
+ | `!diff <f1> <f2>` | Compare files with colored output |
188
+
189
+ ### Navigation
190
+
191
+ | Command | Description |
192
+ |---------|-------------|
193
+ | `!cd <path>` | Change directory (supports `~` and `-`) |
194
+ | `!pwd` | Show current directory |
195
+ | `!bookmark save/go/list/del` | Directory bookmarks |
196
+
197
+ ### Developer Tools
198
+
199
+ | Command | Description |
200
+ |---------|-------------|
201
+ | `!git [status\|log\|branch]` | Enhanced git with colors |
202
+ | `!json <file>` | Pretty print JSON |
203
+ | `!http GET <url>` | Quick HTTP requests |
204
+ | `!epoch [time]` | Timestamp converter |
205
+ | `!serve [port]` | Quick HTTP server |
206
+
207
+ ### System
208
+
209
+ | Command | Description |
210
+ |---------|-------------|
211
+ | `!ip` | Show local and public IP |
212
+ | `!ps` | Process list |
213
+ | `!env [filter]` | Environment variables |
214
+ | `!clipboard copy/paste/file` | Clipboard operations |
215
+ | `!notify <message>` | Desktop notification |
216
+
217
+ ### Cross-Platform
218
+
219
+ Linux/macOS commands are automatically translated on Windows:
220
+ - `ls` → Enhanced colorized listing
221
+ - `cat` → Syntax-highlighted output
222
+ - `rm`, `cp`, `mv` → Windows equivalents
223
+ - `grep` → Enhanced search
224
+
225
+ ## Interactive Features
226
+
227
+ ### Command Browser
228
+
229
+ Type `/` or `!` to open an interactive command menu:
230
+
231
+ - **↑/↓** — Navigate through commands
232
+ - **Tab** — Select and insert command
233
+ - **Escape** — Close menu
234
+ - Type to filter commands
235
+
236
+ ### Tab Completion
237
+
238
+ ```bash
239
+ zammy❯ /asciiart @ # Press Tab to autocomplete image files
240
+ ```
241
+
242
+ ## Configuration
243
+
244
+ Zammy runs with sensible defaults:
245
+
246
+ - **Double Ctrl+C** — Required to exit (prevents accidental closure)
247
+ - **Current directory** — Respects your working directory
248
+ - **Persistent data** — Saved to `~/.zammy-todos.json` and `~/.zammy-history`
249
+
250
+ ## Development
251
+
252
+ ```bash
253
+ # Install dependencies
254
+ npm install
255
+
256
+ # Development mode (watch)
257
+ npm run dev
258
+
259
+ # Build
260
+ npm run build
261
+
262
+ # Run tests
263
+ npm test
264
+
265
+ # Run tests once
266
+ npm run test:run
267
+ ```
268
+
269
+ ### Project Structure
270
+
271
+ ```
272
+ zammy-cli/
273
+ ├── src/
274
+ │ ├── index.ts # Main entry, REPL loop
275
+ │ ├── cli.ts # Command parser, shell execution
276
+ │ ├── commands/ # CLI command definitions
277
+ │ │ ├── registry.ts # Command registration
278
+ │ │ ├── utilities/ # Utility commands
279
+ │ │ ├── fun/ # Fun commands
280
+ │ │ ├── creative/ # Creative commands
281
+ │ │ ├── dev/ # Developer commands
282
+ │ │ └── info/ # Info commands
283
+ │ ├── handlers/ # Business logic (testable)
284
+ │ │ ├── dev/ # Hash, UUID, encode logic
285
+ │ │ ├── utilities/ # Calc, password, stats logic
286
+ │ │ ├── fun/ # Dice, flip, fortune logic
287
+ │ │ └── creative/ # Lorem, color logic
288
+ │ └── ui/ # UI components
289
+ │ ├── banner.ts # Welcome screen
290
+ │ ├── colors.ts # Theme, symbols
291
+ │ └── prompt.ts # CLI prompt
292
+ ├── dist/ # Compiled output
293
+ └── package.json
294
+ ```
295
+
296
+ ### Adding New Commands
297
+
298
+ 1. Create handler in `src/handlers/<category>/`:
299
+
300
+ ```typescript
301
+ // src/handlers/utilities/myhandler.ts
302
+ export function myFunction(input: string): string {
303
+ return `Processed: ${input}`;
304
+ }
305
+ ```
306
+
307
+ 2. Create command in `src/commands/<category>/`:
308
+
309
+ ```typescript
310
+ // src/commands/utilities/mycommand.ts
311
+ import { registerCommand } from '../registry.js';
312
+ import { myFunction } from '../../handlers/utilities/myhandler.js';
313
+
314
+ registerCommand({
315
+ name: 'mycommand',
316
+ description: 'Does something cool',
317
+ usage: '/mycommand <input>',
318
+ async execute(args: string[]) {
319
+ console.log(myFunction(args[0]));
320
+ },
321
+ });
322
+ ```
323
+
324
+ 3. Import in category's `index.ts`
325
+ 4. Rebuild and run!
326
+
327
+ ## Contributing
328
+
329
+ Contributions are welcome! Please feel free to submit a Pull Request.
330
+
331
+ 1. Fork the repository
332
+ 2. Create your feature branch (`git checkout -b feature/amazing-feature`)
333
+ 3. Commit your changes (`git commit -m 'Add amazing feature'`)
334
+ 4. Push to the branch (`git push origin feature/amazing-feature`)
335
+ 5. Open a Pull Request
336
+
337
+ ## License
338
+
339
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
340
+
341
+ ---
342
+
343
+ <div align="center">
344
+
345
+ **[Back to top](#zammy-cli)**
346
+
347
+ Made with TypeScript and Node.js
348
+
349
+ </div>
@@ -0,0 +1,2 @@
1
+
2
+ export { }