rtdm 0.2.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.
@@ -0,0 +1,8 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "WebFetch(domain:github.com)",
5
+ "Bash(git add:*)"
6
+ ]
7
+ }
8
+ }
rtdm-0.2.0/.gitignore ADDED
@@ -0,0 +1,30 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.egg-info/
6
+ *.egg
7
+ build/
8
+ dist/
9
+ .eggs/
10
+
11
+ # Virtual environments
12
+ .venv/
13
+ venv/
14
+ env/
15
+
16
+ # Test / type-check caches
17
+ .pytest_cache/
18
+ .mypy_cache/
19
+ .ruff_cache/
20
+ .coverage
21
+ htmlcov/
22
+
23
+ # Editor / OS
24
+ .vscode/
25
+ .idea/
26
+ .DS_Store
27
+ *.swp
28
+
29
+ # Local config (user-specific; never committed)
30
+ config.toml
rtdm-0.2.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 t3t5u0403
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.
rtdm-0.2.0/LOCAL.md ADDED
@@ -0,0 +1,89 @@
1
+ # Local mode setup
2
+
3
+ Local mode runs entirely on your machine. No API key, no network call
4
+ to anything but your own Ollama daemon. Privacy is whatever your
5
+ laptop's privacy is.
6
+
7
+ ## Steps
8
+
9
+ 1. **Install Ollama:**
10
+
11
+ ```
12
+ curl -fsSL https://ollama.com/install.sh | sh
13
+ ```
14
+
15
+ Or grab a binary from <https://ollama.com/download>.
16
+
17
+ 2. **Pull a model:**
18
+
19
+ ```
20
+ ollama pull qwen2.5-coder:7b-instruct-q4_K_M
21
+ ```
22
+
23
+ This is the default rtdm uses. If you want a different model, pull
24
+ it and set `model` in `~/.config/rtdm/config.toml`.
25
+
26
+ 3. **Configure rtdm:**
27
+
28
+ ```
29
+ rtdm config init
30
+ ```
31
+
32
+ Pick `local` when prompted. The defaults (Ollama on localhost:11434,
33
+ the model above) are usually correct.
34
+
35
+ 4. **Try it:**
36
+
37
+ ```
38
+ rtdm find files over 100mb
39
+ ```
40
+
41
+ The first run is slow because Ollama loads the model into memory.
42
+ Subsequent calls are quick.
43
+
44
+ ## Hardware requirements
45
+
46
+ The 7b-quant model (≈4.5 GB on disk) needs ~8 GB RAM to load. A
47
+ discrete GPU with 6+ GB VRAM gets you sub-second responses; an RTX
48
+ 3060 or M2-class Apple Silicon is a comfortable floor.
49
+
50
+ CPU-only works but expect 10+ second waits. If that's painful, the
51
+ hosted service at rtdm.sh exists.
52
+
53
+ ## Pointing rtdm at a remote Ollama
54
+
55
+ Useful for "Ollama on my desktop, rtdm on my laptop" setups (e.g.
56
+ over Tailscale or a LAN). Edit the config:
57
+
58
+ ```toml
59
+ mode = "local"
60
+
61
+ [local]
62
+ ollama_url = "http://desktop.tailnet:11434"
63
+ model = "qwen2.5-coder:7b-instruct-q4_K_M"
64
+ ```
65
+
66
+ The local backend will speak HTTP/HTTPS to whatever URL you give it —
67
+ the name "local" refers to *no third-party API*, not the network
68
+ location.
69
+
70
+ ## Choosing a different model
71
+
72
+ Anything Ollama can serve will work; rtdm just sends the prompt and
73
+ streams the reply. Smaller models (e.g. `qwen2.5-coder:1.5b`) are
74
+ faster but worse at obscure commands; larger models (e.g.
75
+ `qwen2.5-coder:32b`) are slower but more reliable.
76
+
77
+ If a model produces output with markdown fences or commentary despite
78
+ the system prompt, switch to one trained more on instruction-following.
79
+
80
+ ## Account subcommands in local mode
81
+
82
+ The `rtdm portal`, `rtdm rotate`, and `rtdm usage` subcommands are
83
+ hosted-mode features (they all hit `rtdm.sh`). In local mode they
84
+ print a one-line "remote mode only" message and exit 1 — there's no
85
+ subscription to manage, no key to rotate, and no quota to count
86
+ against.
87
+
88
+ `rtdm whoami` works fine in local mode and shows your Ollama URL and
89
+ model instead of a remote endpoint.
rtdm-0.2.0/PKG-INFO ADDED
@@ -0,0 +1,185 @@
1
+ Metadata-Version: 2.4
2
+ Name: rtdm
3
+ Version: 0.2.0
4
+ Summary: An AI shell helper that gives you the command without the commentary.
5
+ Project-URL: Homepage, https://rtdm.sh
6
+ Project-URL: Repository, https://github.com/t3t5u0403/rtdm-cli
7
+ Project-URL: Issues, https://github.com/t3t5u0403/rtdm-cli/issues
8
+ Author: rtdm contributors
9
+ License: MIT
10
+ License-File: LICENSE
11
+ Keywords: ai,cli,ollama,shell,terminal
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Operating System :: MacOS
17
+ Classifier: Operating System :: POSIX :: Linux
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3 :: Only
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Topic :: Utilities
23
+ Requires-Python: >=3.11
24
+ Requires-Dist: httpx>=0.27
25
+ Provides-Extra: dev
26
+ Requires-Dist: pytest>=8.0; extra == 'dev'
27
+ Description-Content-Type: text/markdown
28
+
29
+ # rtdm
30
+
31
+ read the damn manual.
32
+
33
+ An AI shell helper that gives you the command without the commentary.
34
+
35
+ ```
36
+ $ rtdm find files over 100mb
37
+ find . -size +100M
38
+ ```
39
+
40
+ ## Install
41
+
42
+ ```
43
+ pipx install rtdm
44
+ rtdm config init
45
+ ```
46
+
47
+ `rtdm config init` walks you through a one-time setup. Pick `local`
48
+ for free, self-hosted use, or `remote` if you have an API key from
49
+ [rtdm.sh](https://rtdm.sh).
50
+
51
+ ## Usage
52
+
53
+ ### Three modes
54
+
55
+ ```
56
+ rtdm <query> # get a shell command
57
+ rtdm -q <question> # ask a general terminal question
58
+ rtdm -e <command> # explain a command
59
+ ```
60
+
61
+ Multi-word queries don't need quotes — words after the flags are
62
+ joined with spaces:
63
+
64
+ ```
65
+ rtdm find files over 100mb # works
66
+ rtdm "find files over 100mb" # also works
67
+ ```
68
+
69
+ The exception is when your input contains characters the shell would
70
+ interpret — globs (`*`, `?`, `[]`), control operators (`;`, `|`, `&`,
71
+ `<`, `>`), or arguments that look like flags (e.g. `--recursive`).
72
+ Quote those:
73
+
74
+ ```
75
+ rtdm -e "find . -mtime -7 -exec rm {} \;"
76
+ ```
77
+
78
+ Plain dashes are fine; `rtdm find files -size 100mb` works without
79
+ quoting.
80
+
81
+ ### Flags
82
+
83
+ | Flag | Effect |
84
+ |------|----------------------------------------------------------------|
85
+ | `-c` | Copy the output to the clipboard |
86
+ | `-x` | Execute the returned command (cmd mode only, with confirmation)|
87
+
88
+ ### Subcommands
89
+
90
+ Account self-service for hosted-mode users. All require remote mode
91
+ (except `whoami`, which works in either mode).
92
+
93
+ | Subcommand | Effect |
94
+ |----------------|-----------------------------------------------------------------|
95
+ | `rtdm portal` | Open the Stripe billing portal (manage subscription, invoices) |
96
+ | `rtdm rotate` | Issue a new API key, revoke the old one, update local config |
97
+ | `rtdm usage` | Show this month's usage and remaining quota |
98
+ | `rtdm whoami` | Show which key/host this CLI is configured against (no network) |
99
+
100
+ ### Examples
101
+
102
+ ```
103
+ $ rtdm extract a tar.gz file
104
+ tar -xzf archive.tar.gz
105
+
106
+ $ rtdm -q what does grep -E do
107
+ grep -E enables extended regular expressions, allowing operators like
108
+ +, ?, |, (), and {} without backslash escaping.
109
+
110
+ $ rtdm -e "find . -mtime -7 -exec rm {} \;"
111
+ This finds every file under the current directory modified in the last
112
+ 7 days and deletes each one. -mtime -7 selects "less than 7 days ago";
113
+ -exec rm {} \; runs rm on each match.
114
+
115
+ $ rtdm -c list all my docker containers
116
+ docker ps -a
117
+ (copied to clipboard)
118
+ ```
119
+
120
+ ## Local mode (free, self-hosted)
121
+
122
+ Run your own [Ollama](https://ollama.com), point rtdm at it. No API
123
+ key needed, no network call to anything but your own machine. Free
124
+ forever.
125
+
126
+ See [LOCAL.md](LOCAL.md) for setup.
127
+
128
+ ## Hosted mode ($3/month)
129
+
130
+ We run rtdm at [rtdm.sh](https://rtdm.sh) on dedicated GPU hardware.
131
+ No setup, no Ollama install, no model downloads — just one HTTP call
132
+ per query. 500 queries per month, cancel anytime.
133
+
134
+ Sign up at [rtdm.sh](https://rtdm.sh).
135
+
136
+ ## Privacy
137
+
138
+ We don't log your queries on our servers. We don't train models on
139
+ them. We don't sell anything to anyone.
140
+
141
+ We do use Cloudflare in front for DDoS protection, which means
142
+ Cloudflare technically sees TLS-decrypted requests as they pass
143
+ through. Most modern services work this way and we think the
144
+ protection is worth it, but we know some of you will disagree. See
145
+ [rtdm.sh](https://rtdm.sh) for the full note.
146
+
147
+ If you want zero third parties in the path, use local mode.
148
+
149
+ ## Configuration
150
+
151
+ The config file lives at `~/.config/rtdm/config.toml` (or
152
+ `$XDG_CONFIG_HOME/rtdm/config.toml`):
153
+
154
+ ```toml
155
+ mode = "remote" # or "local"
156
+
157
+ [remote]
158
+ api_key = "rtdm_live_..."
159
+ endpoint = "https://rtdm.sh"
160
+
161
+ [local]
162
+ ollama_url = "http://localhost:11434"
163
+ model = "qwen2.5-coder:7b-instruct-q4_K_M"
164
+ ```
165
+
166
+ Useful subcommands:
167
+
168
+ ```
169
+ rtdm config init # interactive setup
170
+ rtdm config show # print effective configuration
171
+ rtdm config path # print the config file location
172
+ ```
173
+
174
+ ## Development
175
+
176
+ ```
177
+ git clone https://github.com/t3t5u0403/rtdm-cli
178
+ cd rtdm-cli
179
+ uv sync --extra dev
180
+ uv run pytest
181
+ ```
182
+
183
+ ## License
184
+
185
+ MIT. See [LICENSE](LICENSE).
rtdm-0.2.0/README.md ADDED
@@ -0,0 +1,157 @@
1
+ # rtdm
2
+
3
+ read the damn manual.
4
+
5
+ An AI shell helper that gives you the command without the commentary.
6
+
7
+ ```
8
+ $ rtdm find files over 100mb
9
+ find . -size +100M
10
+ ```
11
+
12
+ ## Install
13
+
14
+ ```
15
+ pipx install rtdm
16
+ rtdm config init
17
+ ```
18
+
19
+ `rtdm config init` walks you through a one-time setup. Pick `local`
20
+ for free, self-hosted use, or `remote` if you have an API key from
21
+ [rtdm.sh](https://rtdm.sh).
22
+
23
+ ## Usage
24
+
25
+ ### Three modes
26
+
27
+ ```
28
+ rtdm <query> # get a shell command
29
+ rtdm -q <question> # ask a general terminal question
30
+ rtdm -e <command> # explain a command
31
+ ```
32
+
33
+ Multi-word queries don't need quotes — words after the flags are
34
+ joined with spaces:
35
+
36
+ ```
37
+ rtdm find files over 100mb # works
38
+ rtdm "find files over 100mb" # also works
39
+ ```
40
+
41
+ The exception is when your input contains characters the shell would
42
+ interpret — globs (`*`, `?`, `[]`), control operators (`;`, `|`, `&`,
43
+ `<`, `>`), or arguments that look like flags (e.g. `--recursive`).
44
+ Quote those:
45
+
46
+ ```
47
+ rtdm -e "find . -mtime -7 -exec rm {} \;"
48
+ ```
49
+
50
+ Plain dashes are fine; `rtdm find files -size 100mb` works without
51
+ quoting.
52
+
53
+ ### Flags
54
+
55
+ | Flag | Effect |
56
+ |------|----------------------------------------------------------------|
57
+ | `-c` | Copy the output to the clipboard |
58
+ | `-x` | Execute the returned command (cmd mode only, with confirmation)|
59
+
60
+ ### Subcommands
61
+
62
+ Account self-service for hosted-mode users. All require remote mode
63
+ (except `whoami`, which works in either mode).
64
+
65
+ | Subcommand | Effect |
66
+ |----------------|-----------------------------------------------------------------|
67
+ | `rtdm portal` | Open the Stripe billing portal (manage subscription, invoices) |
68
+ | `rtdm rotate` | Issue a new API key, revoke the old one, update local config |
69
+ | `rtdm usage` | Show this month's usage and remaining quota |
70
+ | `rtdm whoami` | Show which key/host this CLI is configured against (no network) |
71
+
72
+ ### Examples
73
+
74
+ ```
75
+ $ rtdm extract a tar.gz file
76
+ tar -xzf archive.tar.gz
77
+
78
+ $ rtdm -q what does grep -E do
79
+ grep -E enables extended regular expressions, allowing operators like
80
+ +, ?, |, (), and {} without backslash escaping.
81
+
82
+ $ rtdm -e "find . -mtime -7 -exec rm {} \;"
83
+ This finds every file under the current directory modified in the last
84
+ 7 days and deletes each one. -mtime -7 selects "less than 7 days ago";
85
+ -exec rm {} \; runs rm on each match.
86
+
87
+ $ rtdm -c list all my docker containers
88
+ docker ps -a
89
+ (copied to clipboard)
90
+ ```
91
+
92
+ ## Local mode (free, self-hosted)
93
+
94
+ Run your own [Ollama](https://ollama.com), point rtdm at it. No API
95
+ key needed, no network call to anything but your own machine. Free
96
+ forever.
97
+
98
+ See [LOCAL.md](LOCAL.md) for setup.
99
+
100
+ ## Hosted mode ($3/month)
101
+
102
+ We run rtdm at [rtdm.sh](https://rtdm.sh) on dedicated GPU hardware.
103
+ No setup, no Ollama install, no model downloads — just one HTTP call
104
+ per query. 500 queries per month, cancel anytime.
105
+
106
+ Sign up at [rtdm.sh](https://rtdm.sh).
107
+
108
+ ## Privacy
109
+
110
+ We don't log your queries on our servers. We don't train models on
111
+ them. We don't sell anything to anyone.
112
+
113
+ We do use Cloudflare in front for DDoS protection, which means
114
+ Cloudflare technically sees TLS-decrypted requests as they pass
115
+ through. Most modern services work this way and we think the
116
+ protection is worth it, but we know some of you will disagree. See
117
+ [rtdm.sh](https://rtdm.sh) for the full note.
118
+
119
+ If you want zero third parties in the path, use local mode.
120
+
121
+ ## Configuration
122
+
123
+ The config file lives at `~/.config/rtdm/config.toml` (or
124
+ `$XDG_CONFIG_HOME/rtdm/config.toml`):
125
+
126
+ ```toml
127
+ mode = "remote" # or "local"
128
+
129
+ [remote]
130
+ api_key = "rtdm_live_..."
131
+ endpoint = "https://rtdm.sh"
132
+
133
+ [local]
134
+ ollama_url = "http://localhost:11434"
135
+ model = "qwen2.5-coder:7b-instruct-q4_K_M"
136
+ ```
137
+
138
+ Useful subcommands:
139
+
140
+ ```
141
+ rtdm config init # interactive setup
142
+ rtdm config show # print effective configuration
143
+ rtdm config path # print the config file location
144
+ ```
145
+
146
+ ## Development
147
+
148
+ ```
149
+ git clone https://github.com/t3t5u0403/rtdm-cli
150
+ cd rtdm-cli
151
+ uv sync --extra dev
152
+ uv run pytest
153
+ ```
154
+
155
+ ## License
156
+
157
+ MIT. See [LICENSE](LICENSE).
@@ -0,0 +1,45 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "rtdm"
7
+ version = "0.2.0"
8
+ description = "An AI shell helper that gives you the command without the commentary."
9
+ readme = "README.md"
10
+ requires-python = ">=3.11"
11
+ license = { text = "MIT" }
12
+ keywords = ["cli", "ollama", "shell", "ai", "terminal"]
13
+ authors = [{ name = "rtdm contributors" }]
14
+ classifiers = [
15
+ "Development Status :: 4 - Beta",
16
+ "Environment :: Console",
17
+ "Intended Audience :: Developers",
18
+ "License :: OSI Approved :: MIT License",
19
+ "Operating System :: POSIX :: Linux",
20
+ "Operating System :: MacOS",
21
+ "Programming Language :: Python :: 3",
22
+ "Programming Language :: Python :: 3 :: Only",
23
+ "Programming Language :: Python :: 3.11",
24
+ "Programming Language :: Python :: 3.12",
25
+ "Topic :: Utilities",
26
+ ]
27
+ dependencies = [
28
+ "httpx>=0.27",
29
+ ]
30
+
31
+ [project.optional-dependencies]
32
+ dev = [
33
+ "pytest>=8.0",
34
+ ]
35
+
36
+ [project.scripts]
37
+ rtdm = "rtdm.main:main"
38
+
39
+ [project.urls]
40
+ Homepage = "https://rtdm.sh"
41
+ Repository = "https://github.com/t3t5u0403/rtdm-cli"
42
+ Issues = "https://github.com/t3t5u0403/rtdm-cli/issues"
43
+
44
+ [tool.hatch.build.targets.wheel]
45
+ packages = ["src/rtdm"]
@@ -0,0 +1,8 @@
1
+ """rtdm — read the damn manual.
2
+
3
+ An AI shell helper that gives you the command without the commentary.
4
+ Runs against either local Ollama (free, self-hosted) or the hosted
5
+ service at rtdm.sh (paid, no setup).
6
+ """
7
+
8
+ __version__ = "0.2.0"
@@ -0,0 +1,13 @@
1
+ """Backend implementations for the rtdm CLI.
2
+
3
+ Two backends share the same three-function shape so the dispatcher
4
+ in ``rtdm.main`` can swap them transparently:
5
+
6
+ * :func:`query` — natural language → single shell command
7
+ * :func:`ask` — free-form terminal question → plain-English answer
8
+ * :func:`explain`— shell command → plain-English breakdown
9
+
10
+ The local backend streams tokens from a user-run Ollama instance. The
11
+ remote backend POSTs to ``rtdm.sh`` and prints the full response on
12
+ completion. Streaming over HTTPS is intentionally deferred.
13
+ """