ragfly-cli 1.18.0__tar.gz → 1.19.1__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.
- ragfly_cli-1.19.1/PKG-INFO +127 -0
- ragfly_cli-1.19.1/README.md +107 -0
- {ragfly_cli-1.18.0 → ragfly_cli-1.19.1}/pyproject.toml +1 -1
- ragfly_cli-1.19.1/ragfly_cli/__init__.py +1 -0
- {ragfly_cli-1.18.0 → ragfly_cli-1.19.1}/ragfly_cli/_http.py +13 -11
- ragfly_cli-1.19.1/ragfly_cli/cli.py +825 -0
- ragfly_cli-1.19.1/ragfly_cli/cloud_commands.py +194 -0
- {ragfly_cli-1.18.0 → ragfly_cli-1.19.1}/ragfly_cli/grupo_activo.py +1 -1
- {ragfly_cli-1.18.0 → ragfly_cli-1.19.1}/ragfly_cli/oop/cli_command.py +2 -2
- {ragfly_cli-1.18.0 → ragfly_cli-1.19.1}/ragfly_cli/oop/http_client.py +2 -2
- {ragfly_cli-1.18.0 → ragfly_cli-1.19.1}/ragfly_cli/version_check.py +2 -2
- ragfly_cli-1.19.1/ragfly_cli.egg-info/PKG-INFO +127 -0
- {ragfly_cli-1.18.0 → ragfly_cli-1.19.1}/ragfly_cli.egg-info/SOURCES.txt +3 -2
- ragfly_cli-1.19.1/tests/test_agent_context_cli.py +136 -0
- ragfly_cli-1.19.1/tests/test_api_key_group_override.py +18 -0
- ragfly_cli-1.18.0/PKG-INFO +0 -108
- ragfly_cli-1.18.0/README.md +0 -88
- ragfly_cli-1.18.0/ragfly_cli/__init__.py +0 -1
- ragfly_cli-1.18.0/ragfly_cli/cli.py +0 -1231
- ragfly_cli-1.18.0/ragfly_cli/cloud_commands.py +0 -226
- ragfly_cli-1.18.0/ragfly_cli/codes.py +0 -76
- ragfly_cli-1.18.0/ragfly_cli.egg-info/PKG-INFO +0 -108
- {ragfly_cli-1.18.0 → ragfly_cli-1.19.1}/LICENSE +0 -0
- {ragfly_cli-1.18.0 → ragfly_cli-1.19.1}/ragfly_cli/__main__.py +0 -0
- {ragfly_cli-1.18.0 → ragfly_cli-1.19.1}/ragfly_cli/_runtime.py +0 -0
- {ragfly_cli-1.18.0 → ragfly_cli-1.19.1}/ragfly_cli/config.py +0 -0
- {ragfly_cli-1.18.0 → ragfly_cli-1.19.1}/ragfly_cli/keyring_store.py +0 -0
- {ragfly_cli-1.18.0 → ragfly_cli-1.19.1}/ragfly_cli/oop/__init__.py +0 -0
- {ragfly_cli-1.18.0 → ragfly_cli-1.19.1}/ragfly_cli.egg-info/dependency_links.txt +0 -0
- {ragfly_cli-1.18.0 → ragfly_cli-1.19.1}/ragfly_cli.egg-info/entry_points.txt +0 -0
- {ragfly_cli-1.18.0 → ragfly_cli-1.19.1}/ragfly_cli.egg-info/requires.txt +0 -0
- {ragfly_cli-1.18.0 → ragfly_cli-1.19.1}/ragfly_cli.egg-info/top_level.txt +0 -0
- {ragfly_cli-1.18.0 → ragfly_cli-1.19.1}/setup.cfg +0 -0
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ragfly-cli
|
|
3
|
+
Version: 1.19.1
|
|
4
|
+
Summary: RAGfly CLI — operate RAGfly from the terminal and CI (login + cloud API). Lightweight, no desktop dependencies.
|
|
5
|
+
Author: CAB Ltda
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://ragfly.ai
|
|
8
|
+
Project-URL: Documentation, https://api.ragfly.ai/docs
|
|
9
|
+
Keywords: ragfly,rag,cli,retrieval,ai,mcp
|
|
10
|
+
Requires-Python: >=3.10
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Requires-Dist: click>=8.1
|
|
14
|
+
Requires-Dist: rich>=13.0
|
|
15
|
+
Requires-Dist: httpx>=0.27
|
|
16
|
+
Requires-Dist: keyring>=25.0
|
|
17
|
+
Requires-Dist: pydantic>=2.0
|
|
18
|
+
Requires-Dist: pydantic-settings>=2.6
|
|
19
|
+
Dynamic: license-file
|
|
20
|
+
|
|
21
|
+
# RAGfly CLI
|
|
22
|
+
|
|
23
|
+
Operate RAGfly from the terminal and CI — `login` + the full `cloud` API surface
|
|
24
|
+
against `api.ragfly.ai`. Lightweight: depends only on `click`, `rich`, `httpx`
|
|
25
|
+
and `keyring`. **No desktop / PySide6 / OCR dependencies.**
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
pip install ragfly-cli
|
|
29
|
+
ragfly version
|
|
30
|
+
ragfly login
|
|
31
|
+
ragfly cloud me
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
> This package ships the **`ragfly` binary** for scripting and automation.
|
|
35
|
+
> It is distinct from `pip install ragfly` (the **Python SDK**, import `import ragfly`)
|
|
36
|
+
> and from **RAGfly Desktop** (the DMG/exe that bundles the local file worker for
|
|
37
|
+
> `ragfly local scan/sync/daemon`).
|
|
38
|
+
|
|
39
|
+
## Authentication
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
# A person (JWT, stored in the OS keyring)
|
|
43
|
+
ragfly login
|
|
44
|
+
|
|
45
|
+
# Non-interactive / CI / agents (API key, only reaches /v1)
|
|
46
|
+
export RAGFLY_API_KEY=rf_xxxxxxxxxx
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
`cloud group` and `cloud api-key` manage a person's session and credentials: they
|
|
50
|
+
need `ragfly login`, and the server refuses them for an API key.
|
|
51
|
+
|
|
52
|
+
## Opening an original file on disk (optional)
|
|
53
|
+
|
|
54
|
+
Searching and citing need no local path setup. A document result may include an
|
|
55
|
+
`fs` object. For a local relative file, read `fs.home_var` and join that
|
|
56
|
+
environment variable's value with `fs.relative_path`. Each root has its own
|
|
57
|
+
variable; configure only the roots available on this machine.
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
export RAGFLY_HOME_442681="/Users/ana/Dropbox"
|
|
61
|
+
export RAGFLY_HOME_991203="/Volumes/Archive"
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
If `fs.is_cloud_only` is true, use the authorized cloud provider. If
|
|
65
|
+
`fs.is_public_url` is true, open its public URL. If `fs.is_absolute` is true,
|
|
66
|
+
use the absolute path on the machine where it exists. If `fs.home_var` is null
|
|
67
|
+
or unset, do not guess a local root. See the
|
|
68
|
+
[MCP guide](https://ragfly.ai/build/mcp#opening-a-document-on-disk-fs-block)
|
|
69
|
+
for the full order and examples.
|
|
70
|
+
|
|
71
|
+
## Command surface
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
ragfly
|
|
75
|
+
├── login / logout / version
|
|
76
|
+
└── cloud ← the English REST /v1 contract of api.ragfly.ai
|
|
77
|
+
├── me
|
|
78
|
+
├── group list | switch | clear (signed-in person)
|
|
79
|
+
├── api-key create | list | revoke (signed-in person)
|
|
80
|
+
├── document list | show | edges
|
|
81
|
+
├── space list | show
|
|
82
|
+
├── queue show | runs
|
|
83
|
+
├── skill list | show | run
|
|
84
|
+
├── catalog
|
|
85
|
+
├── function show
|
|
86
|
+
├── search
|
|
87
|
+
├── chat ask
|
|
88
|
+
├── agent context | tool
|
|
89
|
+
├── usage
|
|
90
|
+
├── conversation list | delete
|
|
91
|
+
├── process list | show | update
|
|
92
|
+
├── organization show | update | draft
|
|
93
|
+
└── operation list | show | run
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Every operation of the RAGfly application is available through `cloud operation`,
|
|
97
|
+
with the same permissions and audit as the web app:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
ragfly cloud operation list
|
|
101
|
+
ragfly cloud operation show document_types.update # input/output schema
|
|
102
|
+
ragfly cloud operation run document_types.update --input-json '{"code": "TDOC_...", "name": "Invoices"}'
|
|
103
|
+
|
|
104
|
+
# write_confirm operations (deletes, reverts, resets) only run with --confirm
|
|
105
|
+
ragfly cloud operation run document_types.delete --input-json @input.json --confirm
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
`--input-json` takes inline JSON, `@file` or `-` (stdin). Never put secrets in it.
|
|
109
|
+
Output is English end to end (`--status VECTORIZED`, `-o json | jq`).
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
ragfly cloud document list --status VECTORIZED --limit 20 -o id
|
|
113
|
+
ragfly cloud skill run SUMMARIZE_DOCUMENT --space 12
|
|
114
|
+
ragfly cloud search "Q1 revenue"
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Full reference: <https://api.ragfly.ai/docs>.
|
|
118
|
+
|
|
119
|
+
> **Local operations** (`ragfly local scan/sync/daemon`) require the local file
|
|
120
|
+
> worker and ship with **RAGfly Desktop**, not with this package.
|
|
121
|
+
|
|
122
|
+
## Relation to RAGfly Desktop
|
|
123
|
+
|
|
124
|
+
RAGfly Desktop bundles its own `ragfly` binary with the local commands and a
|
|
125
|
+
signed-in person's session. This package is the standalone cloud surface: since
|
|
126
|
+
1.19.0 its `cloud` commands use only the public `/v1` contract, so they no longer
|
|
127
|
+
mirror the Desktop copy.
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# RAGfly CLI
|
|
2
|
+
|
|
3
|
+
Operate RAGfly from the terminal and CI — `login` + the full `cloud` API surface
|
|
4
|
+
against `api.ragfly.ai`. Lightweight: depends only on `click`, `rich`, `httpx`
|
|
5
|
+
and `keyring`. **No desktop / PySide6 / OCR dependencies.**
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pip install ragfly-cli
|
|
9
|
+
ragfly version
|
|
10
|
+
ragfly login
|
|
11
|
+
ragfly cloud me
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
> This package ships the **`ragfly` binary** for scripting and automation.
|
|
15
|
+
> It is distinct from `pip install ragfly` (the **Python SDK**, import `import ragfly`)
|
|
16
|
+
> and from **RAGfly Desktop** (the DMG/exe that bundles the local file worker for
|
|
17
|
+
> `ragfly local scan/sync/daemon`).
|
|
18
|
+
|
|
19
|
+
## Authentication
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
# A person (JWT, stored in the OS keyring)
|
|
23
|
+
ragfly login
|
|
24
|
+
|
|
25
|
+
# Non-interactive / CI / agents (API key, only reaches /v1)
|
|
26
|
+
export RAGFLY_API_KEY=rf_xxxxxxxxxx
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
`cloud group` and `cloud api-key` manage a person's session and credentials: they
|
|
30
|
+
need `ragfly login`, and the server refuses them for an API key.
|
|
31
|
+
|
|
32
|
+
## Opening an original file on disk (optional)
|
|
33
|
+
|
|
34
|
+
Searching and citing need no local path setup. A document result may include an
|
|
35
|
+
`fs` object. For a local relative file, read `fs.home_var` and join that
|
|
36
|
+
environment variable's value with `fs.relative_path`. Each root has its own
|
|
37
|
+
variable; configure only the roots available on this machine.
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
export RAGFLY_HOME_442681="/Users/ana/Dropbox"
|
|
41
|
+
export RAGFLY_HOME_991203="/Volumes/Archive"
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
If `fs.is_cloud_only` is true, use the authorized cloud provider. If
|
|
45
|
+
`fs.is_public_url` is true, open its public URL. If `fs.is_absolute` is true,
|
|
46
|
+
use the absolute path on the machine where it exists. If `fs.home_var` is null
|
|
47
|
+
or unset, do not guess a local root. See the
|
|
48
|
+
[MCP guide](https://ragfly.ai/build/mcp#opening-a-document-on-disk-fs-block)
|
|
49
|
+
for the full order and examples.
|
|
50
|
+
|
|
51
|
+
## Command surface
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
ragfly
|
|
55
|
+
├── login / logout / version
|
|
56
|
+
└── cloud ← the English REST /v1 contract of api.ragfly.ai
|
|
57
|
+
├── me
|
|
58
|
+
├── group list | switch | clear (signed-in person)
|
|
59
|
+
├── api-key create | list | revoke (signed-in person)
|
|
60
|
+
├── document list | show | edges
|
|
61
|
+
├── space list | show
|
|
62
|
+
├── queue show | runs
|
|
63
|
+
├── skill list | show | run
|
|
64
|
+
├── catalog
|
|
65
|
+
├── function show
|
|
66
|
+
├── search
|
|
67
|
+
├── chat ask
|
|
68
|
+
├── agent context | tool
|
|
69
|
+
├── usage
|
|
70
|
+
├── conversation list | delete
|
|
71
|
+
├── process list | show | update
|
|
72
|
+
├── organization show | update | draft
|
|
73
|
+
└── operation list | show | run
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Every operation of the RAGfly application is available through `cloud operation`,
|
|
77
|
+
with the same permissions and audit as the web app:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
ragfly cloud operation list
|
|
81
|
+
ragfly cloud operation show document_types.update # input/output schema
|
|
82
|
+
ragfly cloud operation run document_types.update --input-json '{"code": "TDOC_...", "name": "Invoices"}'
|
|
83
|
+
|
|
84
|
+
# write_confirm operations (deletes, reverts, resets) only run with --confirm
|
|
85
|
+
ragfly cloud operation run document_types.delete --input-json @input.json --confirm
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
`--input-json` takes inline JSON, `@file` or `-` (stdin). Never put secrets in it.
|
|
89
|
+
Output is English end to end (`--status VECTORIZED`, `-o json | jq`).
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
ragfly cloud document list --status VECTORIZED --limit 20 -o id
|
|
93
|
+
ragfly cloud skill run SUMMARIZE_DOCUMENT --space 12
|
|
94
|
+
ragfly cloud search "Q1 revenue"
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Full reference: <https://api.ragfly.ai/docs>.
|
|
98
|
+
|
|
99
|
+
> **Local operations** (`ragfly local scan/sync/daemon`) require the local file
|
|
100
|
+
> worker and ship with **RAGfly Desktop**, not with this package.
|
|
101
|
+
|
|
102
|
+
## Relation to RAGfly Desktop
|
|
103
|
+
|
|
104
|
+
RAGfly Desktop bundles its own `ragfly` binary with the local commands and a
|
|
105
|
+
signed-in person's session. This package is the standalone cloud surface: since
|
|
106
|
+
1.19.0 its `cloud` commands use only the public `/v1` contract, so they no longer
|
|
107
|
+
mirror the Desktop copy.
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "ragfly-cli"
|
|
7
|
-
version = "1.
|
|
7
|
+
version = "1.19.1"
|
|
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"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "1.19.1"
|
|
@@ -41,9 +41,8 @@ def default_headers(
|
|
|
41
41
|
Returns:
|
|
42
42
|
dict de headers listo para pasar a httpx.
|
|
43
43
|
|
|
44
|
-
El header `X-Override-Grupo` se envía
|
|
45
|
-
|
|
46
|
-
que el dropdown de grupo del frontend web).
|
|
44
|
+
El header `X-Override-Grupo` solo se envía para una sesión humana. Una API
|
|
45
|
+
key tiene un grupo fijo en el servidor y nunca hereda el grupo local del CLI.
|
|
47
46
|
"""
|
|
48
47
|
from ragfly_cli import __version__ as _client_version
|
|
49
48
|
|
|
@@ -53,14 +52,17 @@ def default_headers(
|
|
|
53
52
|
if content_type:
|
|
54
53
|
headers["Content-Type"] = "application/json"
|
|
55
54
|
|
|
56
|
-
#
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
55
|
+
# El override pertenece a la sesión humana. Enviar el grupo guardado en
|
|
56
|
+
# otra sesión con una API key puede dar 403 y nunca debe cambiar su alcance.
|
|
57
|
+
grupo = None
|
|
58
|
+
if not (token and token.startswith(("rf_", "slm_live_"))):
|
|
59
|
+
grupo = grupo_override
|
|
60
|
+
if grupo is None:
|
|
61
|
+
try:
|
|
62
|
+
from .config import get_config
|
|
63
|
+
grupo = get_config().codigo_grupo or None
|
|
64
|
+
except Exception:
|
|
65
|
+
grupo = None
|
|
64
66
|
if grupo:
|
|
65
67
|
headers["X-Override-Grupo"] = grupo
|
|
66
68
|
|