ragfly-cli 1.21.0__tar.gz → 2.0.0__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.
Files changed (28) hide show
  1. {ragfly_cli-1.21.0/ragfly_cli.egg-info → ragfly_cli-2.0.0}/PKG-INFO +7 -6
  2. {ragfly_cli-1.21.0 → ragfly_cli-2.0.0}/README.md +5 -5
  3. {ragfly_cli-1.21.0 → ragfly_cli-2.0.0}/pyproject.toml +2 -1
  4. ragfly_cli-2.0.0/ragfly_cli/__init__.py +1 -0
  5. {ragfly_cli-1.21.0 → ragfly_cli-2.0.0}/ragfly_cli/cli.py +107 -106
  6. {ragfly_cli-1.21.0 → ragfly_cli-2.0.0/ragfly_cli.egg-info}/PKG-INFO +7 -6
  7. {ragfly_cli-1.21.0 → ragfly_cli-2.0.0}/tests/test_agent_context_cli.py +8 -8
  8. {ragfly_cli-1.21.0 → ragfly_cli-2.0.0}/tests/test_surface_parity_cli.py +26 -26
  9. ragfly_cli-1.21.0/ragfly_cli/__init__.py +0 -1
  10. {ragfly_cli-1.21.0 → ragfly_cli-2.0.0}/LICENSE +0 -0
  11. {ragfly_cli-1.21.0 → ragfly_cli-2.0.0}/ragfly_cli/__main__.py +0 -0
  12. {ragfly_cli-1.21.0 → ragfly_cli-2.0.0}/ragfly_cli/_http.py +0 -0
  13. {ragfly_cli-1.21.0 → ragfly_cli-2.0.0}/ragfly_cli/_runtime.py +0 -0
  14. {ragfly_cli-1.21.0 → ragfly_cli-2.0.0}/ragfly_cli/cloud_commands.py +0 -0
  15. {ragfly_cli-1.21.0 → ragfly_cli-2.0.0}/ragfly_cli/config.py +0 -0
  16. {ragfly_cli-1.21.0 → ragfly_cli-2.0.0}/ragfly_cli/grupo_activo.py +0 -0
  17. {ragfly_cli-1.21.0 → ragfly_cli-2.0.0}/ragfly_cli/keyring_store.py +0 -0
  18. {ragfly_cli-1.21.0 → ragfly_cli-2.0.0}/ragfly_cli/oop/__init__.py +0 -0
  19. {ragfly_cli-1.21.0 → ragfly_cli-2.0.0}/ragfly_cli/oop/cli_command.py +0 -0
  20. {ragfly_cli-1.21.0 → ragfly_cli-2.0.0}/ragfly_cli/oop/http_client.py +0 -0
  21. {ragfly_cli-1.21.0 → ragfly_cli-2.0.0}/ragfly_cli/version_check.py +0 -0
  22. {ragfly_cli-1.21.0 → ragfly_cli-2.0.0}/ragfly_cli.egg-info/SOURCES.txt +0 -0
  23. {ragfly_cli-1.21.0 → ragfly_cli-2.0.0}/ragfly_cli.egg-info/dependency_links.txt +0 -0
  24. {ragfly_cli-1.21.0 → ragfly_cli-2.0.0}/ragfly_cli.egg-info/entry_points.txt +0 -0
  25. {ragfly_cli-1.21.0 → ragfly_cli-2.0.0}/ragfly_cli.egg-info/requires.txt +0 -0
  26. {ragfly_cli-1.21.0 → ragfly_cli-2.0.0}/ragfly_cli.egg-info/top_level.txt +0 -0
  27. {ragfly_cli-1.21.0 → ragfly_cli-2.0.0}/setup.cfg +0 -0
  28. {ragfly_cli-1.21.0 → ragfly_cli-2.0.0}/tests/test_api_key_group_override.py +0 -0
@@ -1,11 +1,12 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ragfly-cli
3
- Version: 1.21.0
3
+ Version: 2.0.0
4
4
  Summary: RAGfly CLI — operate RAGfly from the terminal and CI (login + cloud API). Lightweight, no desktop dependencies.
5
5
  Author: CAB Ltda
6
6
  License: MIT
7
7
  Project-URL: Homepage, https://ragfly.ai
8
8
  Project-URL: Documentation, https://api.ragfly.ai/docs
9
+ Project-URL: Repository, https://github.com/RAGfly/ragfly-cli
9
10
  Keywords: ragfly,rag,cli,retrieval,ai,mcp
10
11
  Requires-Python: >=3.10
11
12
  Description-Content-Type: text/markdown
@@ -75,13 +76,13 @@ ragfly
75
76
  ├── login / logout / version
76
77
  └── cloud ← the English REST /v1 contract of api.ragfly.ai
77
78
  ├── me
78
- ├── entity set [ENTITY_CODE] | set --clear
79
+ ├── workspace set [WORKSPACE_CODE] | set --clear
79
80
  ├── area set [AREA_CODE] | set --release | list
80
81
  ├── location list
81
82
  ├── group list | switch | clear (signed-in person)
82
83
  ├── api-key create | list | revoke (signed-in person)
83
84
  ├── document list | show | edges
84
- ├── space list | show | compose | read | refresh | promote
85
+ ├── collection list | show | compose | read | refresh | save
85
86
  ├── queue show | runs
86
87
  ├── skill list | show | run
87
88
  ├── catalog
@@ -115,10 +116,10 @@ Output is English end to end (`--status VECTORIZED`, `-o json | jq`).
115
116
 
116
117
  ```bash
117
118
  ragfly cloud document list --status VECTORIZED --limit 20 -o id
118
- ragfly cloud skill run SUMMARIZE_DOCUMENT --space 12
119
+ ragfly cloud skill run SUMMARIZE_DOCUMENT --collection 12
119
120
  ragfly cloud search "Q1 revenue"
120
- ragfly cloud search "statements" --filter @filter.json --space 12
121
- ragfly cloud chat ask "How do I release the entity of my key?" --mode help
121
+ ragfly cloud search "statements" --filter @filter.json --collection 12
122
+ ragfly cloud chat ask "How do I release the workspace of my key?" --mode help
122
123
  ```
