devpy-cli 1.0.2__tar.gz → 1.0.3__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.3
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
@@ -283,6 +283,49 @@ The permission log still records what *would* have been executed.
283
283
 
284
284
  ---
285
285
 
286
+ ### Built-in Tools
287
+
288
+ DevPy CLI exposes a set of Docker-focused tools that the agent can call to fulfill your requests:
289
+
290
+ - **check_resource**
291
+ Shows CPU, memory, and disk usage of the local host.
292
+
293
+ - **get_docker_logs**
294
+ Retrieves the last logs of a container (`tail` configurable).
295
+
296
+ - **list_containers**
297
+ Lists active Docker containers with their current status.
298
+
299
+ - **inspect_container**
300
+ Returns low-level attributes and configuration of a container.
301
+
302
+ - **restart_docker_container**
303
+ Restarts a container, going through the permission system before execution.
304
+
305
+ - **create_container**
306
+ Creates and starts a new container from a given image and name.
307
+ If the image is not present locally, it is automatically pulled first.
308
+
309
+ - **delete_container**
310
+ Stops and removes the specified container (with confirmation).
311
+
312
+ - **stop_container**
313
+ Gracefully stops a running container.
314
+
315
+ - **start_monitoring**
316
+ Starts a background memory monitor for a container and alerts if usage crosses a threshold.
317
+
318
+ - **exec_command**
319
+ Executes a shell command inside a container. Commands are sanitized to block chaining and substitution.
320
+
321
+ - **download_image**
322
+ Downloads (pulls) a Docker image from a registry.
323
+
324
+ - **delete_image**
325
+ Deletes a Docker image if it exists, behind the same permission and logging layer.
326
+
327
+ ---
328
+
286
329
  ## Authentication and Security
287
330
 
288
331
  - **LLM API Authentication**
@@ -258,6 +258,49 @@ 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**
@@ -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,6 +447,8 @@ 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
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: devpy-cli
3
- Version: 1.0.2
3
+ Version: 1.0.3
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
@@ -283,6 +283,49 @@ The permission log still records what *would* have been executed.
283
283
 
284
284
  ---
285
285
 
286
+ ### Built-in Tools
287
+
288
+ DevPy CLI exposes a set of Docker-focused tools that the agent can call to fulfill your requests:
289
+
290
+ - **check_resource**
291
+ Shows CPU, memory, and disk usage of the local host.
292
+
293
+ - **get_docker_logs**
294
+ Retrieves the last logs of a container (`tail` configurable).
295
+
296
+ - **list_containers**
297
+ Lists active Docker containers with their current status.
298
+
299
+ - **inspect_container**
300
+ Returns low-level attributes and configuration of a container.
301
+
302
+ - **restart_docker_container**
303
+ Restarts a container, going through the permission system before execution.
304
+
305
+ - **create_container**
306
+ Creates and starts a new container from a given image and name.
307
+ If the image is not present locally, it is automatically pulled first.
308
+
309
+ - **delete_container**
310
+ Stops and removes the specified container (with confirmation).
311
+
312
+ - **stop_container**
313
+ Gracefully stops a running container.
314
+
315
+ - **start_monitoring**
316
+ Starts a background memory monitor for a container and alerts if usage crosses a threshold.
317
+
318
+ - **exec_command**
319
+ Executes a shell command inside a container. Commands are sanitized to block chaining and substitution.
320
+
321
+ - **download_image**
322
+ Downloads (pulls) a Docker image from a registry.
323
+
324
+ - **delete_image**
325
+ Deletes a Docker image if it exists, behind the same permission and logging layer.
326
+
327
+ ---
328
+
286
329
  ## Authentication and Security
287
330
 
288
331
  - **LLM API Authentication**
@@ -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.3"
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" }]
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