Files
cleveragents-core/features/resource_cli_flags_904.feature
T
freemo 170f3f3b64
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 19s
CI / helm (pull_request) Successful in 23s
CI / build (pull_request) Successful in 25s
CI / quality (pull_request) Successful in 40s
CI / typecheck (pull_request) Successful in 59s
CI / security (pull_request) Successful in 59s
CI / unit_tests (pull_request) Failing after 4m4s
CI / docker (pull_request) Has been skipped
CI / integration_tests (pull_request) Successful in 7m11s
CI / coverage (pull_request) Successful in 8m44s
CI / e2e_tests (pull_request) Successful in 17m26s
CI / status-check (pull_request) Failing after 1s
CI / benchmark-regression (pull_request) Successful in 55m2s
fix(cli): add missing resource command flags per specification
Add missing CLI flags per specification to resource and LSP commands:

- resource add --update: Re-register an existing resource by removing the
  old entry and creating a new one. When the resource does not yet exist,
  --update behaves as a normal add.

- resource add --clone-into REPO_URL:CONTAINER_PATH: Clone a remote
  repository into a container at a specified path. Only valid for
  container-instance and devcontainer-instance types. Stored in resource
  properties as a JSON descriptor.

- resource add --mount: Expand container type validation to accept both
  container-instance and devcontainer-instance (was restricted to only
  container-instance).

- resource list --all: Include auto-discovered child resources in the
  listing. Default behavior now excludes auto-discovered resources
  (auto_discovered=True) by filtering at the service layer via a new
  include_auto_discovered parameter on list_resources().

- resource tree --depth: Change default from -1 (unlimited) to 3, matching
  the specification.

- resource type list [REGEX]: Add optional positional regex argument to
  filter type names.

- lsp list [REGEX]: Add optional positional regex argument to filter
  server names.

All existing test step definitions updated to pass the new parameters.
New Behave feature file (resource_cli_flags_904.feature) with 12 scenarios
covering each new flag.

ISSUES CLOSED: #904
2026-03-31 01:33:28 +00:00

109 lines
5.3 KiB
Gherkin

Feature: Resource and LSP CLI missing flags (issue #904)
As a CleverAgents user
I want the CLI to support all specification-defined flags
So that I can fully manage resources and LSP servers per the spec
# ---- resource add --update ----
Scenario: Add a resource with --update re-registers it
Given a fresh resource flags test registry
And resource flags built-in types are bootstrapped
And I add a resource flags resource "git-checkout" named "local/upd-test" with path "/tmp/u1"
When I run resource flags add "git-checkout" "local/upd-test" with path "/tmp/u2" and update
Then the resource flags output should contain "Added resource"
And the resource flags output should contain "local/upd-test"
Scenario: Add with --update when resource does not yet exist
Given a fresh resource flags test registry
And resource flags built-in types are bootstrapped
When I run resource flags add "git-checkout" "local/new-upd" with path "/tmp/nu" and update
Then the resource flags output should contain "Added resource"
# ---- resource add --mount (container types) ----
Scenario: Mount flag rejected for non-container type
Given a fresh resource flags test registry
And resource flags built-in types are bootstrapped
When I run resource flags add "git-checkout" "local/bad-mount" with path "/tmp/bm" and mount "local/repo:/workspace"
Then the resource flags command should fail
And the resource flags output should contain "container types"
# ---- resource add --clone-into ----
Scenario: Clone-into flag rejected for non-container type
Given a fresh resource flags test registry
And resource flags built-in types are bootstrapped
When I run resource flags add "git-checkout" "local/bad-clone" with path "/tmp/bc" and clone-into "https://example.com/repo.git:/workspace"
Then the resource flags command should fail
And the resource flags output should contain "container types"
Scenario: Clone-into flag with invalid format
Given a fresh resource flags test registry
And resource flags built-in types are bootstrapped
When I run resource flags add "container-instance" "local/bad-fmt" with clone-into "no-colon-here"
Then the resource flags command should fail
And the resource flags output should contain "REPO_URL"
# ---- resource list --all ----
Scenario: Resource list default excludes auto-discovered resources
Given a fresh resource flags test registry
And resource flags built-in types are bootstrapped
And a user-added resource flags resource "git-checkout" named "local/user-res" with path "/tmp/ur"
And an auto-discovered resource flags resource named "local/auto-res"
When I run resource flags list
Then the resource flags output should contain "local/user-res"
And the resource flags output should not contain "local/auto-res"
Scenario: Resource list --all includes auto-discovered resources
Given a fresh resource flags test registry
And resource flags built-in types are bootstrapped
And a user-added resource flags resource "git-checkout" named "local/user-res2" with path "/tmp/ur2"
And an auto-discovered resource flags resource named "local/auto-res2"
When I run resource flags list with --all
Then the resource flags output should contain "local/user-res2"
And the resource flags output should contain "local/auto-res2"
# ---- resource tree --depth default ----
Scenario: Tree depth defaults to 3
Given a fresh resource flags test registry
And resource flags built-in types are bootstrapped
And a resource flags resource "git-checkout" named "local/depth-root" with path "/tmp/dr"
When I run resource flags tree for "local/depth-root" with default depth
Then the resource flags tree depth used should be 3
# ---- resource type list [REGEX] ----
Scenario: Resource type list with regex filter
Given a fresh resource flags test registry
And resource flags built-in types are bootstrapped
When I run resource flags type list with regex "git"
Then the resource flags output should contain "git-checkout"
And the resource flags output should not contain "fs-directory"
Scenario: Resource type list without regex shows all
Given a fresh resource flags test registry
And resource flags built-in types are bootstrapped
When I run resource flags type list without regex
Then the resource flags output should contain "git-checkout"
And the resource flags output should contain "fs-directory"
# ---- lsp list [REGEX] ----
Scenario: LSP list with regex filter
Given a clean LSP flags test environment
And a registered LSP flags server "local/pyright-test" for language "python"
And a registered LSP flags server "local/clangd-test" for language "cpp"
When I run lsp flags list with regex "pyright"
Then the lsp flags output should contain "local/pyright-test"
And the lsp flags output should not contain "local/clangd-test"
Scenario: LSP list without regex shows all
Given a clean LSP flags test environment
And a registered LSP flags server "local/pyright-test2" for language "python"
And a registered LSP flags server "local/clangd-test2" for language "cpp"
When I run lsp flags list without regex
Then the lsp flags output should contain "local/pyright-test2"
And the lsp flags output should contain "local/clangd-test2"