123
124
 
124
125
  Full reference: <https://api.ragfly.ai/docs>.
@@ -55,13 +55,13 @@ ragfly
55
55
  ├── login / logout / version
56
56
  └── cloud ← the English REST /v1 contract of api.ragfly.ai
57
57
  ├── me
58
- ├── entity set [ENTITY_CODE] | set --clear
58
+ ├── workspace set [WORKSPACE_CODE] | set --clear
59
59
  ├── area set [AREA_CODE] | set --release | list
60
60
  ├── location list
61
61
  ├── group list | switch | clear (signed-in person)
62
62
  ├── api-key create | list | revoke (signed-in person)
63
63
  ├── document list | show | edges
64
- ├── space list | show | compose | read | refresh | promote
64
+ ├── collection list | show | compose | read | refresh | save
65
65
  ├── queue show | runs
66
66
  ├── skill list | show | run
67
67
  ├── catalog
@@ -95,10 +95,10 @@ Output is English end to end (`--status VECTORIZED`, `-o json | jq`).
95
95
 
96
96
  ```bash
97
97
  ragfly cloud document list --status VECTORIZED --limit 20 -o id
98
- ragfly cloud skill run SUMMARIZE_DOCUMENT --space 12
98
+ ragfly cloud skill run SUMMARIZE_DOCUMENT --collection 12
99
99
  ragfly cloud search "Q1 revenue"
100
- ragfly cloud search "statements" --filter @filter.json --space 12
101
- ragfly cloud chat ask "How do I release the entity of my key?" --mode help
100
+ ragfly cloud search "statements" --filter @filter.json --collection 12
101
+ ragfly cloud chat ask "How do I release the workspace of my key?" --mode help
102
102
  ```
103
103
 
104
104
  Full reference: <https://api.ragfly.ai/docs>.
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "ragfly-cli"
7
- version = "1.21.0"
7
+ version = "2.0.0"
8
8
  description = "RAGfly CLI — operate RAGfly from the terminal and CI (login + cloud API). Lightweight, no desktop dependencies."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -25,6 +25,7 @@ dependencies = [
25
25
  [project.urls]
26
26
  Homepage = "https://ragfly.ai"
27
27
  Documentation = "https://api.ragfly.ai/docs"
28
+ Repository = "https://github.com/RAGfly/ragfly-cli"
28
29
 
29
30
  [project.scripts]
30
31
  ragfly = "ragfly_cli.cli:app"
@@ -0,0 +1 @@
1
+ __version__ = "2.0.0"
@@ -12,7 +12,8 @@ Commands:
12
12
  ragfly cloud group list | switch | clear (signed-in person only)
13
13
  ragfly cloud api-key create | list | revoke (signed-in person only)
14
14
  ragfly cloud document list | show | edges
15
- ragfly cloud space list | show
15
+ ragfly cloud workspace set
16
+ ragfly cloud collection list | show | compose | read | refresh | save
16
17
  ragfly cloud queue show | runs
17
18
  ragfly cloud skill list | show | run
18
19
  ragfly cloud catalog | function show | search | chat ask
@@ -179,8 +180,8 @@ def login(email: str | None, password_stdin: bool):
179
180
  console.print()
180
181
  console.print(f"[green]✓ Logged in as[/green] {email}")
181
182
  usuario = data.get("usuario", {}) if isinstance(data.get("usuario"), dict) else {}
182
- console.print(f" Active group: {data.get('grupo_activo') or usuario.get('grupo_por_defecto') or '—'}")
183
- console.print(f" Active entity: {data.get('entidad_activa') or usuario.get('entidad_por_defecto') or '—'}")
183
+ console.print(f" Active group: {data.get('grupo_activo') or usuario.get('grupo_por_defecto') or '—'}")
184
+ console.print(f" Active workspace: {data.get('entidad_activa') or usuario.get('entidad_por_defecto') or '—'}")
184
185
  console.print(" Session stored in [dim]OS keyring[/dim]")
185
186
  console.print()
186
187
 
@@ -231,49 +232,49 @@ def cloud_me(output: str):
231
232
  _fields("Session", {
232
233
  "user": user.get("code"), "name": user.get("name"), "profile": data.get("profile"),
233
234
  "roles": ", ".join(data.get("roles") or []), "group": data.get("active_group"),
234
- "entity": data.get("active_entity"), "area": data.get("active_area"),
235
+ "workspace": data.get("active_workspace"), "area": data.get("active_area"),
235
236
  "effective_area": data.get("effective_area"),
236
237
  }, [("User", "user"), ("Name", "name"), ("Profile", "profile"), ("Roles", "roles"),
237
- ("Active group", "group"), ("Active entity", "entity"), ("Active area", "area"),
238
+ ("Active group", "group"), ("Active workspace", "workspace"), ("Active area", "area"),
238
239
  ("Effective area", "effective_area")])
239
240
 
240
241
 
241
- # ── cloud entity ────────────────────────────────────────────────────────────
242
+ # ── cloud workspace ────────────────────────────────────────────────────────────
242
243
 
243
- @cloud.group("entity")
244
- def cloud_entity():
245
- """Active entity focus for the authenticated credential."""
244
+ @cloud.group("workspace")
245
+ def cloud_workspace():
246
+ """Active workspace focus for the authenticated credential."""
246
247
 
247
248
 
248
- @cloud_entity.command("set")
249
- @click.argument("entity_code", required=False)
249
+ @cloud_workspace.command("set")
250
+ @click.argument("workspace_code", required=False)
250
251
  @click.option("--clear", "--release", "release", is_flag=True,
251
- help="Clear the focus and use all authorized entities (--release is an alias).")
252
+ help="Clear the focus and use all authorized workspaces (--release is an alias).")
252
253
  @click.option("-o", "--output", type=OUTPUT_TABLE, default="table")
