Skip to content

Add namespaces support (CRUD, RBAC, namespace-scoped users) #168

Description

@jfrancoa

Context

The Weaviate server adds a Namespaces feature in 1.38.0+ (see weaviate-python-client PR #2033). This adds full CRUD support, a new `manage_namespaces` RBAC permission, and namespace-scoped DB users. The CLI should expose these capabilities so users can administer namespaces, grant namespace permissions, and bind users to namespaces from the command line.

Scope

  • Add `create namespace`, `get namespace`, `delete namespace` subcommands (with `--all` for listing).
  • Add a `NamespaceManager` with create/get/list/delete operations and JSON output.
  • Extend `parse_permission` to recognize `manage_namespaces:`, and document it in `PERMISSION_HELP_STRING`.
  • Render `namespaces_permissions` in role output (text + JSON).
  • Add `--namespace` option to `create user` and surface the user's namespace in `get user` output.
  • Add unit tests for the manager, permission parsing, and namespace-aware user creation.
  • Update operating and contributing skills to document the new commands and patterns.

Files Involved

  • `weaviate_cli/defaults.py`
  • `weaviate_cli/commands/create.py`, `get.py`, `delete.py`
  • `weaviate_cli/managers/namespace_manager.py` (new)
  • `weaviate_cli/managers/user_manager.py`, `role_manager.py`
  • `weaviate_cli/utils.py`
  • `test/unittests/test_managers/test_namespace_manager.py` (new) and others
  • `.claude/skills/operating-weaviate-cli/`
  • `.claude/skills/contributing-to-weaviate-cli/`

Acceptance Criteria

  • `weaviate-cli create namespace --name ` creates a namespace and supports `--json`.
  • `weaviate-cli get namespace [--name ] [--all]` retrieves one or all namespaces.
  • `weaviate-cli delete namespace --name ` deletes a namespace.
  • `--permission manage_namespaces:` parses correctly and produces a valid RBAC permission.
  • `weaviate-cli create user --user_name foo --namespace bar` creates a namespace-scoped user.
  • `weaviate-cli get user --user_name foo` shows the namespace.
  • `weaviate-cli get role` text/JSON output includes `namespaces_permissions`.
  • Unit tests pass for new functionality.
  • `make lint` and `make test` pass.
  • Skill docs (operating + contributing) updated.

Constraints

  • Requires Weaviate 1.38.0+; rely on the python client's version check rather than re-implementing in the CLI.
  • Follow the existing defaults dataclass + command-to-manager pattern.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions