devpy-cli 1.0.2__tar.gz → 1.0.4__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: devpy-cli
3
- Version: 1.0.2
3
+ Version: 1.0.4
4
4
  Summary: AI-powered DevOps CLI Assistant for local and remote Docker management
5
5
  Author-email: Eddy Ortega <atrox390@gmail.com>
6
6
  License: MIT
@@ -19,13 +19,15 @@ Requires-Dist: cryptography>=42.0.0
19
19
  Requires-Dist: rich>=13.7.0
20
20
  Requires-Dist: langchain>=0.1.0
21
21
  Requires-Dist: langchain-openai>=0.0.5
22
+ Requires-Dist: langchain-anthropic>=0.1.0
23
+ Requires-Dist: langchain-google-genai>=1.0.0
22
24
  Requires-Dist: langgraph>=0.0.10
23
25
  Requires-Dist: python-dotenv>=1.0.0
24
26
  Requires-Dist: psutil>=5.9.0
25
27
 
26
28
  # DevPy CLI
27
29
 
28
- An intelligent command-line assistant powered by LLM (DeepSeek/OpenAI) to manage Docker environments, both local and remote via SSH. Designed to simplify DevOps tasks with natural language, ensuring security and control.
30
+ An intelligent command-line assistant powered by multiple LLM providers (DeepSeek, OpenAI, Anthropic Claude, Google Gemini, Ollama/OpenWebUI) to manage Docker environments, both local and remote via SSH. Designed to simplify DevOps tasks with natural language, ensuring security and control.
29
31
 
30
32
  ## Key Features
31
33
 
@@ -283,18 +285,71 @@ The permission log still records what *would* have been executed.
283
285
 
284
286
  ---
285
287
 
288
+ ### Built-in Tools
289
+
290
+ DevPy CLI exposes a set of Docker-focused tools that the agent can call to fulfill your requests:
291
+
292
+ - **check_resource**
293
+ Shows CPU, memory, and disk usage of the local host.
294
+
295
+ - **get_docker_logs**
296
+ Retrieves the last logs of a container (`tail` configurable).
297
+
298
+ - **list_containers**
299
+ Lists active Docker containers with their current status.
300
+
301
+ - **inspect_container**
302
+ Returns low-level attributes and configuration of a container.
303
+
304
+ - **restart_docker_container**
305
+ Restarts a container, going through the permission system before execution.
306
+
307
+ - **create_container**
308
+ Creates and starts a new container from a given image and name.
309
+ If the image is not present locally, it is automatically pulled first.
310
+
311
+ - **delete_container**
312
+ Stops and removes the specified container (with confirmation).
313
+
314
+ - **stop_container**
315
+ Gracefully stops a running container.
316
+
317
+ - **start_monitoring**
318
+ Starts a background memory monitor for a container and alerts if usage crosses a threshold.
319
+
320
+ - **exec_command**
321
+ Executes a shell command inside a container. Commands are sanitized to block chaining and substitution.
322
+
323
+ - **download_image**
324
+ Downloads (pulls) a Docker image from a registry.
325
+
326
+ - **delete_image**
327
+ Deletes a Docker image if it exists, behind the same permission and logging layer.
328
+
329
+ ---
330
+
286
331
  ## Authentication and Security
287
332
 
288
333
  - **LLM API Authentication**
289
334
  - The `.env` file created by the setup wizard stores:
290
335
  - `LLM` – which provider/adapter to use.