253
- def cloud_entity_set(entity_code: str | None, release: bool, output: str):
254
- """Set ENTITY_CODE as active, or use --clear to clear the focus."""
255
- if release == (entity_code is not None):
256
- raise click.UsageError("Pass exactly one of ENTITY_CODE or --clear.")
254
+ def cloud_workspace_set(workspace_code: str | None, release: bool, output: str):
255
+ """Set WORKSPACE_CODE as active, or use --clear to clear the focus."""
256
+ if release == (workspace_code is not None):
257
+ raise click.UsageError("Pass exactly one of WORKSPACE_CODE or --clear.")
257
258
  data = _v1(
258
- "POST", "/v1/session/active-entity",
259
- body={"entity_code": None if release else entity_code},
259
+ "POST", "/v1/session/active-workspace",
260
+ body={"workspace_code": None if release else workspace_code},
260
261
  )
261
262
  if output == "json":
262
263
  _emit_json(data)
263
264
  return
264
- active = data.get("active_entity") or "all authorized entities"
265
- console.print(f"[green]✓ Active entity:[/green] [bold]{active}[/bold]")
265
+ active = data.get("active_workspace") or "all authorized workspaces"
266
+ console.print(f"[green]✓ Active workspace:[/green] [bold]{active}[/bold]")
266
267
 
267
268
 
268
269
  # ── cloud area / cloud location ─────────────────────────────────────────────
269
270
 
270
271
  HIERARCHY_COLUMNS = [("Code", "code"), ("Name", "name"), ("Parent", "parent_code"), ("Depth", "depth"),
271
- ("Entity", "entity_code")]
272
+ ("Workspace", "workspace_code")]
272
273
 
273
274
 
