rubber-ducky 1.3.0__py3-none-any.whl → 1.4.0__py3-none-any.whl

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.
@@ -0,0 +1,210 @@
1
+ Metadata-Version: 2.4
2
+ Name: rubber-ducky
3
+ Version: 1.4.0
4
+ Summary: Quick CLI do-it-all tool. Use natural language to spit out bash commands
5
+ Requires-Python: >=3.10
6
+ Description-Content-Type: text/markdown
7
+ License-File: LICENSE
8
+ Requires-Dist: colorama>=0.4.6
9
+ Requires-Dist: fastapi>=0.115.11
10
+ Requires-Dist: ollama>=0.6.0
11
+ Requires-Dist: openai>=1.60.2
12
+ Requires-Dist: prompt-toolkit>=3.0.48
13
+ Requires-Dist: rich>=13.9.4
14
+ Requires-Dist: termcolor>=2.5.0
15
+ Dynamic: license-file
16
+
17
+ # Rubber Ducky
18
+
19
+ Rubber Ducky is an inline terminal companion that turns natural language prompts into runnable shell commands. Paste multi-line context, get a suggested command, and run it without leaving your terminal.
20
+
21
+ ## Quick Start
22
+
23
+ | Action | Command |
24
+ | --- | --- |
25
+ | Install globally | `uv tool install rubber-ducky` |
26
+ | Run once | `uvx rubber-ducky -- --help` |
27
+ | Local install | `uv pip install rubber-ducky` |
28
+
29
+ Requirements:
30
+ - [Ollama](https://ollama.com) running locally
31
+ - Model available via Ollama (default: `qwen3-coder:480b-cloud`, install with `ollama pull qwen3-coder:480b-cloud`)
32
+
33
+ ## Usage
34
+
35
+ ```
36
+ ducky # interactive inline session
37
+ ducky --directory src # preload code from a directory
38
+ ducky --model qwen3 # use a different Ollama model
39
+ ducky --local # use local models with gemma2:9b default
40
+ ducky --poll log-crumb # start polling mode for a crumb
41
+ ```
42
+
43
+ Both `ducky` and `rubber-ducky` executables map to the same CLI, so `uvx rubber-ducky -- <args>` works as well.
44
+
45
+ ### Inline Session (default)
46
+
47
+ Launching `ducky` with no arguments opens the inline interface:
48
+ - **Enter** submits; **Ctrl+J** inserts a newline (helpful when crafting multi-line prompts). Hitting **Enter on an empty prompt** reruns the latest suggested command; if none exists yet, it explains the most recent shell output.
49
+ - **Ctrl+R** re-runs the last suggested command.
50
+ - **Ctrl+S** copies the last suggested command to clipboard.
51
+ - Prefix any line with **`!`** (e.g., `!ls -la`) to run a shell command immediately.
52
+ - Arrow keys browse prompt history, backed by `~/.ducky/prompt_history`.
53
+ - Every prompt, assistant response, and executed command is logged to `~/.ducky/conversation.log`.
54
+ - Press **Ctrl+D** on an empty line to exit.
55
+ - Non-interactive runs such as `cat prompt.txt | ducky` print one response (and suggested command) before exiting; if a TTY is available you'll be asked whether to run the suggested command immediately.
56
+ - If `prompt_toolkit` is unavailable in your environment, Rubber Ducky falls back to a basic input loop (no history or shortcuts); install `prompt-toolkit>=3.0.48` to unlock the richer UI.
57
+
58
+ `ducky --directory <path>` streams the contents of the provided directory to the assistant the next time you submit a prompt (the directory is read once at startup).
59
+
60
+ ### Model Management
61
+
62
+ Rubber Ducky now supports easy switching between local and cloud models:
63
+ - **`/model`** - Interactive model selection between local and cloud models
64
+ - **`/local`** - List and select from local models (localhost:11434)
65
+ - **`/cloud`** - List and select from cloud models (ollama.com)
66
+ - Last used model is automatically saved and loaded on startup
67
+ - Type **`esc`** during model selection to cancel
68
+
69
+ ### Additional Commands
70
+
71
+ - **`/help`** - Show all available commands and shortcuts
72
+ - **`/crumbs`** - List all available crumbs (default and user-created)
73
+ - **`/clear`** or **`/reset`** - Clear conversation history
74
+ - **`/poll <crumb>`** - Start polling session for a crumb
75
+ - **`/poll <crumb> -i <interval>`** - Start polling with custom interval
76
+ - **`/poll <crumb> -p <prompt>`** - Start polling with custom prompt
77
+ - **`/stop-poll`** - Stop current polling session
78
+ - **`/run`** or **`:run`** - Re-run the last suggested command
79
+
80
+ ## Crumbs
81
+
82
+ Crumbs are simple scripts that can be executed within Rubber Ducky. They are stored in `~/.ducky/crumbs/` (for user crumbs) and shipped with the package (default crumbs).
83
+
84
+ Rubber Ducky ships with the following default crumbs:
85
+
86
+ | Crumb | Description |
87
+ |-------|-------------|
88
+ | `git-status` | Show current git status and provide suggestions |
89
+ | `git-log` | Show recent commit history with detailed information |
90
+ | `recent-files` | Show recently modified files in current directory |
91
+ | `disk-usage` | Show disk usage with highlights |
92
+ | `system-health` | Show CPU, memory, and system load metrics |
93
+ | `process-list` | Show running processes with analysis |
94
+
95
+ **Tip:** Run `/crumbs` in interactive mode to see all available crumbs with descriptions and polling status.
96
+
97
+ To use a crumb, simply mention it in your prompt:
98
+ ```
99
+ Can you use the git-status crumb to see what needs to be committed?
100
+ ```
101
+
102
+ **Note:** User-defined crumbs (in `~/.ducky/crumbs/`) override default crumbs with the same name.
103
+
104
+ ### Creating Crumbs
105
+
106
+ To create a new crumb:
107
+
108
+ 1. Create a new directory in `~/.ducky/crumbs/` with your crumb name
109
+ 2. Add an `info.txt` file with metadata:
110
+ ```
111
+ name: your-crumb-name
112
+ type: shell
113
+ description: Brief description of what this crumb does
114
+ ```
115
+ 3. Add your executable script file (e.g., `your-crumb-name.sh`)
116
+ 4. Create a symbolic link in `~/.local/bin` to make it available as a command:
117
+ ```bash
118
+ ln -s ~/.ducky/crumbs/your-crumb-name/your-crumb-name.sh ~/.local/bin/your-crumb-name
119
+ ```
120
+
121
+ ### Polling Mode
122
+
123
+ Crumbs can be configured for background polling, where the crumb script runs at intervals and the AI analyzes the output.
124
+
125
+ **Enabling Polling in a Crumb:**
126
+
127
+ Add polling configuration to your crumb's `info.txt`:
128
+ ```
129
+ name: log-crumb
130
+ type: shell
131
+ description: Fetch and analyze server logs
132
+ poll: true
133
+ poll_type: interval # "interval" (run repeatedly) or "continuous" (run once, tail output)
134
+ poll_interval: 5 # seconds between polls
135
+ poll_prompt: Analyze these logs for errors, warnings, or anomalies. Be concise.
136
+ ```
137
+
138
+ **Polling via CLI:**
139
+
140
+ ```bash
141
+ # Start polling with crumb's default configuration
142
+ ducky --poll log-crumb
143
+
144
+ # Override interval
145
+ ducky --poll log-crumb --interval 10
146
+
147
+ # Override prompt
148
+ ducky --poll log-crumb --prompt "Extract only error messages"
149
+ ```
150
+
151
+ **Polling via Interactive Mode:**
152
+
153
+ ```bash
154
+ ducky
155
+ >> /poll log-crumb # Use crumb defaults
156
+ >> /poll log-crumb -i 10 # Override interval
157
+ >> /poll log-crumb -p "Summarize" # Override prompt
158
+ >> /stop-poll # Stop polling
159
+ ```
160
+
161
+ **Example Crumb with Polling:**
162
+
163
+ Directory: `~/.ducky/crumbs/server-logs/`
164
+
165
+ ```
166
+ info.txt:
167
+ name: server-logs
168
+ type: shell
169
+ description: Fetch and analyze server logs
170
+ poll: true
171
+ poll_type: interval
172
+ poll_interval: 5
173
+ poll_prompt: Analyze these logs for errors, warnings, or anomalies. Be concise.
174
+
175
+ server-logs.sh:
176
+ #!/bin/bash
177
+ curl -s http://localhost:8080/logs | tail -50
178
+ ```
179
+
180
+ **Polling Types:**
181
+
182
+ - **interval**: Run the crumb script at regular intervals (default)
183
+ - **continuous**: Run the crumb once in the background and stream its output, analyzing periodically
184
+
185
+ **Stopping Polling:**
186
+
187
+ Press `Ctrl+C` at any time to stop polling. In interactive mode, you can also use `/stop-poll`.
188
+
189
+ ## Documentation
190
+
191
+ - **Polling Feature Guide**: See [examples/POLLING_USER_GUIDE.md](examples/POLLING_USER_GUIDE.md) for detailed instructions on creating and using polling crumbs
192
+ - **Mock Log Crumb**: See [examples/mock-logs/](examples/mock-logs/) for an example polling crumb
193
+
194
+ ## Development (uv)
195
+
196
+ ```
197
+ uv sync
198
+ uv run ducky --help
199
+ ```
200
+
201
+ `uv sync` creates a virtual environment and installs dependencies defined in `pyproject.toml` / `uv.lock`.
202
+
203
+ ## Telemetry & Storage
204
+
205
+ Rubber Ducky stores:
206
+ - `~/.ducky/prompt_history`: readline-compatible history file.
207
+ - `~/.ducky/conversation.log`: JSON lines with timestamps for prompts, assistant messages, and shell executions.
208
+ - `~/.ducky/config`: User preferences including last selected model.
209
+
210
+ No other telemetry is collected; delete the directory if you want a fresh slate.
@@ -0,0 +1,24 @@
1
+ crumbs/disk-usage/disk-usage.sh,sha256=paiyWTmvzJD2A7wHDU2aIHJVnNqNmBfNV33Os0q7UnQ,451
2
+ crumbs/disk-usage/info.txt,sha256=nKESO2G0biA0fV7peHPk7XaxcJ-wz_RJOkSUXI0VTKA,89
3
+ crumbs/git-log/git-log.sh,sha256=L41W6s-hfJ7FsKgyaS39CRI6tRkgUg-0tHb3Z1FyHqY,595
4
+ crumbs/git-log/info.txt,sha256=G0SDE5nv9mLU5zRpiYLdiR81ox6XRVJhNgnpoFArqeI,92
5
+ crumbs/git-status/git-status.sh,sha256=hXdZxFA8hiJoZ4P8Zv1KPJjwIEpPJG7xibjL2ggbp7o,633
6
+ crumbs/git-status/info.txt,sha256=MgzzfF23muScvS_JihXlpny7unyOCG7hZSAVZf-hQ7c,127
7
+ crumbs/process-list/info.txt,sha256=5KGBQ3zn7hlL3Pv7miAoa3UBLQ-vKD-aLew6h0xeBcQ,88
8
+ crumbs/process-list/process-list.sh,sha256=cwqMqu-xCbCn_DZNCaboZrDwg8A_UOF-bU9D8wxz5X8,744
9
+ crumbs/recent-files/info.txt,sha256=7y9SS_lvYgagaKkVaJp-rF9TEgnUWCe6nj-34FcCvb8,98
10
+ crumbs/recent-files/recent-files.sh,sha256=xpLUYYbouYQzGQZTTVrcybpRYPuoaLdyHny2HoHJZFw,540
11
+ crumbs/system-health/info.txt,sha256=jym4tR5Xy7hEdowlvpufQ4_mA4H88JfQYPGXDZBI9UU,104
12
+ crumbs/system-health/system-health.sh,sha256=NlLK3Th-sJ13Op44fjjEgi7oPscDQUCDBbR1Gd8ghlE,1670
13
+ ducky/__init__.py,sha256=2vLhJxOuJ3lnIeg5rmF6xUvybUT5Qhjej6AS0BeBASY,60
14
+ ducky/config.py,sha256=AH7KMTxPYrtSSmIJ_3qv0WB1tYpAjOWPrvPb7bKQ_cA,2142
15
+ ducky/ducky.py,sha256=qsaGYvw4UQu1NhBkcXkrilSWTrQpp9_Hs22NE0rQR9g,48721
16
+ examples/POLLING_USER_GUIDE.md,sha256=rMEAczZhpgyJ9BgwHkN-SKwSdyas8nlw_CjpV7SFOLA,10685
17
+ examples/mock-logs/info.txt,sha256=apJqEO__UM1R2_2x9MlQOA7XmxvLvbhRvOy-FAwrINo,258
18
+ examples/mock-logs/mock-logs.sh,sha256=zM2JSaCR1eCQLlMvXDWjFnpxZTqrMpnFRa_SgNLPmBk,1132
19
+ rubber_ducky-1.4.0.dist-info/licenses/LICENSE,sha256=gQ1rCmw18NqTk5GxG96F6vgyN70e1c4kcKUtWDwdNaE,1069
20
+ rubber_ducky-1.4.0.dist-info/METADATA,sha256=kJnwYBrQEtk2ugN-7G-bE19vEW7a80XLB3uxqhrqNkc,7859
21
+ rubber_ducky-1.4.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
22
+ rubber_ducky-1.4.0.dist-info/entry_points.txt,sha256=WPnVUUNvWdMDcBlCo8JCzkLghGllMX5QVZyQghyq85Q,75
23
+ rubber_ducky-1.4.0.dist-info/top_level.txt,sha256=cFot69fWrmToFkRuRXwS7_RmtIc9Gjp3RAgrmKkGZoY,22
24
+ rubber_ducky-1.4.0.dist-info/RECORD,,
@@ -0,0 +1,3 @@
1
+ crumbs
2
+ ducky
3
+ examples
@@ -1,98 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: rubber-ducky
3
- Version: 1.3.0
4
- Summary: Quick CLI do-it-all tool. Use natural language to spit out bash commands
5
- Requires-Python: >=3.10
6
- Description-Content-Type: text/markdown
7
- License-File: LICENSE
8
- Requires-Dist: colorama>=0.4.6
9
- Requires-Dist: fastapi>=0.115.11
10
- Requires-Dist: ollama>=0.6.0
11
- Requires-Dist: openai>=1.60.2
12
- Requires-Dist: prompt-toolkit>=3.0.48
13
- Requires-Dist: rich>=13.9.4
14
- Requires-Dist: termcolor>=2.5.0
15
- Dynamic: license-file
16
-
17
- # Rubber Ducky
18
-
19
- Rubber Ducky is an inline terminal companion that turns natural language prompts into runnable shell commands. Paste multi-line context, get a suggested command, and run it without leaving your terminal.
20
-
21
- ## Quick Start
22
-
23
- | Action | Command |
24
- | --- | --- |
25
- | Install globally | `uv tool install rubber-ducky` |
26
- | Run once | `uvx rubber-ducky -- --help` |
27
- | Local install | `uv pip install rubber-ducky` |
28
-
29
- Requirements:
30
- - [Ollama](https://ollama.com) running locally
31
- - Model available via Ollama (default: `qwen3-coder:480b-cloud`, install with `ollama pull qwen3-coder:480b-cloud`)
32
-
33
- ## Usage
34
-
35
- ```
36
- ducky # interactive inline session
37
- ducky --directory src # preload code from a directory
38
- ducky --model qwen3 # use a different Ollama model
39
- ```
40
-
41
- Both `ducky` and `rubber-ducky` executables map to the same CLI, so `uvx rubber-ducky -- <args>` works as well.
42
-
43
- ### Inline Session (default)
44
-
45
- Launching `ducky` with no arguments opens the inline interface:
46
- - **Enter** submits; **Ctrl+J** inserts a newline (helpful when crafting multi-line prompts). Hitting **Enter on an empty prompt** reruns the latest suggested command; if none exists yet, it explains the most recent shell output.
47
- - **Ctrl+R** re-runs the last suggested command.
48
- - Prefix any line with **`!`** (e.g., `!ls -la`) to run a shell command immediately.
49
- - Arrow keys browse prompt history, backed by `~/.ducky/prompt_history`.
50
- - Every prompt, assistant response, and executed command is logged to `~/.ducky/conversation.log`.
51
- - Press **Ctrl+D** on an empty line to exit.
52
- - Non-interactive runs such as `cat prompt.txt | ducky` print one response (and suggested command) before exiting; if a TTY is available you'll be asked whether to run the suggested command immediately.
53
- - If `prompt_toolkit` is unavailable in your environment, Rubber Ducky falls back to a basic input loop (no history or shortcuts); install `prompt-toolkit>=3.0.48` to unlock the richer UI.
54
-
55
- `ducky --directory <path>` streams the contents of the provided directory to the assistant the next time you submit a prompt (the directory is read once at startup).
56
-
57
- ## Crumbs
58
-
59
- Crumbs are simple scripts that can be executed within Rubber Ducky. They are stored in `~/.ducky/crumbs/` and can be referenced by name in your prompts.
60
-
61
- To use a crumb, simply mention it in your prompt:
62
- ```
63
- Can you use the uv-server crumb to run the HuggingFace prompt renderer?
64
- ```
65
-
66
- ### Creating Crumbs
67
-
68
- To create a new crumb:
69
-
70
- 1. Create a new directory in `~/.ducky/crumbs/` with your crumb name
71
- 2. Add an `info.txt` file with metadata:
72
- ```
73
- name: your-crumb-name
74
- type: shell
75
- description: Brief description of what this crumb does
76
- ```
77
- 3. Add your executable script file (e.g., `your-crumb-name.sh`)
78
- 4. Create a symbolic link in `~/.local/bin` to make it available as a command:
79
- ```bash
80
- ln -s ~/.ducky/crumbs/your-crumb-name/your-crumb-name.sh ~/.local/bin/your-crumb-name
81
- ```
82
-
83
- ## Development (uv)
84
-
85
- ```
86
- uv sync
87
- uv run ducky --help
88
- ```
89
-
90
- `uv sync` creates a virtual environment and installs dependencies defined in `pyproject.toml` / `uv.lock`.
91
-
92
- ## Telemetry & Storage
93
-
94
- Rubber Ducky stores:
95
- - `~/.ducky/prompt_history`: readline-compatible history file.
96
- - `~/.ducky/conversation.log`: JSON lines with timestamps for prompts, assistant messages, and shell executions.
97
-
98
- No other telemetry is collected; delete the directory if you want a fresh slate.
@@ -1,9 +0,0 @@
1
- ducky/__init__.py,sha256=2vLhJxOuJ3lnIeg5rmF6xUvybUT5Qhjej6AS0BeBASY,60
2
- ducky/config.py,sha256=AH7KMTxPYrtSSmIJ_3qv0WB1tYpAjOWPrvPb7bKQ_cA,2142
3
- ducky/ducky.py,sha256=1B500ievEsIg9mowpzqWuDNGck_DnUM0LdDRDHsm4yo,33716
4
- rubber_ducky-1.3.0.dist-info/licenses/LICENSE,sha256=gQ1rCmw18NqTk5GxG96F6vgyN70e1c4kcKUtWDwdNaE,1069
5
- rubber_ducky-1.3.0.dist-info/METADATA,sha256=BVIv6uBWho_khv8AbkQdPMP9PBB6xbvg-U6muGsfdCs,3874
6
- rubber_ducky-1.3.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
7
- rubber_ducky-1.3.0.dist-info/entry_points.txt,sha256=WPnVUUNvWdMDcBlCo8JCzkLghGllMX5QVZyQghyq85Q,75
8
- rubber_ducky-1.3.0.dist-info/top_level.txt,sha256=4Q75MONDNPpQ3o17bTu7RFuKwFhTIRzlXP3_LDWQQ30,6
9
- rubber_ducky-1.3.0.dist-info/RECORD,,
@@ -1 +0,0 @@
1
- ducky