291
- - `<PROVIDER>_API_KEY` – the API key for that provider.
292
- - Optionally `LLM_BASE_URL` – custom base URL for compatible providers.
336
+ - `<PROVIDER>_API_KEY` – the API key for that provider (for example `DEEPSEEK_API_KEY`, `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `GOOGLE_API_KEY`).
337
+ - Optionally `LLM_BASE_URL` – custom base URL for compatible providers (including OpenAI-compatible proxies such as Ollama or OpenWebUI).
293
338
  - You can re-run the wizard at any time with:
294
339
  ```bash
295
340
  config llm
296
341
  ```
297
342
 
343
+ - **Supported LLM Providers**
344
+ - **DeepSeek** – uses `LLM=deepseek` and `DEEPSEEK_API_KEY`, with optional `LLM_BASE_URL` override.
345
+ - **OpenAI (ChatGPT / GPT-4o family)** – uses `LLM=chatgpt` and `OPENAI_API_KEY`.
346
+ - **Anthropic Claude** – uses `LLM=anthropic` or `LLM=claude` with `ANTHROPIC_API_KEY`.
347
+ - **Google Gemini** – uses `LLM=google` or `LLM=gemini` with `GOOGLE_API_KEY`.
348
+ - **Ollama / OpenWebUI** – uses `LLM=ollama` or `LLM=openwebui` and talks to an OpenAI-compatible endpoint:
349
+ - `LLM_BASE_URL`, `OLLAMA_BASE_URL`, or `OPENWEBUI_BASE_URL` define the base URL (e.g. `http://localhost:11434` or an OpenWebUI URL).
350
+ - `OLLAMA_MODEL` selects the local model (for example `llama3.1`).
351
+ - `OPENAI_API_KEY` can be any non-empty token (often not validated by Ollama/OpenWebUI).
352
+
298
353
  - **SSH Key Encryption**
299
354
  - Stored SSH keys live in `ssh_keys.enc`.
300
355
  - Each key is encrypted using a passphrase-derived key (PBKDF2 + AES-256).
@@ -1,6 +1,6 @@
1
1
  # DevPy CLI
2
2
 
3
- An intelligent command-line assistant powered by LLM (DeepSeek/OpenAI) to manage Docker environments, both local and remote via SSH. Designed to simplify DevOps tasks with natural language, ensuring security and control.
3
+ An intelligent command-line assistant powered by multiple LLM providers (DeepSeek, OpenAI, Anthropic Claude, Google Gemini, Ollama/OpenWebUI) to manage Docker environments, both local and remote via SSH. Designed to simplify DevOps tasks with natural language, ensuring security and control.
4
4
 
5
5
  ## Key Features
6
6
 
@@ -258,18 +258,71 @@ The permission log still records what *would* have been executed.
258
258
 
259
259
  ---
260
260
 
261
+ ### Built-in Tools
262
+
263
+ DevPy CLI exposes a set of Docker-focused tools that the agent can call to fulfill your requests:
264
+
265
+ - **check_resource**
266
+ Shows CPU, memory, and disk usage of the local host.
267
+
268
+ - **get_docker_logs**
269
+ Retrieves the last logs of a container (`tail` configurable).
270
+
271
+ - **list_containers**
272
+ Lists active Docker containers with their current status.
273
+
274
+ - **inspect_container**
275
+ Returns low-level attributes and configuration of a container.
276
+
277
+ - **restart_docker_container**
278
+ Restarts a container, going through the permission system before execution.
279
+
280
+ - **create_container**
281
+ Creates and starts a new container from a given image and name.
282
+ If the image is not present locally, it is automatically pulled first.
283
+
284
+ - **delete_container**
285
+ Stops and removes the specified container (with confirmation).
286
+
287
+ - **stop_container**
288
+ Gracefully stops a running container.
289
+
290
+ - **start_monitoring**
291
+ Starts a background memory monitor for a container and alerts if usage crosses a threshold.
292
+
293
+ - **exec_command**
294
+ Executes a shell command inside a container. Commands are sanitized to block chaining and substitution.
295
+
296
+ - **download_image**
297
+ Downloads (pulls) a Docker image from a registry.
298
+
299
+ - **delete_image**
300
+ Deletes a Docker image if it exists, behind the same permission and logging layer.
301
+
302
+ ---
303
+
261
304
  ## Authentication and Security
262
305
 
263
306
  - **LLM API Authentication**
264
307
  - The `.env` file created by the setup wizard stores:
265
308
  - `LLM` – which provider/adapter to use.
266
- - `<PROVIDER>_API_KEY` – the API key for that provider.
267
- - Optionally `LLM_BASE_URL` – custom base URL for compatible providers.
309
+ - `<PROVIDER>_API_KEY` – the API key for that provider (for example `DEEPSEEK_API_KEY`, `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `GOOGLE_API_KEY`).
310
+ - Optionally `LLM_BASE_URL` – custom base URL for compatible providers (including OpenAI-compatible proxies such as Ollama or OpenWebUI).
268
311
  - You can re-run the wizard at any time with:
269
312
  ```bash
270
313
  config llm
271
314
  ```
272
315
 
316
+ - **Supported LLM Providers**
317
+ - **DeepSeek** – uses `LLM=deepseek` and `DEEPSEEK_API_KEY`, with optional `LLM_BASE_URL` override.
318
+ - **OpenAI (ChatGPT / GPT-4o family)** – uses `LLM=chatgpt` and `OPENAI_API_KEY`.
319
+ - **Anthropic Claude** – uses `LLM=anthropic` or `LLM=claude` with `ANTHROPIC_API_KEY`.
320
+ - **Google Gemini** – uses `LLM=google` or `LLM=gemini` with `GOOGLE_API_KEY`.
321
+ - **Ollama / OpenWebUI** – uses `LLM=ollama` or `LLM=openwebui` and talks to an OpenAI-compatible endpoint:
322
+ - `LLM_BASE_URL`, `OLLAMA_BASE_URL`, or `OPENWEBUI_BASE_URL` define the base URL (e.g. `http://localhost:11434` or an OpenWebUI URL).
323
+ - `OLLAMA_MODEL` selects the local model (for example `llama3.1`).
324
+ - `OPENAI_API_KEY` can be any non-empty token (often not validated by Ollama/OpenWebUI).
325
+
273
326
  - **SSH Key Encryption**
274
327
  - Stored SSH keys live in `ssh_keys.enc`.
275
328
  - Each key is encrypted using a passphrase-derived key (PBKDF2 + AES-256).
@@ -233,9 +233,34 @@ def restart_docker_container(container_name: str) -> str:
233
233
  )
234
234
 
235
235
 
236
+ @tool
237
+ def download_image(image_name: str) -> str:
238
+ """Downloads a Docker image from a registry"""
239
+ command_preview = build_command_preview(['docker', 'pull', image_name])
240
+
241
+ def action():
242
+ client = get_docker_client()
243
+ client.images.pull(image_name)
244
+ return f'Image {image_name} downloaded'
245
+
246
+ return permission_manager.execute(
247
+ operation='download_image',
248
+ fn=action,
249
+ fn_kwargs={},
250
+ command_preview=command_preview,
251
+ impact='Downloads a Docker image',
252
+ command_key=f'download:{image_name}',
253
+ prompt_func=permission_prompt,
254
+ )
255
+
256
+
236
257
  @tool
237
258
  def create_container(container_image: str, container_name: str) -> str:
238
259
  """Creates and starts a new Docker container with given image and name"""
260
+ images = get_docker_client().images.list()
261
+ if container_image not in [img.tags[0] for img in images]:
262
+ download_image(container_image)
263
+
239
264
  command_preview = build_command_preview(['docker', 'run', '-d', '--name', container_name, container_image])
240
265
 
241
266
  def action():
@@ -383,6 +408,34 @@ def exec_command(container_name: str, command: str) -> str:
383
408
  )