274
- def _hierarchy_list(path: str, title: str, entity: str | None, parent: str | None, query: str | None,
275
+ def _hierarchy_list(path: str, title: str, workspace: str | None, parent: str | None, query: str | None,
275
276
  limit: int, cursor: str | None, output: str) -> None:
276
- data = _v1("GET", path, params={"entity_code": entity, "parent_code": parent, "query": query,
277
+ data = _v1("GET", path, params={"workspace_code": workspace, "parent_code": parent, "query": query,
277
278
  "limit": limit, "cursor": cursor})
278
279
  _list(data, output, key="items", id_key="code", title=title, columns=HIERARCHY_COLUMNS)
279
280
  if output == "table" and (data or {}).get("next_cursor"):
@@ -287,10 +288,10 @@ def cloud_area():
287
288
 
288
289
  @cloud_area.command("set")
289
290
  @click.argument("area_code", required=False)
290
- @click.option("--release", is_flag=True, help="Release the area focus and keep the current entity.")
291
+ @click.option("--release", is_flag=True, help="Release the area focus and keep the current workspace.")
291
292
  @click.option("-o", "--output", type=OUTPUT_TABLE, default="table")
292
293
  def cloud_area_set(area_code: str | None, release: bool, output: str):
293
- """Set AREA_CODE as active (it also selects its entity), or use --release to clear it."""
294
+ """Set AREA_CODE as active (it also selects its workspace), or use --release to clear it."""
294
295
  if release == (area_code is not None):
295
296
  raise click.UsageError("Pass exactly one of AREA_CODE or --release.")
296
297
  data = _v1("POST", "/v1/session/active-area", body={"area_code": None if release else area_code})
@@ -299,11 +300,11 @@ def cloud_area_set(area_code: str | None, release: bool, output: str):
299
300
  return
300
301
  active = data.get("active_area") or "no area focus"
301
302
  console.print(f"[green]✓ Active area:[/green] [bold]{active}[/bold] "
302
- f"[dim](entity {data.get('active_entity') or '—'})[/dim]")
303
+ f"[dim](workspace {data.get('active_workspace') or '—'})[/dim]")
303
304
 
304
305
 
305
306
  AREA_OPTIONS = [
306
- click.option("--entity", default=None, help="Entity code (defaults to the active entity)"),
307
+ click.option("--workspace", default=None, help="Workspace code (defaults to the active workspace)"),
307
308
  click.option("--parent", default=None, help="Only the children of this code"),
308
309
  click.option("--query", default=None, help="Text to look for in the name"),
309
310
  click.option("--limit", default=50, show_default=True),
@@ -320,9 +321,9 @@ def _area_options(command):
320
321
 
321
322
  @cloud_area.command("list")
322
323
  @_area_options
323
- def cloud_area_list(entity, parent, query, limit, cursor, output):
324
+ def cloud_area_list(workspace, parent, query, limit, cursor, output):
324
325
  """List the organizational areas the credential can see."""
325
- _hierarchy_list("/v1/areas", "Areas", entity, parent, query, limit, cursor, output)
326
+ _hierarchy_list("/v1/areas", "Areas", workspace, parent, query, limit, cursor, output)
326
327
 
327
328
 
328
329
  @cloud.group("location")
@@ -332,9 +333,9 @@ def cloud_location():
332
333
 
333
334
  @cloud_location.command("list")
334
335
  @_area_options
335
- def cloud_location_list(entity, parent, query, limit, cursor, output):
336
+ def cloud_location_list(workspace, parent, query, limit, cursor, output):
336
337
  """List the document folders the credential can see."""
337
- _hierarchy_list("/v1/locations", "Locations", entity, parent, query, limit, cursor, output)
338
+ _hierarchy_list("/v1/locations", "Locations", workspace, parent, query, limit, cursor, output)
338
339
 
339
340
 
340
341
  # ── cloud group (signed-in person only) ──────────────────────────────────────
@@ -481,81 +482,81 @@ def cloud_document_edges(document_code: str, neighbor_limit: int):
481
482
  _emit_json(_v1("GET", f"/v1/documents/{_segment(document_code)}/edges", params={"neighbor_limit": neighbor_limit}))
482
483
 
483
484
 
484
- # ── cloud space ──────────────────────────────────────────────────────────────
485
+ # ── cloud collection ──────────────────────────────────────────────────────────────
485
486
 
486
- @cloud.group("space")
487
- def cloud_space():
488
- """Working spaces."""
487
+ @cloud.group("collection")
488
+ def cloud_collection():
489
+ """Collections."""
489
490
 
490
491
 
491
- @cloud_space.command("list")
492
+ @cloud_collection.command("list")
492
493
  @click.option("--limit", default=20, show_default=True)
493
494
  @click.option("-o", "--output", type=OUTPUT_LIST, default="table")
494
- def cloud_space_list(limit: int, output: str):
495
- """List working spaces."""
496
- data = _v1("GET", "/v1/spaces", params={"limit": limit})
497
- _list(data, output, key="spaces", id_key="space_id", title="Working spaces",
498
- columns=[("ID", "space_id"), ("Name", "name"), ("Type", "type"), ("Scope", "scope"),
495
+ def cloud_collection_list(limit: int, output: str):
496
+ """List collections."""
497
+ data = _v1("GET", "/v1/collections", params={"limit": limit})
498
+ _list(data, output, key="collections", id_key="collection_id", title="Collections",
499
+ columns=[("ID", "collection_id"), ("Name", "name"), ("Type", "type"), ("Scope", "scope"),
499
500
  ("Docs", "total_documents"), ("Created", "created_at")])
500
501
 
501
502
 
502
- @cloud_space.command("show")
503
- @click.argument("space_id", type=int)
503
+ @cloud_collection.command("show")
504
+ @click.argument("collection_id", type=int)
504
505
  @click.option("--document-limit", default=20, show_default=True)
505
506
  @click.option("-o", "--output", type=OUTPUT_TABLE, default="table")
506
- def cloud_space_show(space_id: int, document_limit: int, output: str):
507
- """Show a working space with its documents."""
508
- data = _v1("GET", f"/v1/spaces/{space_id}", params={"document_limit": document_limit})
507
+ def cloud_collection_show(collection_id: int, document_limit: int, output: str):
508
+ """Show a collection with its documents."""
509
+ data = _v1("GET", f"/v1/collections/{collection_id}", params={"document_limit": document_limit})
509
510
  if output == "json":
510
511
  _emit_json(data)
511
512
  return
512
- _fields(f"Working space #{space_id}", data.get("space") or {}, [
513
+ _fields(f"Collection #{collection_id}", data.get("collection") or {}, [
513
514
  ("Name", "name"), ("Type", "type"), ("Scope", "scope"), ("Criterion", "criterion"),
514
515
  ("Documents", "total_documents"), ("Created", "created_at"),
515
516
  ])
516
517
  _table("Documents", data.get("documents") or [], [("Code", "code"), ("Name", "name"), ("Status", "status")])
517
518
 
518
519
 
519
- @cloud_space.command("compose")
520
+ @cloud_collection.command("compose")
520
521
  @click.argument("operation", type=click.Choice(["union", "intersection", "difference", "symmetric_difference"]))
521
- @click.argument("space_a", type=int)
522
- @click.argument("space_b", type=int)
522
+ @click.argument("collection_a", type=int)
523
+ @click.argument("collection_b", type=int)
523
524
  @click.option("--name", default="", help="Name of the result (generated when empty)")
524
- @click.option("--type", "space_type", type=click.Choice(["AREA", "SPACE"]), default="AREA", show_default=True)
525
+ @click.option("--type", "collection_type", type=click.Choice(["TEMPORARY", "SAVED"]), default="TEMPORARY", show_default=True)
525
526
  @click.option("-o", "--output", type=OUTPUT_TABLE, default="json")
526
- def cloud_space_compose(operation: str, space_a: int, space_b: int, name: str, space_type: str, output: str):
527
- """Combine two working spaces by set algebra into a new one."""
528
- data = _v1("POST", "/v1/spaces/compose", body={
529
- "operation": operation, "space_id_a": space_a, "space_id_b": space_b,
530
- "name": name, "space_type": space_type,
527
+ def cloud_collection_compose(operation: str, collection_a: int, collection_b: int, name: str, collection_type: str, output: str):
528
+ """Combine two collections by set algebra into a new one."""
529
+ data = _v1("POST", "/v1/collections/compose", body={
530
+ "operation": operation, "collection_id_a": collection_a, "collection_id_b": collection_b,
531
+ "name": name, "collection_type": collection_type,
531
532
  })
532
- _emit_json(data) if output == "json" else _fields("New working space", data, [
533
- ("ID", "space_id"), ("Name", "name"), ("Type", "type"), ("Documents", "total_documents")])
533
+ _emit_json(data) if output == "json" else _fields("New collection", data, [
534
+ ("ID", "collection_id"), ("Name", "name"), ("Type", "type"), ("Documents", "total_documents")])
534
535
 
535
536
 
536
- @cloud_space.command("read")
537
- @click.argument("space_id", type=int)
537
+ @cloud_collection.command("read")
538
+ @click.argument("collection_id", type=int)
538
539
  @click.option("--resolution", type=click.Choice(["count", "manifest", "chunks", "text"]), default="manifest", show_default=True)
539
540
  @click.option("--query", default="", help="Sub-question to rank by (required with --resolution chunks)")
540
541
  @click.option("--limit", type=int, default=50, show_default=True)
541
- def cloud_space_read(space_id: int, resolution: str, query: str, limit: int):
542
- """Read a working space at the chosen resolution (JSON output)."""
543
- _emit_json(_v1("POST", f"/v1/spaces/{space_id}/read",
542
+ def cloud_collection_read(collection_id: int, resolution: str, query: str, limit: int):
543
+ """Read a collection at the chosen resolution (JSON output)."""
544
+ _emit_json(_v1("POST", f"/v1/collections/{collection_id}/read",
544
545
  body={"resolution": resolution, "query": query, "limit": limit}))
545
546
 
546
547
 
547
- @cloud_space.command("refresh")
548
- @click.argument("space_id", type=int)
549
- def cloud_space_refresh(space_id: int):
550
- """Recompute the members of a working space (JSON output)."""
551
- _emit_json(_v1("POST", f"/v1/spaces/{space_id}/refresh"))
548
+ @cloud_collection.command("refresh")
549
+ @click.argument("collection_id", type=int)
550
+ def cloud_collection_refresh(collection_id: int):
551
+ """Recompute the members of a collection (JSON output)."""
552
+ _emit_json(_v1("POST", f"/v1/collections/{collection_id}/refresh"))
552
553
 
553
554
 
554
- @cloud_space.command("promote")
555
- @click.argument("space_id", type=int)
556
- def cloud_space_promote(space_id: int):
557
- """Turn a temporary working space into a permanent one (JSON output)."""
558
- _emit_json(_v1("POST", f"/v1/spaces/{space_id}/promote"))
555
+ @cloud_collection.command("save")
556
+ @click.argument("collection_id", type=int)
557
+ def cloud_collection_save(collection_id: int):
558
+ """Save a temporary collection as a saved one (JSON output)."""
559
+ _emit_json(_v1("POST", f"/v1/collections/{collection_id}/save"))
559
560
 
560
561
 
561
562
  # ── cloud queue ──────────────────────────────────────────────────────────────
@@ -619,14 +620,14 @@ def cloud_skill_show(skill_code: str, output: str):
619
620
 
620
621
  @cloud_skill.command("run")
621
622
  @click.argument("skill_code")
622
- @click.option("--space", type=int, default=None, help="Working space ID")
623
+ @click.option("--collection", type=int, default=None, help="Collection ID")
623
624
  @click.option("--document", default=None, help="Single document code")
624
625
  @click.option("-o", "--output", type=OUTPUT_TABLE, default="table")
625
- def cloud_skill_run(skill_code: str, space: int | None, document: str | None, output: str):
626
- """Run a skill on a working space or a document."""
627
- if not space and not document:
628
- raise click.UsageError("Provide --space <ID> or --document <CODE>")
629
- body = {k: v for k, v in {"space_id": space, "document_code": document}.items() if v is not None}
626
+ def cloud_skill_run(skill_code: str, collection: int | None, document: str | None, output: str):
627
+ """Run a skill on a collection or a document."""
628
+ if not collection and not document:
629
+ raise click.UsageError("Provide --collection <ID> or --document <CODE>")
630
+ body = {k: v for k, v in {"collection_id": collection, "document_code": document}.items() if v is not None}
630
631
  data = _v1("POST", f"/v1/skills/{_segment(skill_code)}/run", body=body)
631
632
  if output == "json":
632
633
  _emit_json(data)
@@ -655,15 +656,15 @@ def cloud_catalog(type_: str, output: str):
655
656
 
656
657
  @cloud.group("document-type")
657
658
  def cloud_document_type():
658
- """Document types of an entity: the codes `search --filter` accepts."""
659
+ """Document types of a workspace: the codes `search --filter` accepts."""
659
660
 
660
661
 
661
662
  @cloud_document_type.command("list")
662
- @click.option("--entity", default=None, help="Entity code (defaults to the active entity)")
663
+ @click.option("--workspace", default=None, help="Workspace code (defaults to the active workspace)")
663
664
  @click.option("-o", "--output", type=OUTPUT_LIST, default="table")
664
- def cloud_document_type_list(entity: str | None, output: str):
665
- """List the document types of the entity, with their parent type."""
666
- data = _v1("GET", "/v1/catalog/document-types", params={"entity_code": entity})
665
+ def cloud_document_type_list(workspace: str | None, output: str):
666
+ """List the document types of the workspace, with their parent type."""
667
+ data = _v1("GET", "/v1/catalog/document-types", params={"workspace_code": workspace})
667
668
  _list(data, output, key="document_types", id_key="code", title="Document types",
668
669
  columns=[("Code", "code"), ("Name", "name"), ("Parent", "parent_code"), ("Documents", "document_count")])
669
670
 
@@ -675,12 +676,12 @@ def cloud_characteristic():
675
676
 
676
677
  @cloud_characteristic.command("list")
677
678
  @click.option("--document-type", "document_types", multiple=True, help="Document type code (repeat for several)")
678
- @click.option("--entity", default=None, help="Entity code (defaults to the active entity)")
679
+ @click.option("--workspace", default=None, help="Workspace code (defaults to the active workspace)")
679
680
  @click.option("-o", "--output", type=OUTPUT_LIST, default="table")
680
- def cloud_characteristic_list(document_types: tuple[str, ...], entity: str | None, output: str):
681
+ def cloud_characteristic_list(document_types: tuple[str, ...], workspace: str | None, output: str):
681
682
  """List the characteristics available for those types (all when none is given)."""
682
683
  data = _v1("GET", "/v1/catalog/characteristics", params={
683
- "document_types": ",".join(document_types) or None, "entity_code": entity})
684
+ "document_types": ",".join(document_types) or None, "workspace_code": workspace})
684
685
  _list(data, output, key="characteristics", id_key="code", title="Characteristics",
685
686
  columns=[("Category", "category_code"), ("Code", "code"), ("Name", "name"), ("Role", "role")])
686
687
 
@@ -707,24 +708,24 @@ def cloud_function_show(function_code: str, output: str):
707
708
  @click.argument("query", nargs=-1, required=True)
708
709
  @click.option("--limit", type=int, default=10, show_default=True)
709
710
  @click.option("--min-similarity", type=float, default=0.0, show_default=True)
710
- @click.option("--entity", default=None, help="Filter by entity code")
711
- @click.option("--space", "space_id", type=int, default=None, help="Search only inside this working space")
711
+ @click.option("--workspace", default=None, help="Filter by workspace code")
712
+ @click.option("--collection", "collection_id", type=int, default=None, help="Search only inside this collection")
712
713
  @click.option("--filter", "filter_json", default=None,
713
714
  help="Structured filter as JSON, @file or - (document_types, attributes, characteristics)")
714
715
  @click.option("--location", "location_code", default=None,
715
716
  help="Search only this visible folder and its subfolders (this request only)")
716
717
  @click.option("-o", "--output", type=OUTPUT_TABLE, default="table")
717
- def cloud_search(query: tuple[str, ...], limit: int, min_similarity: float, entity: str | None,
718
- space_id: int | None, filter_json: str | None, location_code: str | None, output: str):
718
+ def cloud_search(query: tuple[str, ...], limit: int, min_similarity: float, workspace: str | None,
719
+ collection_id: int | None, filter_json: str | None, location_code: str | None, output: str):
719
720
  """Semantic search over the group's vectorized documents."""
720
721
  text = " ".join(query).strip()
721
722
  if not text:
722
723
  raise click.UsageError("The query cannot be empty.")
723
724
  body = {"query": text, "limit": limit, "min_similarity": min_similarity}
724
- if entity:
725
- body["entity_code"] = entity
726
- if space_id is not None:
727
- body["space_id"] = space_id
725
+ if workspace:
726
+ body["workspace_code"] = workspace
727
+ if collection_id is not None:
728
+ body["collection_id"] = collection_id
728
729
  if filter_json:
729
730
  body["filter"] = _json_argument(filter_json, "--filter")
730
731
  if location_code:
@@ -911,22 +912,22 @@ def cloud_process_update(process_code: str, **fields):
911
912
 
912
913
  @cloud.group("organization")
913
914
  def cloud_organization():
914
- """Organization profile (group and entity descriptions and system prompts)."""
915
+ """Organization profile (group and workspace descriptions and system prompts)."""
915
916
 
916
917
 
917
918
  @cloud_organization.command("show")
918
- @click.option("--entity", default=None, help="Entity code (default: the active entity)")
919
- def cloud_organization_show(entity: str | None):
919
+ @click.option("--workspace", default=None, help="Workspace code (default: the active workspace)")
920
+ def cloud_organization_show(workspace: str | None):
920
921
  """Show the organization profile (JSON)."""
921
- _emit_json(_v1("GET", "/v1/organization", params={"entity_code": entity}))
922
+ _emit_json(_v1("GET", "/v1/organization", params={"workspace_code": workspace}))
922
923
 
923
924
 
924
925
  @cloud_organization.command("update")
925
926
  @click.option("--group-description", default=None)
926
927
  @click.option("--group-system-prompt", default=None)
927
- @click.option("--entity-description", default=None)
928
- @click.option("--entity-system-prompt", default=None)
929
- @click.option("--entity", "entity_code", default=None)
928
+ @click.option("--workspace-description", default=None)
929
+ @click.option("--workspace-system-prompt", default=None)
930
+ @click.option("--workspace", "workspace_code", default=None)
930
931
  def cloud_organization_update(**fields):
931
932
  """Update the organization profile. Only the options you pass are written."""
932
933
  body = {k: v for k, v in fields.items() if v is not None}
@@ -938,13 +939,13 @@ def cloud_organization_update(**fields):
938
939
  @cloud_organization.command("draft")
939
940
  @click.option("--source-file", type=click.Path(exists=True, dir_okay=False), default=None,
940
941
  help="Text describing the organization (default: stdin)")
941
- @click.option("--entity", "entity_code", default=None)
942
- def cloud_organization_draft(source_file: str | None, entity_code: str | None):
942
+ @click.option("--workspace", "workspace_code", default=None)
943
+ def cloud_organization_draft(source_file: str | None, workspace_code: str | None):
943
944
  """Draft the profile texts from a source text (does not write them)."""
944
945
  source = Path(source_file).read_text(encoding="utf-8") if source_file else sys.stdin.read()
945
946
  body = {"source_text": source}
946
- if entity_code:
947
- body["entity_code"] = entity_code
947
+ if workspace_code:
948
+ body["workspace_code"] = workspace_code
948
949
  _emit_json(_v1("POST", "/v1/organization/draft", body=body))
949
950
 
950
951
 
@@ -1,11 +1,12 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ragfly-cli
3
- Version: 1.21.0
3
+ Version: 2.0.0
4
4
  Summary: RAGfly CLI — operate RAGfly from the terminal and CI (login + cloud API). Lightweight, no desktop dependencies.
5
5
  Author: CAB Ltda
6
6
  License: MIT
7
7
  Project-URL: Homepage, https://ragfly.ai
8
8
  Project-URL: Documentation, https://api.ragfly.ai/docs
9
+ Project-URL: Repository, https://github.com/RAGfly/ragfly-cli
9
10
  Keywords: ragfly,rag,cli,retrieval,ai,mcp
10
11
  Requires-Python: >=3.10
11
12
  Description-Content-Type: text/markdown
@@ -75,13 +76,13 @@ ragfly
75
76
  ├── login / logout / version
76
77
  └── cloud ← the English REST /v1 contract of api.ragfly.ai
77
78
  ├── me
78
- ├── entity set [ENTITY_CODE] | set --clear
79
+ ├── workspace set [WORKSPACE_CODE] | set --clear
79
80
  ├── area set [AREA_CODE] | set --release | list
80
81
  ├── location list
81
82
  ├── group list | switch | clear (signed-in person)
82
83
  ├── api-key create | list | revoke (signed-in person)
83
84
  ├── document list | show | edges
84
- ├── space list | show | compose | read | refresh | promote
85
+ ├── collection list | show | compose | read | refresh | save
85
86
  ├── queue show | runs
86
87
  ├── skill list | show | run
87
88
  ├── catalog
@@ -115,10 +116,10 @@ Output is English end to end (`--status VECTORIZED`, `-o json | jq`).
115
116
 
116
117
  ```bash
117
118
  ragfly cloud document list --status VECTORIZED --limit 20 -o id
118
- ragfly cloud skill run SUMMARIZE_DOCUMENT --space 12
119
+ ragfly cloud skill run SUMMARIZE_DOCUMENT --collection 12
119
120
  ragfly cloud search "Q1 revenue"
120
- ragfly cloud search "statements" --filter @filter.json --space 12
121
- ragfly cloud chat ask "How do I release the entity of my key?" --mode help
121
+ ragfly cloud search "statements" --filter @filter.json --collection 12
122
+ ragfly cloud chat ask "How do I release the workspace of my key?" --mode help
122
123
  ```
123
124
 
124
125
  Full reference: <https://api.ragfly.ai/docs>.
@@ -47,17 +47,17 @@ def test_every_cloud_call_goes_to_v1_with_the_cli_surface(wire):
47
47
  assert call["headers"]["X-RAGfly-Client"] == "cli"
48
48
 
49
49
 
50
- def test_entity_set_and_release_use_the_single_public_session_operation(wire):
51
- wire.reply = httpx.Response(200, json={"active_entity": "E1"})
52
- result = run("cloud", "entity", "set", "E1", "-o", "json")
50
+ def test_workspace_set_and_release_use_the_single_public_session_operation(wire):
51
+ wire.reply = httpx.Response(200, json={"active_workspace": "E1"})
52
+ result = run("cloud", "workspace", "set", "E1", "-o", "json")
53
53
  assert result.exit_code == 0, result.output
54
- assert wire.calls[0]["url"].endswith("/v1/session/active-entity")
55
- assert wire.calls[0]["json"] == {"entity_code": "E1"}
54
+ assert wire.calls[0]["url"].endswith("/v1/session/active-workspace")
55
+ assert wire.calls[0]["json"] == {"workspace_code": "E1"}
56
56
 
57
- wire.reply = httpx.Response(200, json={"active_entity": None})
58
- result = run("cloud", "entity", "set", "--release", "-o", "json")
57
+ wire.reply = httpx.Response(200, json={"active_workspace": None})
58
+ result = run("cloud", "workspace", "set", "--release", "-o", "json")
59
59
  assert result.exit_code == 0, result.output
60
- assert wire.calls[1]["json"] == {"entity_code": None}
60
+ assert wire.calls[1]["json"] == {"workspace_code": None}
61
61
 
62
62
 
63
63
  def test_agent_context_and_tool(wire):
@@ -1,4 +1,4 @@
1
- """The CLI exposes the same /v1 operations as the SDKs and MCP: ask mode, filtered search, catalogs, spaces, areas and locations."""
1
+ """The CLI exposes the same /v1 operations as the SDKs and MCP: ask mode, filtered search, catalogs, collections, areas and locations."""
2
2
  import json
3
3
 
4
4
  import httpx
@@ -35,48 +35,48 @@ def run(*args):
35
35
 
36
36
  def test_ask_sends_mode_only_when_given(wire):
37
37
  wire.reply = httpx.Response(200, json={"answer": "A", "conversation_id": 1})
38
- assert run("cloud", "chat", "ask", "how do I release the entity?", "--mode", "help").exit_code == 0
39
- assert wire.calls[0]["json"] == {"question": "how do I release the entity?", "function_code": "CHAT-USER", "mode": "help"}
38
+ assert run("cloud", "chat", "ask", "how do I release the workspace?", "--mode", "help").exit_code == 0
39
+ assert wire.calls[0]["json"] == {"question": "how do I release the workspace?", "function_code": "CHAT-USER", "mode": "help"}
40
40
  assert run("cloud", "chat", "ask", "hello").exit_code == 0
41
41
  assert "mode" not in wire.calls[1]["json"]
42
42
  assert run("cloud", "chat", "ask", "hello", "--mode", "support").exit_code != 0
43
43
 
44
44
 
45
- def test_search_takes_space_and_structured_filter(wire):
45
+ def test_search_takes_collection_and_structured_filter(wire):
46
46
  wire.reply = httpx.Response(200, json={"documents": []})
47
47
  flt = {"document_types": ["TDOC_cartola"], "attributes": [{"field": "language", "operator": "EQ", "value": "es"}]}
48
- result = run("cloud", "search", "cartolas", "--space", "12", "--filter", json.dumps(flt), "-o", "json")
48
+ result = run("cloud", "search", "cartolas", "--collection", "12", "--filter", json.dumps(flt), "-o", "json")
49
49
  assert result.exit_code == 0, result.output
50
50
  body = wire.calls[0]["json"]
51
51
  assert wire.calls[0]["url"].endswith("/v1/documents/search")
52
- assert body["query"] == "cartolas" and body["space_id"] == 12 and body["filter"] == flt
52
+ assert body["query"] == "cartolas" and body["collection_id"] == 12 and body["filter"] == flt
53
53
  assert run("cloud", "search", "x", "--filter", "[1]").exit_code != 0 # a filter is a JSON object
54
54
 
55
55
 
56
56
  def test_catalog_commands_call_the_public_catalog_routes(wire):
57
57
  wire.reply = httpx.Response(200, json={"document_types": [{"code": "T1", "name": "Statement", "parent_code": None, "document_count": 3}]})
58
- assert run("cloud", "document-type", "list", "--entity", "E1", "-o", "id").output.strip() == "T1"
59
- assert wire.calls[0]["url"].endswith("/v1/catalog/document-types") and wire.calls[0]["params"] == {"entity_code": "E1"}
58
+ assert run("cloud", "document-type", "list", "--workspace", "E1", "-o", "id").output.strip() == "T1"
59
+ assert wire.calls[0]["url"].endswith("/v1/catalog/document-types") and wire.calls[0]["params"] == {"workspace_code": "E1"}
60
60
  wire.reply = httpx.Response(200, json={"characteristics": []})
61
61
  assert run("cloud", "characteristic", "list", "--document-type", "T1", "--document-type", "T2", "-o", "json").exit_code == 0
62
62
  assert wire.calls[1]["url"].endswith("/v1/catalog/characteristics")
63
63
  assert wire.calls[1]["params"] == {"document_types": "T1,T2"}
64
64
 
65
65
 
66
- def test_space_commands_cover_compose_read_refresh_and_promote(wire):
67
- wire.reply = httpx.Response(200, json={"space_id": 9})
68
- assert run("cloud", "space", "compose", "difference", "1", "2", "--name", "N", "--type", "SPACE").exit_code == 0
69
- assert wire.calls[0]["url"].endswith("/v1/spaces/compose")
70
- assert wire.calls[0]["json"] == {"operation": "difference", "space_id_a": 1, "space_id_b": 2, "name": "N", "space_type": "SPACE"}
71
- assert run("cloud", "space", "read", "9", "--resolution", "chunks", "--query", "q", "--limit", "5").exit_code == 0
72
- assert wire.calls[1]["url"].endswith("/v1/spaces/9/read")
66
+ def test_collection_commands_cover_compose_read_refresh_and_save(wire):
67
+ wire.reply = httpx.Response(200, json={"collection_id": 9})
68
+ assert run("cloud", "collection", "compose", "difference", "1", "2", "--name", "N", "--type", "SAVED").exit_code == 0
69
+ assert wire.calls[0]["url"].endswith("/v1/collections/compose")
70
+ assert wire.calls[0]["json"] == {"operation": "difference", "collection_id_a": 1, "collection_id_b": 2, "name": "N", "collection_type": "SAVED"}
71
+ assert run("cloud", "collection", "read", "9", "--resolution", "chunks", "--query", "q", "--limit", "5").exit_code == 0
72
+ assert wire.calls[1]["url"].endswith("/v1/collections/9/read")
73
73
  assert wire.calls[1]["json"] == {"resolution": "chunks", "query": "q", "limit": 5}
74
- assert run("cloud", "space", "refresh", "9").exit_code == 0 and wire.calls[2]["url"].endswith("/v1/spaces/9/refresh")
75
- assert run("cloud", "space", "promote", "9").exit_code == 0 and wire.calls[3]["url"].endswith("/v1/spaces/9/promote")
74
+ assert run("cloud", "collection", "refresh", "9").exit_code == 0 and wire.calls[2]["url"].endswith("/v1/collections/9/refresh")
75
+ assert run("cloud", "collection", "save", "9").exit_code == 0 and wire.calls[3]["url"].endswith("/v1/collections/9/save")
76
76
 
77
77
 
78
78
  def test_area_set_and_release_send_the_area_focus(wire):
79
- wire.reply = httpx.Response(200, json={"active_area": "FIN", "active_entity": "E1"})
79
+ wire.reply = httpx.Response(200, json={"active_area": "FIN", "active_workspace": "E1"})
80
80
  assert run("cloud", "area", "set", "FIN").exit_code == 0
81
81
  assert wire.calls[0]["url"].endswith("/v1/session/active-area") and wire.calls[0]["json"] == {"area_code": "FIN"}
82
82
  assert run("cloud", "area", "set", "--release").exit_code == 0
@@ -87,12 +87,12 @@ def test_area_set_and_release_send_the_area_focus(wire):
87
87
 
88
88
  def test_area_and_location_lists_call_their_routes_with_paging(wire):
89
89
  wire.reply = httpx.Response(200, json={"items": [{"code": "A1", "name": "Finance", "parent_code": None,
90
- "depth": 0, "entity_code": "E1"}], "next_cursor": None})
91
- out = run("cloud", "area", "list", "--entity", "E1", "--parent", "A0", "--query", "fin", "--limit", "10",
90
+ "depth": 0, "workspace_code": "E1"}], "next_cursor": None})
91
+ out = run("cloud", "area", "list", "--workspace", "E1", "--parent", "A0", "--query", "fin", "--limit", "10",
92
92
  "--cursor", "c1", "-o", "id")
93
93
  assert out.exit_code == 0 and out.output.strip() == "A1"
94
94
  assert wire.calls[0]["url"].endswith("/v1/areas")
95
- assert wire.calls[0]["params"] == {"entity_code": "E1", "parent_code": "A0", "query": "fin", "limit": 10, "cursor": "c1"}
95
+ assert wire.calls[0]["params"] == {"workspace_code": "E1", "parent_code": "A0", "query": "fin", "limit": 10, "cursor": "c1"}
96
96
  assert run("cloud", "location", "list", "-o", "json").exit_code == 0
97
97
  assert wire.calls[1]["url"].endswith("/v1/locations") and wire.calls[1]["params"] == {"limit": 50}
98
98
 
@@ -109,8 +109,8 @@ def test_location_narrows_search_document_list_and_ask(wire):
109
109
  assert "location_code" not in wire.calls[3]["json"]
110
110
 
111
111
 
112
- def test_entity_clear_is_the_published_flag_and_release_stays_an_alias(wire):
113
- wire.reply = httpx.Response(200, json={"active_entity": None})
114
- assert run("cloud", "entity", "set", "--clear").exit_code == 0
115
- assert run("cloud", "entity", "set", "--release").exit_code == 0
116
- assert [c["json"] for c in wire.calls] == [{"entity_code": None}, {"entity_code": None}]
112
+ def test_workspace_clear_is_the_published_flag_and_release_stays_an_alias(wire):
113
+ wire.reply = httpx.Response(200, json={"active_workspace": None})
114
+ assert run("cloud", "workspace", "set", "--clear").exit_code == 0
115
+ assert run("cloud", "workspace", "set", "--release").exit_code == 0
116
+ assert [c["json"] for c in wire.calls] == [{"workspace_code": None}, {"workspace_code": None}]
@@ -1 +0,0 @@
1
- __version__ = "1.21.0"
File without changes
File without changes