Skip to content

Create a CLI for managing gardens and functions#652

Merged
hholb merged 23 commits intomainfrom
hholb/cli
Mar 18, 2026
Merged

Create a CLI for managing gardens and functions#652
hholb merged 23 commits intomainfrom
hholb/cli

Conversation

@hholb
Copy link
Copy Markdown
Member

@hholb hholb commented Feb 25, 2026

Resolves: #653

Overview

This PR adds a CLI to the garden-sdk for CRUD operations on gardens and functions. It is setup for easy use by humans as well as LLM agents. The driving goal is is to have a programmatic interface to garden that will allow users and their agent of choice to more easily interact with the garden service.

Screen.Recording.2026-02-26.at.1.24.04.PM.mov

There are new commands and sub-commands that follow this pattern:
garden-ai garden [list|show|create|update|delete]

Screen.Recording.2026-02-26.at.1.24.40.PM.mov

Where:

  • list lists the users gardens
  • show displays detailed information about a garden
    CRUD commands are self explanatory.
    The garden-ai garden add-functions sub-command adds deployed functions to existing gardens.
    There is also a garden-ai garden search command that hits the full-text search route on the backend.
Screen.Recording.2026-02-26.at.1.25.52.PM.mov

Function sub-commands follow a similar pattern:
garden-ai function [modal|hpc] [list|show|deploy|update|delete]

For the agents out there, the commands that display information about an entity have --json flags that dumps the full json blob we get from the backend. This makes it easier for agents to get full context on a garden or function.

Discussion

There is quite a bit of new code here, but the bulk of it is declarative in nature, API schemas, CLI commands and options, uv.lock, etc. Most of the new CLI commands just take the user's input and turn it into requests for the backend. Most of the actual logic is just printing stuff nicely.

There is a little bit of logic for parsing groundhog functions out of a file, but it's pretty minimal.

The BackendClient has a handful of new methods to hit the CRUD routes.

There were a decent number of new vulnerabilities found by safety check. The bulk were resolved by running uv lock --upgrade but there were a couple I couldn't fix easily. I added ignores to the .safety-policy to make the CI happy for now since I don't think the issues will affect users. I created new issues to try and update the newer versions of the affected packages: #654, #655

Testing

Manual testing, and testing with the Gardener skill.

There are a few new unit tests for the groundhog parsing logic, but nothing crazy.

I figure since we are mostly just sending requests to the backend, and the backend is well-tested, we should be pretty well covered here.

Documentation

Added a new page to the docs for a CLI reference.


📚 Documentation preview 📚: https://garden-ai--652.org.readthedocs.build/en/652/

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 26, 2026

Codecov Report

❌ Patch coverage is 38.89528% with 531 lines in your changes missing coverage. Please review.
✅ Project coverage is 39.25%. Comparing base (ec6c72a) to head (1416018).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
garden_ai/app/modal_cmds.py 12.98% 181 Missing ⚠️
garden_ai/app/groundhog.py 25.72% 153 Missing ⚠️
garden_ai/app/garden.py 15.13% 129 Missing ⚠️
garden_ai/backend_client.py 33.33% 52 Missing ⚠️
garden_ai/app/utils.py 25.00% 6 Missing ⚠️
garden_ai/hpc/functions.py 33.33% 6 Missing ⚠️
garden_ai/schemas/modal_app.py 95.55% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #652      +/-   ##
==========================================
- Coverage   40.32%   39.25%   -1.08%     
==========================================
  Files          30       38       +8     
  Lines        1758     2621     +863     
==========================================
+ Hits          709     1029     +320     
- Misses       1049     1592     +543     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@hholb hholb marked this pull request as ready for review February 26, 2026 20:27
@hholb hholb merged commit f051180 into main Mar 18, 2026
4 of 5 checks passed
@hholb hholb deleted the hholb/cli branch March 18, 2026 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create a CLI for programmatic/agentic interaction with the garden service

1 participant