384
409
 
385
410
 
411
+ @tool
412
+ def delete_image(image_name: str) -> str:
413
+ """Deletes a Docker image if it exists"""
414
+ images = get_docker_client().images.list()
415
+ if image_name not in [img.tags[0] for img in images]:
416
+ return f'Image {image_name} not found'
417
+
418
+ command_preview = build_command_preview(['docker', 'rmi', image_name])
419
+
420
+ def action():
421
+ client = get_docker_client()
422
+ try:
423
+ client.images.remove(image_name)
424
+ return f'Image {image_name} deleted'
425
+ except docker.errors.ImageNotFound:
426
+ return f'Image {image_name} not found'
427
+
428
+ return permission_manager.execute(
429
+ operation='delete_image',
430
+ fn=action,
431
+ fn_kwargs={},
432
+ command_preview=command_preview,
433
+ impact='Deletes the specified Docker image if it exists',
434
+ command_key=f'delete_image:{image_name}',
435
+ prompt_func=permission_prompt,
436
+ )
437
+
438
+
386
439
  tools = [
387
440
  check_resource,
388
441
  get_docker_logs,
@@ -394,11 +447,20 @@ tools = [
394
447
  stop_container,
395
448
  start_monitoring,
396
449
  exec_command,
450
+ download_image,
451
+ delete_image,
397
452
  ]
398
453
 
399
454
 
400
- if os.getenv('LLM') == 'deepseek':
455
+ llm_name = os.getenv('LLM')
456
+ if llm_name == 'deepseek':
401
457
  from llm.deepseek import llm
458
+ elif llm_name in ('anthropic', 'claude'):
459
+ from llm.claude import llm
460
+ elif llm_name in ('google', 'gemini'):
461
+ from llm.google import llm
462
+ elif llm_name in ('ollama', 'openwebui'):
463
+ from llm.ollama import llm
402
464
  else:
403
465
  from llm.chatgpt import llm
404
466
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: devpy-cli
3
- Version: 1.0.2
3
+ Version: 1.0.4
4
4
  Summary: AI-powered DevOps CLI Assistant for local and remote Docker management
5
5
  Author-email: Eddy Ortega <atrox390@gmail.com>
6
6
  License: MIT
@@ -19,13 +19,15 @@ Requires-Dist: cryptography>=42.0.0
19
19
  Requires-Dist: rich>=13.7.0
20
20
  Requires-Dist: langchain>=0.1.0
21
21
  Requires-Dist: langchain-openai>=0.0.5
22
+ Requires-Dist: langchain-anthropic>=0.1.0
23
+ Requires-Dist: langchain-google-genai>=1.0.0
22
24
  Requires-Dist: langgraph>=0.0.10
23
25
  Requires-Dist: python-dotenv>=1.0.0
24
26
  Requires-Dist: psutil>=5.9.0
25
27
 
26
28
  # DevPy CLI
27
29
 
28
- An intelligent command-line assistant powered by LLM (DeepSeek/OpenAI) to manage Docker environments, both local and remote via SSH. Designed to simplify DevOps tasks with natural language, ensuring security and control.
30
+ An intelligent command-line assistant powered by multiple LLM providers (DeepSeek, OpenAI, Anthropic Claude, Google Gemini, Ollama/OpenWebUI) to manage Docker environments, both local and remote via SSH. Designed to simplify DevOps tasks with natural language, ensuring security and control.
29
31
 
30
32
  ## Key Features
31
33
 
@@ -283,18 +285,71 @@ The permission log still records what *would* have been executed.
283
285
 
284
286
  ---
285
287
 
288
+ ### Built-in Tools
289
+
290
+ DevPy CLI exposes a set of Docker-focused tools that the agent can call to fulfill your requests:
291
+
292
+ - **check_resource**
293
+ Shows CPU, memory, and disk usage of the local host.
294
+
295
+ - **get_docker_logs**
296
+ Retrieves the last logs of a container (`tail` configurable).
297
+
298
+ - **list_containers**
299
+ Lists active Docker containers with their current status.
300
+
301
+ - **inspect_container**
302
+ Returns low-level attributes and configuration of a container.
303
+
304
+ - **restart_docker_container**
305
+ Restarts a container, going through the permission system before execution.
306
+
307
+ - **create_container**
308
+ Creates and starts a new container from a given image and name.
309
+ If the image is not present locally, it is automatically pulled first.
310
+
311
+ - **delete_container**
312
+ Stops and removes the specified container (with confirmation).
313
+
314
+ - **stop_container**
315
+ Gracefully stops a running container.
316
+
317
+ - **start_monitoring**
318
+ Starts a background memory monitor for a container and alerts if usage crosses a threshold.
319
+
320
+ - **exec_command**
321
+ Executes a shell command inside a container. Commands are sanitized to block chaining and substitution.
322
+
323
+ - **download_image**
324
+ Downloads (pulls) a Docker image from a registry.
325
+
326
+ - **delete_image**
327
+ Deletes a Docker image if it exists, behind the same permission and logging layer.
328
+
329
+ ---
330
+
286
331
  ## Authentication and Security
287
332
 
288
333
  - **LLM API Authentication**
289
334
  - The `.env` file created by the setup wizard stores:
290
335
  - `LLM` – which provider/adapter to use.
291
- - `<PROVIDER>_API_KEY` – the API key for that provider.
292
- - Optionally `LLM_BASE_URL` – custom base URL for compatible providers.
336
+ - `<PROVIDER>_API_KEY` – the API key for that provider (for example `DEEPSEEK_API_KEY`, `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `GOOGLE_API_KEY`).
337
+ - Optionally `LLM_BASE_URL` – custom base URL for compatible providers (including OpenAI-compatible proxies such as Ollama or OpenWebUI).
293
338
  - You can re-run the wizard at any time with:
294
339
  ```bash
295
340
  config llm
296
341
  ```
297
342
 
343
+ - **Supported LLM Providers**
344
+ - **DeepSeek** – uses `LLM=deepseek` and `DEEPSEEK_API_KEY`, with optional `LLM_BASE_URL` override.
345
+ - **OpenAI (ChatGPT / GPT-4o family)** – uses `LLM=chatgpt` and `OPENAI_API_KEY`.
346
+ - **Anthropic Claude** – uses `LLM=anthropic` or `LLM=claude` with `ANTHROPIC_API_KEY`.
347
+ - **Google Gemini** – uses `LLM=google` or `LLM=gemini` with `GOOGLE_API_KEY`.
348
+ - **Ollama / OpenWebUI** – uses `LLM=ollama` or `LLM=openwebui` and talks to an OpenAI-compatible endpoint:
349
+ - `LLM_BASE_URL`, `OLLAMA_BASE_URL`, or `OPENWEBUI_BASE_URL` define the base URL (e.g. `http://localhost:11434` or an OpenWebUI URL).
350
+ - `OLLAMA_MODEL` selects the local model (for example `llama3.1`).
351
+ - `OPENAI_API_KEY` can be any non-empty token (often not validated by Ollama/OpenWebUI).
352
+
298
353
  - **SSH Key Encryption**
299
354
  - Stored SSH keys live in `ssh_keys.enc`.
300
355
  - Each key is encrypted using a passphrase-derived key (PBKDF2 + AES-256).
@@ -16,4 +16,7 @@ devpy_cli.egg-info/requires.txt
16
16
  devpy_cli.egg-info/top_level.txt
17
17
  llm/__init__.py
18
18
  llm/chatgpt.py
19
- llm/deepseek.py
19
+ llm/claude.py
20
+ llm/deepseek.py
21
+ llm/google.py
22
+ llm/ollama.py
@@ -4,6 +4,8 @@ cryptography>=42.0.0
4
4
  rich>=13.7.0
5
5
  langchain>=0.1.0
6
6
  langchain-openai>=0.0.5
7
+ langchain-anthropic>=0.1.0
8
+ langchain-google-genai>=1.0.0
7
9
  langgraph>=0.0.10
8
10
  python-dotenv>=1.0.0
9
11
  psutil>=5.9.0
@@ -0,0 +1,8 @@
1
+ import os
2
+ from langchain_anthropic import ChatAnthropic
3
+
4
+ llm = ChatAnthropic(
5
+ model='claude-3-5-sonnet-latest',
6
+ api_key=os.getenv('ANTHROPIC_API_KEY'),
7
+ max_tokens=1500,
8
+ )
@@ -0,0 +1,8 @@
1
+ import os
2
+ from langchain_google_genai import ChatGoogleGenerativeAI
3
+
4
+ llm = ChatGoogleGenerativeAI(
5
+ model='gemini-1.5-pro',
6
+ api_key=os.getenv('GOOGLE_API_KEY'),
7
+ max_output_tokens=1500,
8
+ )
@@ -0,0 +1,20 @@
1
+ import os
2
+ from langchain_openai import ChatOpenAI
3
+
4
+
5
+ def _get_base_url() -> str:
6
+ base = os.getenv('LLM_BASE_URL') or os.getenv('OLLAMA_BASE_URL') or os.getenv('OPENWEBUI_BASE_URL')
7
+ if base:
8
+ base = base.rstrip('/')
9
+ if not base.endswith('/v1'):
10
+ base = base + '/v1'
11
+ return base
12
+ return 'http://localhost:11434/v1'
13
+
14
+
15
+ llm = ChatOpenAI(
16
+ model=os.getenv('OLLAMA_MODEL', 'llama3.1:8b'),
17
+ api_key=os.getenv('OPENAI_API_KEY', 'ollama'),
18
+ base_url=_get_base_url(),
19
+ max_tokens=1500,
20
+ )
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "devpy-cli"
7
- version = "1.0.2"
7
+ version = "1.0.4"
8
8
  description = "AI-powered DevOps CLI Assistant for local and remote Docker management"
9
9
  readme = "README.md"
10
10
  authors = [{ name = "Eddy Ortega", email = "atrox390@gmail.com" }]
@@ -23,6 +23,8 @@ dependencies = [
23
23
  "rich>=13.7.0",
24
24
  "langchain>=0.1.0",
25
25
  "langchain-openai>=0.0.5",
26
+ "langchain-anthropic>=0.1.0",
27
+ "langchain-google-genai>=1.0.0",
26
28
  "langgraph>=0.0.10",
27
29
  "python-dotenv>=1.0.0",
28
30
  "psutil>=5.9.0",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes