codeer-cli 0.1.5__tar.gz → 0.1.6__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.
- {codeer_cli-0.1.5 → codeer_cli-0.1.6}/PKG-INFO +15 -1
- {codeer_cli-0.1.5 → codeer_cli-0.1.6}/README.md +14 -0
- {codeer_cli-0.1.5 → codeer_cli-0.1.6}/pyproject.toml +1 -1
- {codeer_cli-0.1.5 → codeer_cli-0.1.6}/src/codeer_cli/cli.py +4 -1
- {codeer_cli-0.1.5 → codeer_cli-0.1.6}/src/codeer_cli/commands/kb.py +81 -0
- {codeer_cli-0.1.5 → codeer_cli-0.1.6}/src/codeer_cli/kb.py +10 -0
- codeer_cli-0.1.6/tests/test_kb_nodes.py +63 -0
- {codeer_cli-0.1.5 → codeer_cli-0.1.6}/uv.lock +1 -1
- {codeer_cli-0.1.5 → codeer_cli-0.1.6}/.gitignore +0 -0
- {codeer_cli-0.1.5 → codeer_cli-0.1.6}/API_REFERENCE.md +0 -0
- {codeer_cli-0.1.5 → codeer_cli-0.1.6}/src/codeer_cli/__init__.py +0 -0
- {codeer_cli-0.1.5 → codeer_cli-0.1.6}/src/codeer_cli/_validate.py +0 -0
- {codeer_cli-0.1.5 → codeer_cli-0.1.6}/src/codeer_cli/agents.py +0 -0
- {codeer_cli-0.1.5 → codeer_cli-0.1.6}/src/codeer_cli/chats.py +0 -0
- {codeer_cli-0.1.5 → codeer_cli-0.1.6}/src/codeer_cli/client.py +0 -0
- {codeer_cli-0.1.5 → codeer_cli-0.1.6}/src/codeer_cli/commands/__init__.py +0 -0
- {codeer_cli-0.1.5 → codeer_cli-0.1.6}/src/codeer_cli/commands/_util.py +0 -0
- {codeer_cli-0.1.5 → codeer_cli-0.1.6}/src/codeer_cli/commands/agent.py +0 -0
- {codeer_cli-0.1.5 → codeer_cli-0.1.6}/src/codeer_cli/commands/check.py +0 -0
- {codeer_cli-0.1.5 → codeer_cli-0.1.6}/src/codeer_cli/commands/eval_cmd.py +0 -0
- {codeer_cli-0.1.5 → codeer_cli-0.1.6}/src/codeer_cli/commands/history.py +0 -0
- {codeer_cli-0.1.5 → codeer_cli-0.1.6}/src/codeer_cli/commands/profile.py +0 -0
- {codeer_cli-0.1.5 → codeer_cli-0.1.6}/src/codeer_cli/constants.py +0 -0
- {codeer_cli-0.1.5 → codeer_cli-0.1.6}/src/codeer_cli/eval_.py +0 -0
- {codeer_cli-0.1.5 → codeer_cli-0.1.6}/src/codeer_cli/histories.py +0 -0
- {codeer_cli-0.1.5 → codeer_cli-0.1.6}/src/codeer_cli/parse.py +0 -0
- {codeer_cli-0.1.5 → codeer_cli-0.1.6}/tests/test_eval_labels.py +0 -0
- {codeer_cli-0.1.5 → codeer_cli-0.1.6}/tests/test_kb_ranges.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: codeer-cli
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.6
|
|
4
4
|
Summary: Command line tools for managing Codeer agents over the Codeer API.
|
|
5
5
|
Project-URL: Homepage, https://www.codeer.ai
|
|
6
6
|
Author: Codeer.AI
|
|
@@ -180,6 +180,20 @@ paths containing `*` so the shell passes the wildcard to the CLI. Advanced
|
|
|
180
180
|
settings can still be passed through `--config-json`; explicit crawler flags
|
|
181
181
|
override matching JSON keys.
|
|
182
182
|
|
|
183
|
+
## KB node rename and delete
|
|
184
|
+
|
|
185
|
+
Knowledge Base roots, folders, and files are all KnowledgeNodes. Use
|
|
186
|
+
`codeer kb list` and `codeer kb files` to find node IDs, then preview mutations
|
|
187
|
+
with `--dry-run`:
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
codeer kb node-rename --node-id <node-id> --name "New Name" --dry-run
|
|
191
|
+
codeer kb node-delete --node-id <node-id> --dry-run
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
`node-delete` deletes the target node and all descendants. Review the dry-run
|
|
195
|
+
output before rerunning without `--dry-run`.
|
|
196
|
+
|
|
183
197
|
## Context Object FAQ
|
|
184
198
|
|
|
185
199
|
Use Context Object FAQ entries to route high-value questions to a canonical KB
|
|
@@ -162,6 +162,20 @@ paths containing `*` so the shell passes the wildcard to the CLI. Advanced
|
|
|
162
162
|
settings can still be passed through `--config-json`; explicit crawler flags
|
|
163
163
|
override matching JSON keys.
|
|
164
164
|
|
|
165
|
+
## KB node rename and delete
|
|
166
|
+
|
|
167
|
+
Knowledge Base roots, folders, and files are all KnowledgeNodes. Use
|
|
168
|
+
`codeer kb list` and `codeer kb files` to find node IDs, then preview mutations
|
|
169
|
+
with `--dry-run`:
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
codeer kb node-rename --node-id <node-id> --name "New Name" --dry-run
|
|
173
|
+
codeer kb node-delete --node-id <node-id> --dry-run
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
`node-delete` deletes the target node and all descendants. Review the dry-run
|
|
177
|
+
output before rerunning without `--dry-run`.
|
|
178
|
+
|
|
165
179
|
## Context Object FAQ
|
|
166
180
|
|
|
167
181
|
Use Context Object FAQ entries to route high-value questions to a canonical KB
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
codeer check
|
|
4
4
|
codeer agent list|get|apply|diff|versions
|
|
5
|
-
codeer kb list|files|upload|faq-list|faq-get|faq-create|faq-update|faq-delete
|
|
5
|
+
codeer kb list|files|upload|node-rename|node-delete|faq-list|faq-get|faq-create|faq-update|faq-delete
|
|
6
6
|
codeer eval list|label-list|label-create|label-update|label-delete|case-update|case-delete|evaluators|evaluator-create|evaluator-update|run|export|reconcile|cases-apply|rubrics|rubrics-apply
|
|
7
7
|
codeer history list|get|conversations|negative-feedback
|
|
8
8
|
"""
|
|
@@ -28,6 +28,7 @@ Safe workflow for coding agents:
|
|
|
28
28
|
codeer agent list
|
|
29
29
|
codeer agent get <agent-id> --full
|
|
30
30
|
codeer kb list
|
|
31
|
+
codeer kb files --kb-id <kb-id>
|
|
31
32
|
codeer eval list --agent <agent-id>
|
|
32
33
|
codeer eval label-list
|
|
33
34
|
codeer eval case-update --case <case-id> --input "..." --dry-run
|
|
@@ -43,6 +44,8 @@ Preview mutations before applying:
|
|
|
43
44
|
codeer eval cases-apply --agent <agent-id> --cases eval_cases.json --dry-run
|
|
44
45
|
codeer eval rubrics-apply --rubrics rubrics.json --dry-run
|
|
45
46
|
codeer kb upload --dir kb --name "Product KB" --dry-run
|
|
47
|
+
codeer kb node-rename --node-id <node-id> --name "New Name" --dry-run
|
|
48
|
+
codeer kb node-delete --node-id <node-id> --dry-run
|
|
46
49
|
codeer kb faq-create --context-object-id <snapshot-object-id> --question "..." --dry-run
|
|
47
50
|
|
|
48
51
|
Use --out <path> for large raw artifacts; stdout defaults to compact summaries.
|
|
@@ -87,6 +87,21 @@ def register(subparsers):
|
|
|
87
87
|
p.add_argument("--poll-timeout", type=int, default=POLL_TIMEOUT)
|
|
88
88
|
p.set_defaults(func=run_upload)
|
|
89
89
|
|
|
90
|
+
p = sub.add_parser("node-rename", help="Rename a KB root, folder, or file node; run --dry-run first")
|
|
91
|
+
p.add_argument("--node-id", required=True, help="KnowledgeNode UUID")
|
|
92
|
+
p.add_argument("--name", required=True, help="New display name")
|
|
93
|
+
p.add_argument("--dry-run", action="store_true",
|
|
94
|
+
help="Print intended request without writing server state.")
|
|
95
|
+
p.add_argument("--out", default=None, help="Write result JSON to this file too")
|
|
96
|
+
p.set_defaults(func=run_node_rename)
|
|
97
|
+
|
|
98
|
+
p = sub.add_parser("node-delete", help="Delete a KB root, folder, or file node and descendants; run --dry-run first")
|
|
99
|
+
p.add_argument("--node-id", required=True, help="KnowledgeNode UUID")
|
|
100
|
+
p.add_argument("--dry-run", action="store_true",
|
|
101
|
+
help="Print intended request without writing server state.")
|
|
102
|
+
p.add_argument("--out", default=None, help="Write result JSON to this file too")
|
|
103
|
+
p.set_defaults(func=run_node_delete)
|
|
104
|
+
|
|
90
105
|
p = sub.add_parser("faq-list", help="List Context Object FAQ entries")
|
|
91
106
|
p.add_argument("--context-object-id", type=int, default=None,
|
|
92
107
|
help="Filter to a KB file snapshot_object_id")
|
|
@@ -413,6 +428,72 @@ def run_upload(args, client) -> int:
|
|
|
413
428
|
return 0 if not not_ready else 1
|
|
414
429
|
|
|
415
430
|
|
|
431
|
+
def run_node_rename(args, client) -> int:
|
|
432
|
+
workspace_id, organization_id = client.resolve_scope()
|
|
433
|
+
path = f"/external/knowledge-bases/nodes/{args.node_id}"
|
|
434
|
+
body = {"name": args.name}
|
|
435
|
+
if args.dry_run:
|
|
436
|
+
return _dry_run(
|
|
437
|
+
args.out,
|
|
438
|
+
{
|
|
439
|
+
"dry_run": True,
|
|
440
|
+
"operation": "kb_node_rename",
|
|
441
|
+
"method": "PATCH",
|
|
442
|
+
"path": path,
|
|
443
|
+
"workspace_id": workspace_id,
|
|
444
|
+
"organization_id": organization_id,
|
|
445
|
+
"node_id": args.node_id,
|
|
446
|
+
"body": body,
|
|
447
|
+
"would_write_server_state": True,
|
|
448
|
+
"next_step": "Review this summary, then rerun without --dry-run after approval.",
|
|
449
|
+
},
|
|
450
|
+
)
|
|
451
|
+
|
|
452
|
+
response = strip_noisy_fields(
|
|
453
|
+
kb_mod.update_node(
|
|
454
|
+
client,
|
|
455
|
+
organization_id=organization_id,
|
|
456
|
+
workspace_id=workspace_id,
|
|
457
|
+
node_id=args.node_id,
|
|
458
|
+
name=args.name,
|
|
459
|
+
)
|
|
460
|
+
)
|
|
461
|
+
_print_and_write(args.out, response)
|
|
462
|
+
return 0
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
def run_node_delete(args, client) -> int:
|
|
466
|
+
workspace_id, organization_id = client.resolve_scope()
|
|
467
|
+
path = f"/external/knowledge-bases/nodes/{args.node_id}"
|
|
468
|
+
if args.dry_run:
|
|
469
|
+
return _dry_run(
|
|
470
|
+
args.out,
|
|
471
|
+
{
|
|
472
|
+
"dry_run": True,
|
|
473
|
+
"operation": "kb_node_delete",
|
|
474
|
+
"method": "DELETE",
|
|
475
|
+
"path": path,
|
|
476
|
+
"workspace_id": workspace_id,
|
|
477
|
+
"organization_id": organization_id,
|
|
478
|
+
"node_id": args.node_id,
|
|
479
|
+
"deletes_descendants": True,
|
|
480
|
+
"would_write_server_state": True,
|
|
481
|
+
"next_step": "Review this summary, then rerun without --dry-run after approval.",
|
|
482
|
+
},
|
|
483
|
+
)
|
|
484
|
+
|
|
485
|
+
response = strip_noisy_fields(
|
|
486
|
+
kb_mod.delete_node(
|
|
487
|
+
client,
|
|
488
|
+
organization_id=organization_id,
|
|
489
|
+
workspace_id=workspace_id,
|
|
490
|
+
node_id=args.node_id,
|
|
491
|
+
)
|
|
492
|
+
)
|
|
493
|
+
_print_and_write(args.out, response)
|
|
494
|
+
return 0
|
|
495
|
+
|
|
496
|
+
|
|
416
497
|
def run_faq_list(args, client) -> int:
|
|
417
498
|
faqs = kb_mod.list_context_obj_faqs(
|
|
418
499
|
client,
|
|
@@ -138,6 +138,16 @@ def update_node(
|
|
|
138
138
|
return client.patch(f"{_base(organization_id, workspace_id)}/nodes/{node_id}", json=body)
|
|
139
139
|
|
|
140
140
|
|
|
141
|
+
def delete_node(
|
|
142
|
+
client: CodeerClient,
|
|
143
|
+
*,
|
|
144
|
+
organization_id: str,
|
|
145
|
+
workspace_id: str,
|
|
146
|
+
node_id: str,
|
|
147
|
+
) -> dict:
|
|
148
|
+
return client.delete(f"{_base(organization_id, workspace_id)}/nodes/{node_id}")
|
|
149
|
+
|
|
150
|
+
|
|
141
151
|
def upload_file(
|
|
142
152
|
client: CodeerClient,
|
|
143
153
|
*,
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import unittest
|
|
4
|
+
|
|
5
|
+
from codeer_cli import kb as kb_mod
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class FakeClient:
|
|
9
|
+
def __init__(self) -> None:
|
|
10
|
+
self.calls: list[tuple[str, str, dict]] = []
|
|
11
|
+
|
|
12
|
+
def patch(self, path: str, **kwargs):
|
|
13
|
+
self.calls.append(("PATCH", path, kwargs))
|
|
14
|
+
return {"id": "node-1"}
|
|
15
|
+
|
|
16
|
+
def delete(self, path: str, **kwargs):
|
|
17
|
+
self.calls.append(("DELETE", path, kwargs))
|
|
18
|
+
return {"ok": True}
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class KbNodeClientTests(unittest.TestCase):
|
|
22
|
+
def test_update_node_renames_by_patch(self) -> None:
|
|
23
|
+
client = FakeClient()
|
|
24
|
+
|
|
25
|
+
kb_mod.update_node(
|
|
26
|
+
client, # type: ignore[arg-type]
|
|
27
|
+
organization_id="org-1",
|
|
28
|
+
workspace_id="ws-1",
|
|
29
|
+
node_id="node-1",
|
|
30
|
+
name="New Name",
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
self.assertEqual(
|
|
34
|
+
client.calls[0],
|
|
35
|
+
(
|
|
36
|
+
"PATCH",
|
|
37
|
+
"/external/knowledge-bases/nodes/node-1",
|
|
38
|
+
{"json": {"name": "New Name"}},
|
|
39
|
+
),
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
def test_delete_node_deletes_by_node_id(self) -> None:
|
|
43
|
+
client = FakeClient()
|
|
44
|
+
|
|
45
|
+
kb_mod.delete_node(
|
|
46
|
+
client, # type: ignore[arg-type]
|
|
47
|
+
organization_id="org-1",
|
|
48
|
+
workspace_id="ws-1",
|
|
49
|
+
node_id="node-1",
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
self.assertEqual(
|
|
53
|
+
client.calls[0],
|
|
54
|
+
(
|
|
55
|
+
"DELETE",
|
|
56
|
+
"/external/knowledge-bases/nodes/node-1",
|
|
57
|
+
{},
|
|
58
|
+
),
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
if __name__ == "__main__":
|
|
63
|
+
unittest.main()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|