weaviate / weaviate/weaviate-cli

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

Open
#168 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
31
Forks
19
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the defaults dataclass and command-to-manager pattern in weaviate_cli/defaults.py and the commands in create.py, get.py, and delete.py. Read the new namespace_manager.py alongside user_manager.py, role_manager.py, and utils.py, then inspect the named unit tests. Done means the namespace commands, permissions, user and role output, skill docs, make lint, and make test satisfy the acceptance criteria.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, database
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.