harshal 0.1.0__tar.gz
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.
- harshal-0.1.0/LICENSE +21 -0
- harshal-0.1.0/PKG-INFO +154 -0
- harshal-0.1.0/README.md +111 -0
- harshal-0.1.0/pyproject.toml +73 -0
- harshal-0.1.0/src/harshal/__init__.py +2 -0
- harshal-0.1.0/src/harshal/cli.py +242 -0
- harshal-0.1.0/src/harshal/commands/__init__.py +5 -0
- harshal-0.1.0/src/harshal/commands/agent.py +321 -0
- harshal-0.1.0/src/harshal/commands/ai.py +379 -0
- harshal-0.1.0/src/harshal/commands/config_cmd.py +133 -0
- harshal-0.1.0/src/harshal/commands/creative.py +269 -0
- harshal-0.1.0/src/harshal/commands/dev_tools.py +372 -0
- harshal-0.1.0/src/harshal/commands/gamification.py +148 -0
- harshal-0.1.0/src/harshal/commands/git_cmd.py +714 -0
- harshal-0.1.0/src/harshal/commands/joy.py +125 -0
- harshal-0.1.0/src/harshal/commands/morning.py +183 -0
- harshal-0.1.0/src/harshal/commands/notes.py +313 -0
- harshal-0.1.0/src/harshal/commands/random_cmd.py +226 -0
- harshal-0.1.0/src/harshal/commands/safe_cmd.py +303 -0
- harshal-0.1.0/src/harshal/commands/search.py +134 -0
- harshal-0.1.0/src/harshal/commands/share.py +115 -0
- harshal-0.1.0/src/harshal/commands/summary.py +97 -0
- harshal-0.1.0/src/harshal/commands/system_cmd.py +375 -0
- harshal-0.1.0/src/harshal/commands/timer.py +153 -0
- harshal-0.1.0/src/harshal/commands/todo.py +315 -0
- harshal-0.1.0/src/harshal/commands/weather.py +112 -0
- harshal-0.1.0/src/harshal/core/__init__.py +5 -0
- harshal-0.1.0/src/harshal/core/ai.py +46 -0
- harshal-0.1.0/src/harshal/core/ai_engine.py +160 -0
- harshal-0.1.0/src/harshal/core/config.py +215 -0
- harshal-0.1.0/src/harshal/core/console.py +16 -0
- harshal-0.1.0/src/harshal/core/database.py +182 -0
- harshal-0.1.0/src/harshal/core/installer.py +316 -0
- harshal-0.1.0/src/harshal/core/memory.py +81 -0
- harshal-0.1.0/src/harshal/core/platform_utils.py +446 -0
- harshal-0.1.0/src/harshal/core/tools.py +237 -0
- harshal-0.1.0/src/harshal/core/xp.py +105 -0
- harshal-0.1.0/src/harshal/data/ascii_art.json +47 -0
- harshal-0.1.0/src/harshal/data/dad_jokes.json +102 -0
- harshal-0.1.0/src/harshal/data/fortunes.json +28 -0
- harshal-0.1.0/src/harshal/data/personality.toml +51 -0
- harshal-0.1.0/src/harshal/data/quotes.json +142 -0
- harshal-0.1.0/src/harshal/ui/__init__.py +1 -0
- harshal-0.1.0/src/harshal/ui/animations.py +98 -0
- harshal-0.1.0/src/harshal/ui/console.py +164 -0
- harshal-0.1.0/src/harshal/ui/panels.py +174 -0
- harshal-0.1.0/src/harshal/ui/prompts.py +195 -0
- harshal-0.1.0/src/harshal/ui/tui.py +126 -0
- harshal-0.1.0/src/harshal/ui/tui.tcss +697 -0
- harshal-0.1.0/src/harshal/ui/tui_screens/__init__.py +1 -0
- harshal-0.1.0/src/harshal/ui/tui_screens/chat.py +519 -0
- harshal-0.1.0/src/harshal/ui/tui_screens/dashboard.py +123 -0
- harshal-0.1.0/src/harshal/ui/tui_screens/game.py +585 -0
- harshal-0.1.0/src/harshal/ui/tui_screens/notes.py +208 -0
- harshal-0.1.0/src/harshal/ui/tui_screens/settings.py +251 -0
- harshal-0.1.0/src/harshal/ui/tui_screens/system.py +128 -0
- harshal-0.1.0/src/harshal/ui/tui_screens/timer.py +120 -0
- harshal-0.1.0/src/harshal/ui/tui_screens/todo.py +163 -0
harshal-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Harshal Team
|
|
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.
|
harshal-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: harshal
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A multi-personality, feature-rich companion CLI helper tool
|
|
5
|
+
Project-URL: Homepage, https://github.com/YOUR_USERNAME/harshal
|
|
6
|
+
Project-URL: Bug Tracker, https://github.com/YOUR_USERNAME/harshal/issues
|
|
7
|
+
Project-URL: Source, https://github.com/YOUR_USERNAME/harshal
|
|
8
|
+
Author-email: Harshal <your@email.com>
|
|
9
|
+
License: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: ai,cli,productivity,rich,terminal,tui,typer
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
16
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
+
Classifier: Operating System :: OS Independent
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Topic :: Terminals
|
|
23
|
+
Classifier: Topic :: Utilities
|
|
24
|
+
Requires-Python: >=3.10
|
|
25
|
+
Requires-Dist: platformdirs>=4.0
|
|
26
|
+
Requires-Dist: prompt-toolkit>=3.0
|
|
27
|
+
Requires-Dist: rich>=14.0
|
|
28
|
+
Requires-Dist: textual>=0.75.0
|
|
29
|
+
Requires-Dist: typer[all]>=0.15
|
|
30
|
+
Provides-Extra: ai
|
|
31
|
+
Requires-Dist: litellm>=1.40; extra == 'ai'
|
|
32
|
+
Provides-Extra: full
|
|
33
|
+
Requires-Dist: chime>=0.7; extra == 'full'
|
|
34
|
+
Requires-Dist: litellm>=1.40; extra == 'full'
|
|
35
|
+
Requires-Dist: psutil>=6.0; extra == 'full'
|
|
36
|
+
Requires-Dist: pyperclip>=1.9; extra == 'full'
|
|
37
|
+
Provides-Extra: notifications
|
|
38
|
+
Requires-Dist: chime>=0.7; extra == 'notifications'
|
|
39
|
+
Provides-Extra: system
|
|
40
|
+
Requires-Dist: psutil>=6.0; extra == 'system'
|
|
41
|
+
Requires-Dist: pyperclip>=1.9; extra == 'system'
|
|
42
|
+
Description-Content-Type: text/markdown
|
|
43
|
+
|
|
44
|
+
# Harshal CLI 🚀
|
|
45
|
+
|
|
46
|
+
[](https://opensource.org/licenses/MIT)
|
|
47
|
+
[](https://www.python.org/)
|
|
48
|
+
|
|
49
|
+
**Harshal CLI** is a highly interactive, customizable, and feature-rich terminal companion tool. From displaying system stats and system alerts to generating AI prompts and offering motivational quotes, Harshal adapts to your style with custom visual themes, interactive shells, and dynamic personalities.
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Features ✨
|
|
54
|
+
|
|
55
|
+
* **Multiple Personalities**: Switch between `fun`, `serious`, `cyber`, and `cute` modes.
|
|
56
|
+
* **Interactive Prompts**: Built on `prompt-toolkit` and styled with `rich` for elegant user feedback.
|
|
57
|
+
* **System Utilities**: Copy output to clipboard, get performance statistics, and run system tasks.
|
|
58
|
+
* **AI Engine Integration**: Integrated with `litellm` for direct interaction with LLMs.
|
|
59
|
+
* **Curated Data Assets**: Local stores of quotes, fortunes, dad jokes, and retro ASCII art.
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## Installation 📦
|
|
64
|
+
|
|
65
|
+
You can install Harshal CLI using `pip` or `pipx`:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
# Basic installation (includes UI, Core, and CLI shell)
|
|
69
|
+
pip install .
|
|
70
|
+
|
|
71
|
+
# Install with AI features (litellm)
|
|
72
|
+
pip install ".[ai]"
|
|
73
|
+
|
|
74
|
+
# Install with System utilities (psutil, pyperclip)
|
|
75
|
+
pip install ".[system]"
|
|
76
|
+
|
|
77
|
+
# Install with Notification sounds (chime)
|
|
78
|
+
pip install ".[notifications]"
|
|
79
|
+
|
|
80
|
+
# Install all features
|
|
81
|
+
pip install ".[full]"
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Commands and Usage 🛠️
|
|
87
|
+
|
|
88
|
+
Once installed, use the CLI via the `harshal` entrypoint:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
# Check version and verify install
|
|
92
|
+
harshal --version
|
|
93
|
+
|
|
94
|
+
# Run the main interactive prompt
|
|
95
|
+
harshal run
|
|
96
|
+
|
|
97
|
+
# Show a random curated quote
|
|
98
|
+
harshal quote
|
|
99
|
+
|
|
100
|
+
# Crack a hilarious dad joke
|
|
101
|
+
harshal joke
|
|
102
|
+
|
|
103
|
+
# Crack open a virtual fortune cookie
|
|
104
|
+
harshal fortune
|
|
105
|
+
|
|
106
|
+
# Print beautiful retro ASCII drawings
|
|
107
|
+
harshal ascii --name computer
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Options
|
|
111
|
+
|
|
112
|
+
* `--personality` (`-p`): Set the theme to `fun`, `serious`, `cyber`, or `cute`.
|
|
113
|
+
* `--version`: Show version and exit.
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## Personalities & Themes 🎨
|
|
118
|
+
|
|
119
|
+
Harshal comes loaded with four pre-configured themes defined in `src/harshal/data/personality.toml`:
|
|
120
|
+
|
|
121
|
+
1. 🎉 **Fun & Playful** (`fun`): Full of emojis, programmer jokes, and highly excited prompts.
|
|
122
|
+
2. 💼 **Professional & Stoic** (`serious`): Direct, concise, objective, and stoic.
|
|
123
|
+
3. 💻 **Cyberpunk Hacker** (`cyber`): Neon-green cyberpunk theme talking in terminal nodes and decrypt payloads.
|
|
124
|
+
4. 🌸 **Cute & Cozy** (`cute`): Gentle, cozy, supportive text-emoticons `(* ^ ω ^)` and pastel magenta palettes.
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## Project Structure 📁
|
|
129
|
+
|
|
130
|
+
```text
|
|
131
|
+
harshal/
|
|
132
|
+
├── pyproject.toml
|
|
133
|
+
├── LICENSE
|
|
134
|
+
├── README.md
|
|
135
|
+
└── src/
|
|
136
|
+
└── harshal/
|
|
137
|
+
├── __init__.py
|
|
138
|
+
├── cli.py # CLI entrypoint and commands
|
|
139
|
+
├── core/ # Core settings and state loaders
|
|
140
|
+
├── commands/ # Subcommand implementation modules
|
|
141
|
+
├── ui/ # Terminal styling and layout components
|
|
142
|
+
└── data/ # Local JSON & TOML static data files
|
|
143
|
+
├── ascii_art.json
|
|
144
|
+
├── dad_jokes.json
|
|
145
|
+
├── fortunes.json
|
|
146
|
+
├── personality.toml
|
|
147
|
+
└── quotes.json
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## License 📄
|
|
153
|
+
|
|
154
|
+
This project is licensed under the MIT License - see the [LICENSE](file:///c:/work/Pypi/harshal/LICENSE) file for details.
|
harshal-0.1.0/README.md
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# Harshal CLI 🚀
|
|
2
|
+
|
|
3
|
+
[](https://opensource.org/licenses/MIT)
|
|
4
|
+
[](https://www.python.org/)
|
|
5
|
+
|
|
6
|
+
**Harshal CLI** is a highly interactive, customizable, and feature-rich terminal companion tool. From displaying system stats and system alerts to generating AI prompts and offering motivational quotes, Harshal adapts to your style with custom visual themes, interactive shells, and dynamic personalities.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Features ✨
|
|
11
|
+
|
|
12
|
+
* **Multiple Personalities**: Switch between `fun`, `serious`, `cyber`, and `cute` modes.
|
|
13
|
+
* **Interactive Prompts**: Built on `prompt-toolkit` and styled with `rich` for elegant user feedback.
|
|
14
|
+
* **System Utilities**: Copy output to clipboard, get performance statistics, and run system tasks.
|
|
15
|
+
* **AI Engine Integration**: Integrated with `litellm` for direct interaction with LLMs.
|
|
16
|
+
* **Curated Data Assets**: Local stores of quotes, fortunes, dad jokes, and retro ASCII art.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Installation 📦
|
|
21
|
+
|
|
22
|
+
You can install Harshal CLI using `pip` or `pipx`:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
# Basic installation (includes UI, Core, and CLI shell)
|
|
26
|
+
pip install .
|
|
27
|
+
|
|
28
|
+
# Install with AI features (litellm)
|
|
29
|
+
pip install ".[ai]"
|
|
30
|
+
|
|
31
|
+
# Install with System utilities (psutil, pyperclip)
|
|
32
|
+
pip install ".[system]"
|
|
33
|
+
|
|
34
|
+
# Install with Notification sounds (chime)
|
|
35
|
+
pip install ".[notifications]"
|
|
36
|
+
|
|
37
|
+
# Install all features
|
|
38
|
+
pip install ".[full]"
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Commands and Usage 🛠️
|
|
44
|
+
|
|
45
|
+
Once installed, use the CLI via the `harshal` entrypoint:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
# Check version and verify install
|
|
49
|
+
harshal --version
|
|
50
|
+
|
|
51
|
+
# Run the main interactive prompt
|
|
52
|
+
harshal run
|
|
53
|
+
|
|
54
|
+
# Show a random curated quote
|
|
55
|
+
harshal quote
|
|
56
|
+
|
|
57
|
+
# Crack a hilarious dad joke
|
|
58
|
+
harshal joke
|
|
59
|
+
|
|
60
|
+
# Crack open a virtual fortune cookie
|
|
61
|
+
harshal fortune
|
|
62
|
+
|
|
63
|
+
# Print beautiful retro ASCII drawings
|
|
64
|
+
harshal ascii --name computer
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Options
|
|
68
|
+
|
|
69
|
+
* `--personality` (`-p`): Set the theme to `fun`, `serious`, `cyber`, or `cute`.
|
|
70
|
+
* `--version`: Show version and exit.
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## Personalities & Themes 🎨
|
|
75
|
+
|
|
76
|
+
Harshal comes loaded with four pre-configured themes defined in `src/harshal/data/personality.toml`:
|
|
77
|
+
|
|
78
|
+
1. 🎉 **Fun & Playful** (`fun`): Full of emojis, programmer jokes, and highly excited prompts.
|
|
79
|
+
2. 💼 **Professional & Stoic** (`serious`): Direct, concise, objective, and stoic.
|
|
80
|
+
3. 💻 **Cyberpunk Hacker** (`cyber`): Neon-green cyberpunk theme talking in terminal nodes and decrypt payloads.
|
|
81
|
+
4. 🌸 **Cute & Cozy** (`cute`): Gentle, cozy, supportive text-emoticons `(* ^ ω ^)` and pastel magenta palettes.
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## Project Structure 📁
|
|
86
|
+
|
|
87
|
+
```text
|
|
88
|
+
harshal/
|
|
89
|
+
├── pyproject.toml
|
|
90
|
+
├── LICENSE
|
|
91
|
+
├── README.md
|
|
92
|
+
└── src/
|
|
93
|
+
└── harshal/
|
|
94
|
+
├── __init__.py
|
|
95
|
+
├── cli.py # CLI entrypoint and commands
|
|
96
|
+
├── core/ # Core settings and state loaders
|
|
97
|
+
├── commands/ # Subcommand implementation modules
|
|
98
|
+
├── ui/ # Terminal styling and layout components
|
|
99
|
+
└── data/ # Local JSON & TOML static data files
|
|
100
|
+
├── ascii_art.json
|
|
101
|
+
├── dad_jokes.json
|
|
102
|
+
├── fortunes.json
|
|
103
|
+
├── personality.toml
|
|
104
|
+
└── quotes.json
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## License 📄
|
|
110
|
+
|
|
111
|
+
This project is licensed under the MIT License - see the [LICENSE](file:///c:/work/Pypi/harshal/LICENSE) file for details.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "harshal"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "A multi-personality, feature-rich companion CLI helper tool"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = {text = "MIT"}
|
|
12
|
+
authors = [
|
|
13
|
+
{name = "Harshal", email = "your@email.com"}
|
|
14
|
+
]
|
|
15
|
+
keywords = ["cli", "terminal", "ai", "productivity", "tui", "rich", "typer"]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 3 - Alpha",
|
|
18
|
+
"Environment :: Console",
|
|
19
|
+
"Intended Audience :: Developers",
|
|
20
|
+
"Intended Audience :: End Users/Desktop",
|
|
21
|
+
"Topic :: Utilities",
|
|
22
|
+
"Topic :: Terminals",
|
|
23
|
+
"Programming Language :: Python :: 3",
|
|
24
|
+
"Programming Language :: Python :: 3.10",
|
|
25
|
+
"Programming Language :: Python :: 3.11",
|
|
26
|
+
"Programming Language :: Python :: 3.12",
|
|
27
|
+
"License :: OSI Approved :: MIT License",
|
|
28
|
+
"Operating System :: OS Independent",
|
|
29
|
+
]
|
|
30
|
+
dependencies = [
|
|
31
|
+
"typer[all]>=0.15",
|
|
32
|
+
"rich>=14.0",
|
|
33
|
+
"platformdirs>=4.0",
|
|
34
|
+
"prompt-toolkit>=3.0",
|
|
35
|
+
"textual>=0.75.0",
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
[project.urls]
|
|
39
|
+
"Homepage" = "https://github.com/YOUR_USERNAME/harshal"
|
|
40
|
+
"Bug Tracker" = "https://github.com/YOUR_USERNAME/harshal/issues"
|
|
41
|
+
"Source" = "https://github.com/YOUR_USERNAME/harshal"
|
|
42
|
+
|
|
43
|
+
[project.optional-dependencies]
|
|
44
|
+
ai = [
|
|
45
|
+
"litellm>=1.40",
|
|
46
|
+
]
|
|
47
|
+
system = [
|
|
48
|
+
"psutil>=6.0",
|
|
49
|
+
"pyperclip>=1.9",
|
|
50
|
+
]
|
|
51
|
+
notifications = [
|
|
52
|
+
"chime>=0.7",
|
|
53
|
+
]
|
|
54
|
+
full = [
|
|
55
|
+
"harshal[ai,system,notifications]",
|
|
56
|
+
]
|
|
57
|
+
|
|
58
|
+
[project.scripts]
|
|
59
|
+
harshal = "harshal.cli:app"
|
|
60
|
+
|
|
61
|
+
[tool.hatch.build.targets.wheel]
|
|
62
|
+
packages = ["src/harshal"]
|
|
63
|
+
|
|
64
|
+
[tool.hatch.build.targets.sdist]
|
|
65
|
+
include = [
|
|
66
|
+
"src/harshal/**/*.py",
|
|
67
|
+
"src/harshal/**/*.json",
|
|
68
|
+
"src/harshal/**/*.toml",
|
|
69
|
+
"src/harshal/**/*.tcss",
|
|
70
|
+
"README.md",
|
|
71
|
+
"LICENSE",
|
|
72
|
+
"pyproject.toml"
|
|
73
|
+
]
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
try:
|
|
3
|
+
sys.stdout.reconfigure(errors="replace")
|
|
4
|
+
sys.stderr.reconfigure(errors="replace")
|
|
5
|
+
except Exception:
|
|
6
|
+
pass
|
|
7
|
+
|
|
8
|
+
import typer
|
|
9
|
+
from harshal.core.database import init_db
|
|
10
|
+
from harshal.commands import (
|
|
11
|
+
ai, config_cmd, todo, notes, timer, morning, joy,
|
|
12
|
+
weather, system_cmd, random_cmd, search, git_cmd,
|
|
13
|
+
dev_tools, summary, creative, gamification, share, agent, safe_cmd
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
app = typer.Typer(name="harshal", help="Harshal CLI: Your AI-powered Terminal Companion")
|
|
17
|
+
|
|
18
|
+
@app.callback(invoke_without_command=True)
|
|
19
|
+
def main(ctx: typer.Context):
|
|
20
|
+
"""
|
|
21
|
+
Initialize database and run Harshal CLI.
|
|
22
|
+
"""
|
|
23
|
+
# Ensure database is initialized before any command runs
|
|
24
|
+
init_db()
|
|
25
|
+
if ctx.invoked_subcommand is None:
|
|
26
|
+
# Launch fullscreen TUI by default if terminal supports it
|
|
27
|
+
import sys
|
|
28
|
+
if sys.stdout.isatty():
|
|
29
|
+
try:
|
|
30
|
+
from harshal.ui.tui import HarshalTUIApp
|
|
31
|
+
tui_app = HarshalTUIApp()
|
|
32
|
+
tui_app.run()
|
|
33
|
+
return
|
|
34
|
+
except Exception:
|
|
35
|
+
pass
|
|
36
|
+
|
|
37
|
+
from harshal.ui.console import console
|
|
38
|
+
from rich.panel import Panel
|
|
39
|
+
from rich.align import Align
|
|
40
|
+
|
|
41
|
+
# Beautiful ASCII art logo
|
|
42
|
+
welcome_logo = (
|
|
43
|
+
" █ █ █████ ████ █████ █ █ █████ █ \n"
|
|
44
|
+
" █ █ █ █ █ █ █ █ █ █ █ █ \n"
|
|
45
|
+
" ██████ █████ ████ █████ █████ █████ █ \n"
|
|
46
|
+
" █ █ █ █ █ █ █ █ █ █ █ █ \n"
|
|
47
|
+
" █ █ █ █ █ ██ █████ █ █ █ █ █████ \n"
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
console.print()
|
|
51
|
+
console.print(Panel(
|
|
52
|
+
Align.center(
|
|
53
|
+
f"[primary]{welcome_logo}[/primary]\n"
|
|
54
|
+
f"[bold secondary]✨ Your Joyful AI-Powered Terminal Productivity Companion ✨[/bold secondary]\n\n"
|
|
55
|
+
f"[muted]Try running[/muted] [bold info]harshal dashboard[/bold info] [muted]or[/muted] [bold info]harshal chat[/bold info] [muted]to get started![/muted]"
|
|
56
|
+
),
|
|
57
|
+
border_style="primary",
|
|
58
|
+
expand=False,
|
|
59
|
+
padding=(1, 4)
|
|
60
|
+
))
|
|
61
|
+
console.print()
|
|
62
|
+
|
|
63
|
+
# Show help
|
|
64
|
+
console_help = ctx.get_help()
|
|
65
|
+
console.print(console_help)
|
|
66
|
+
|
|
67
|
+
@app.command("dashboard", help="Start the interactive fullscreen TUI dashboard environment")
|
|
68
|
+
def start_tui():
|
|
69
|
+
"""
|
|
70
|
+
Launch the fullscreen console dashboard window.
|
|
71
|
+
"""
|
|
72
|
+
from harshal.ui.tui import HarshalTUIApp
|
|
73
|
+
tui_app = HarshalTUIApp()
|
|
74
|
+
tui_app.run()
|
|
75
|
+
|
|
76
|
+
@app.command("play", help="Launch the Retro Arcade Hub (Snake, Typist, Memory Match)")
|
|
77
|
+
def start_game():
|
|
78
|
+
"""
|
|
79
|
+
Launch the Retro Arcade Hub with three games:
|
|
80
|
+
Task Snake, Code Speed Typist, and Syntax Memory Match.
|
|
81
|
+
"""
|
|
82
|
+
import pathlib
|
|
83
|
+
from textual.app import App, ComposeResult
|
|
84
|
+
from harshal.ui.tui_screens.game import GameScreen
|
|
85
|
+
|
|
86
|
+
_CSS = pathlib.Path(__file__).parent / "ui" / "tui.tcss"
|
|
87
|
+
|
|
88
|
+
class GameOnlyApp(App):
|
|
89
|
+
CSS_PATH = str(_CSS)
|
|
90
|
+
|
|
91
|
+
def compose(self) -> ComposeResult:
|
|
92
|
+
yield GameScreen()
|
|
93
|
+
|
|
94
|
+
GameOnlyApp().run()
|
|
95
|
+
|
|
96
|
+
@app.command("bootstrap", help="Setup and configure system executable environment paths and shell integration")
|
|
97
|
+
def run_bootstrap():
|
|
98
|
+
"""
|
|
99
|
+
Setup and configure system executable environment paths and shell integration.
|
|
100
|
+
"""
|
|
101
|
+
from harshal.core.installer import bootstrap_paths
|
|
102
|
+
bootstrap_paths()
|
|
103
|
+
|
|
104
|
+
# Register command modules as Typer sub-apps
|
|
105
|
+
app.add_typer(ai.app, name="ai", help="Interact with the AI assistant (chat, ask questions, explain logs)")
|
|
106
|
+
app.add_typer(config_cmd.app, name="config", help="Manage configuration settings and API keys interactively")
|
|
107
|
+
app.add_typer(todo.app, name="todo", help="Manage tasks, streaks, priorities, and checkoff lists")
|
|
108
|
+
app.add_typer(notes.app, name="notes", help="Manage notes, tags, and retro dev journaling logs")
|
|
109
|
+
app.add_typer(timer.app, name="timer", help="Run Pomodoro focus sessions and automated desktop breaks")
|
|
110
|
+
app.add_typer(joy.app, name="joy", help="Delight tools (developer humor, digital fortune cookies, celebrations)")
|
|
111
|
+
app.add_typer(weather.app, name="weather", help="Get weather conditions and humorous AI comments")
|
|
112
|
+
app.add_typer(system_cmd.app, name="system", help="Gather local hardware specs & real-time resource loads instantly")
|
|
113
|
+
app.add_typer(random_cmd.app, name="random", help="Generate secure passwords, UUIDs, developer excuses, or lorem ipsum")
|
|
114
|
+
app.add_typer(search.app, name="search", help="Perform quick web searches and extract summaries from pages")
|
|
115
|
+
app.add_typer(git_cmd.app, name="git", help="Smart Git committing, diff analysis, and interactive Git Buddy helper")
|
|
116
|
+
app.add_typer(dev_tools.app, name="dev", help="Developer workflow helper, regex maker, cheatsheets, and shell history debugs")
|
|
117
|
+
app.add_typer(summary.app, name="summary", help="Summarize clipboard contents or target text file contents")
|
|
118
|
+
app.add_typer(creative.app, name="creative", help="ASCII art generation, coding trivia, stories and playful roasts")
|
|
119
|
+
app.add_typer(gamification.app, name="leveling", help="XP leveling progress dashboard, streaks, and achievements checklist")
|
|
120
|
+
app.add_typer(share.app, name="share", help="Upload pastebin code snippets and generate terminal QR codes")
|
|
121
|
+
app.add_typer(agent.app, name="agent", help="ReAct shell automation agent (caution: executes system shell tasks)")
|
|
122
|
+
app.add_typer(safe_cmd.app, name="safe", help="Secure encrypted credentials vault (passwords, API keys, tokens)")
|
|
123
|
+
|
|
124
|
+
# Root-level shortcut command registrations
|
|
125
|
+
app.command("ask", help="Query Harshal AI directly")(ai.ask)
|
|
126
|
+
app.command("chat", help="Start an interactive chat session with Harshal")(ai.chat)
|
|
127
|
+
app.command("note", help="Quick shortcut to add a note")(notes.note)
|
|
128
|
+
app.command("morning", help="Get your daily morning dashboard briefing")(morning.morning)
|
|
129
|
+
app.command("pomodoro", help="Start a Pomodoro focus session")(timer.pomodoro)
|
|
130
|
+
|
|
131
|
+
# Joy shortcut command registrations
|
|
132
|
+
app.command("inspire", help="Show an inspiring quote or a developer joke")(joy.inspire)
|
|
133
|
+
app.command("fortune", help="Open a digital fortune cookie")(joy.fortune)
|
|
134
|
+
app.command("celebrate", help="Trigger a custom celebration burst")(joy.celebrate)
|
|
135
|
+
|
|
136
|
+
# Dev tools shortcut command registrations
|
|
137
|
+
app.command("oops", help="Explain last failed shell command error and suggest fix")(dev_tools.oops)
|
|
138
|
+
app.command("vibecheck", help="Check developer frustration vibe from shell history")(dev_tools.vibecheck)
|
|
139
|
+
app.command("cheat", help="Generate cheatsheet for a programming topic")(dev_tools.cheat)
|
|
140
|
+
app.command("regex", help="Generate a regular expression from natural language description")(dev_tools.regex)
|
|
141
|
+
app.command("codegraph", help="Generate a structure graph of the codebase using graphifyy for AI coding agents")(dev_tools.codegraph)
|
|
142
|
+
app.command("systema", help="Run AI diagnostics and optimization analysis on systemspecs")(system_cmd.systema)
|
|
143
|
+
app.command("gitbuddy", help="Direct shortcut to launch the interactive Git Buddy assistant")(git_cmd.buddy)
|
|
144
|
+
|
|
145
|
+
@app.command("guide", help="Show the ultimate interactive cheatsheet and user guide for Harshal")
|
|
146
|
+
def show_guide():
|
|
147
|
+
"""
|
|
148
|
+
Display a beautifully formatted, categorized cheat sheet of all available commands,
|
|
149
|
+
TUI keyboard shortcuts, and helpful tips.
|
|
150
|
+
"""
|
|
151
|
+
from rich.panel import Panel
|
|
152
|
+
from rich.table import Table
|
|
153
|
+
from harshal.ui.console import console
|
|
154
|
+
|
|
155
|
+
welcome = (
|
|
156
|
+
"📖 [bold primary]Harshal Interactive User Guide & Cheatsheet[/bold primary]\n"
|
|
157
|
+
"[dim]Get the most out of your AI-powered terminal productivity companion.[/dim]"
|
|
158
|
+
)
|
|
159
|
+
console.print(Panel(welcome, border_style="primary"))
|
|
160
|
+
|
|
161
|
+
# 1. Command Categories Table
|
|
162
|
+
table = Table(title="Command Directory by Category", border_style="cyan", show_header=True)
|
|
163
|
+
table.add_column("Category", style="bold cyan", width=25)
|
|
164
|
+
table.add_column("Commands", style="green", width=30)
|
|
165
|
+
table.add_column("Description / Example", style="dim")
|
|
166
|
+
|
|
167
|
+
table.add_row(
|
|
168
|
+
"🤖 AI Companion",
|
|
169
|
+
"harshal chat\nharshal ask <query>\nharshal agent",
|
|
170
|
+
"Interactive TUI chat session\nDirect terminal Q&A\nStep-by-step ReAct shell executor"
|
|
171
|
+
)
|
|
172
|
+
table.add_row(
|
|
173
|
+
"⚙️ System & Dev Tools",
|
|
174
|
+
"harshal system\nharshal systema\nharshal oops\nharshal vibecheck",
|
|
175
|
+
"Local hardware spec & resource load\nAI-powered bottleneck analysis report\nAnalyze last failed command error & get fix\nFrustration vibe scanner from shell history"
|
|
176
|
+
)
|
|
177
|
+
table.add_row(
|
|
178
|
+
"🐙 Smart Git",
|
|
179
|
+
"harshal git\nharshal gitbuddy\nharshal git status\nharshal git smart-commit",
|
|
180
|
+
"Launches the interactive Git Buddy assistant\nDirect shortcut to Git Buddy\nCustom colorized repository status\nAI-generated conventional commits"
|
|
181
|
+
)
|
|
182
|
+
table.add_row(
|
|
183
|
+
"📝 Productivity & Focus",
|
|
184
|
+
"harshal todo\nharshal notes\nharshal timer\nharshal morning",
|
|
185
|
+
"Manage tasks, streaks, and priorities\nMarkdown-enabled notes & journaling\nPomodoro focus timers & break logs\nInteractive daily Briefing dashboard"
|
|
186
|
+
)
|
|
187
|
+
table.add_row(
|
|
188
|
+
"🎉 Delight & Utility",
|
|
189
|
+
"harshal inspire\nharshal fortune\nharshal weather\nharshal search <query>",
|
|
190
|
+
"Inspiring developer quotes & jokes\nDigital fortune cookies\nWeather updates with AI comments\nFast web search & article summaries"
|
|
191
|
+
)
|
|
192
|
+
table.add_row(
|
|
193
|
+
"🎲 Random Generators",
|
|
194
|
+
"harshal random\nharshal random 32\nharshal random password\nharshal random uuid\nharshal random excuse\nharshal random lorem",
|
|
195
|
+
"Random 10-char alphanumeric string (default)\nRandom string of given length (< 1000)\nSecure password generator\nCryptographic v4 UUID generator\nFunny developer excuses (AI or local)\nDummy Lorem Ipsum generator"
|
|
196
|
+
)
|
|
197
|
+
table.add_row(
|
|
198
|
+
"🔐 Credentials Safe",
|
|
199
|
+
"harshal safe\nharshal safe store\nharshal safe get <name>\nharshal safe list\nharshal safe delete <name>",
|
|
200
|
+
"List all stored credentials\nInteractively store a new credential\nDecrypt & retrieve a credential (clipboard)\nList names and types\nPermanently delete a credential"
|
|
201
|
+
)
|
|
202
|
+
|
|
203
|
+
console.print(table)
|
|
204
|
+
console.print()
|
|
205
|
+
|
|
206
|
+
# 2. TUI Keyboard Shortcuts Panel
|
|
207
|
+
tui_shortcuts = (
|
|
208
|
+
"[bold accent]Universal Navigation & Shortcuts (in TUI Dashboard):[/bold accent]\n"
|
|
209
|
+
" • [info]Ctrl+D[/info] : Open Dashboard Tab "
|
|
210
|
+
" • [info]Ctrl+C[/info] : Open AI Chat Tab\n"
|
|
211
|
+
" • [info]Ctrl+T[/info] : Open Todo List Tab "
|
|
212
|
+
" • [info]Ctrl+N[/info] : Open Notes Tab\n"
|
|
213
|
+
" • [info]Ctrl+P[/info] : Open Pomodoro Timer Tab "
|
|
214
|
+
" • [info]Ctrl+G[/info] : Open Arcade Snake Game\n"
|
|
215
|
+
" • [info]Ctrl+S[/info] : Open System Matrix Tab "
|
|
216
|
+
" • [info]Ctrl+O[/info] : Open Settings Panel\n"
|
|
217
|
+
" • [info]Ctrl+Q[/info] : Quit Dashboard\n\n"
|
|
218
|
+
"[bold secondary]Contextual Keyboard Actions (Ctrl+K):[/bold secondary]\n"
|
|
219
|
+
" • [info]Notes/Journal[/info] : Save current note / toggle preview\n"
|
|
220
|
+
" • [info]Todo Screen[/info] : Save new task\n"
|
|
221
|
+
" • [info]Focus Timer[/info] : Play / pause Pomodoro\n"
|
|
222
|
+
" • [info]Arcade Game[/info] : Play / pause Snake game\n"
|
|
223
|
+
)
|
|
224
|
+
console.print(Panel(tui_shortcuts, title="🖥️ Full Screen Dashboard TUI Keyboard Guide", border_style="accent"))
|
|
225
|
+
console.print()
|
|
226
|
+
|
|
227
|
+
# 3. AI Providers & Models
|
|
228
|
+
ai_info = (
|
|
229
|
+
"[bold info]Configure AI Providers & Keys:[/bold info]\n"
|
|
230
|
+
" Run [bold]harshal config setup[/bold] to configure your active LLM provider and credentials.\n"
|
|
231
|
+
" Supports: Google Gemini, OpenAI, Anthropic, Groq (Fast LPU), and Ollama (Local/Offline).\n\n"
|
|
232
|
+
"[bold secondary]TUI Inline Slash Commands (typed in Chat Input):[/bold secondary]\n"
|
|
233
|
+
" • [info]/model <name>[/info] : Switch model on the fly\n"
|
|
234
|
+
" • [info]/provider <name>[/info] : Switch active provider on the fly\n"
|
|
235
|
+
" • [info]/theme <name>[/info] : Change companion personality theme\n"
|
|
236
|
+
" • [info]/clear[/info] : Clear current message thread\n"
|
|
237
|
+
" • [info]/help[/info] : Show inline chat helper"
|
|
238
|
+
)
|
|
239
|
+
console.print(Panel(ai_info, title="🤖 AI Configuration & Chat Guide", border_style="secondary"))
|
|
240
|
+
|
|
241
|
+
if __name__ == "__main__":
|
|
242
|
+
app()
|