Next thing to check: why is there JSON decoding error in the project opencode:opencode ? Note that you're running in OpenCode so the database may change as you run. You're running in PowerShell on Windows so you may see encoding problems when you run commands. The dataclaw CLI enforces Python's UTF-8 mode, see @dataclaw\cli.py .
Called the Read tool with the following input: {"filePath":"C:\dataclaw\dataclaw\cli.py"}
C:\dataclaw\dataclaw\cli.py
file
1: """CLI facade for DataClaw."""
2:
3: import os
4: import subprocess
5: import sys
6: from pathlib import Path
7:
8: from ._cli import commands, exporting, review
9: from ._cli.common import DEFAULT_SOURCE, _has_session_sources
10: from ._cli.exporting import push_to_huggingface, summarize_export_jsonl, update_skill
11: from .anonymizer import Anonymizer
12: from .config import CONFIG_FILE, load_config, save_config
13: from .jsonl_tools import diff_jsonl_files, jsonl_to_yaml_file
14: from .parser import discover_projects, iter_project_sessions
15:
16:
17: def list_projects(source_filter: str = "auto") -> None:
18: commands.list_projects(
19: source_filter,
20: discover_projects_fn=discover_projects,
21: load_config_fn=load_config,
22: )
23:
24:
25: def configure(
26: repo: str | None = None,
27: source: str | None = None,
28: exclude: list[str] | None = None,
29: redact: list[str] | None = None,
30: redact_usernames: list[str] | None = None,
31: confirm_projects: bool = False,
32: ):
33: commands.configure(
34: repo=repo,
35: source=source,
36: exclude=exclude,
37: redact=redact,
38: redact_usernames=redact_usernames,
39: confirm_projects=confirm_projects,
40: load_config_fn=load_config,
41: save_config_fn=save_config,
42: config_file=CONFIG_FILE,
43: )
44:
45:
46: def export_to_jsonl(
47: selected_projects: list[dict],
48: output_path: Path,
49: anonymizer: Anonymizer,
50: include_thinking: bool = True,
51: custom_strings: list[str] | None = None,
52: ) -> dict:
53: return exporting.export_to_jsonl(
54: selected_projects,
55: output_path,
56: anonymizer,
57: parse_project_sessions_fn=iter_project_sessions,
58: default_source=DEFAULT_SOURCE,
59: include_thinking=include_thinking,
60: custom_strings=custom_strings,
61: )
62:
63:
64: def status() -> None:
65: commands.status(load_config_fn=load_config)
66:
67:
68: def confirm(
69: file_path: Path | None = None,
70: full_name: str | None = None,
71: attest_asked_full_name: str | None = None,
72: attest_asked_sensitive: str | None = None,
73: attest_manual_scan: str | None = None,
74: skip_full_name_scan: bool = False,
75: ) -> None:
76: review.confirm(
77: file_path=file_path,
78: full_name=full_name,
79: attest_asked_full_name=attest_asked_full_name,
80: attest_asked_sensitive=attest_asked_sensitive,
81: attest_manual_scan=attest_manual_scan,
82: skip_full_name_scan=skip_full_name_scan,
83: load_config_fn=load_config,
84: save_config_fn=save_config,
85: )
86:
87:
88: def prep(source_filter: str = "auto") -> None:
89: commands.prep(
90: source_filter,
91: load_config_fn=load_config,
92: save_config_fn=save_config,
93: discover_projects_fn=discover_projects,
94: has_session_sources_fn=_has_session_sources,
95: )
96:
97:
98: def jsonl_to_yaml(input_path: Path, output_path: Path | None = None) -> Path:
99: return jsonl_to_yaml_file(input_path, output_path)
100:
101:
102: def diff_jsonl(
103: old_path: Path,
104: new_path: Path,
105: output_path: Path | None = None,
106: include_records_for_modified: bool = False,
107: ) -> dict:
108: result = diff_jsonl_files(
109: old_path,
110: new_path,
111: output_path,
112: include_records_for_modified=include_records_for_modified,
113: )
114: return {
115: "output_path": result.output_path,
116: "event_count": result.event_count,
117: "summary": result.summary,
118: }
119:
120:
121: def _handle_config(args) -> None:
122: commands.handle_config(
123: args,
124: load_config_fn=load_config,
125: save_config_fn=save_config,
126: configure_fn=configure,
127: )
128:
129:
130: def _run_export(args) -> None:
131: commands.run_export(
132: args,
133: load_config_fn=load_config,
134: save_config_fn=save_config,
135: discover_projects_fn=discover_projects,
136: has_session_sources_fn=_has_session_sources,
137: export_to_jsonl_fn=export_to_jsonl,
138: summarize_jsonl_fn=summarize_export_jsonl,
139: push_to_huggingface_fn=push_to_huggingface,
140: )
141:
142:
143: def _run_jsonl_to_yaml(args) -> None:
144: commands.run_jsonl_to_yaml(args, jsonl_to_yaml_fn=jsonl_to_yaml)
145:
146:
147: def _run_diff_jsonl(args) -> None:
148: commands.run_diff_jsonl(args, diff_jsonl_fn=diff_jsonl)
149:
150:
151: def main() -> None:
152: if not sys.flags.utf8_mode and "pytest" not in sys.modules:
153: os.environ["PYTHONUTF8"] = "1"
154: ret = subprocess.run([sys.executable, "-m", "dataclaw.cli"] + sys.argv[1:]).returncode
155: sys.exit(ret)
156:
157: commands.main_impl(
158: prep_fn=prep,
159: status_fn=status,
160: confirm_fn=confirm,
161: update_skill_fn=update_skill,
162: list_projects_fn=list_projects,
163: load_config_fn=load_config,
164: handle_config_fn=_handle_config,
165: run_export_fn=_run_export,
166: run_jsonl_to_yaml_fn=_run_jsonl_to_yaml,
167: run_diff_jsonl_fn=_run_diff_jsonl,
168: )
169:
170:
171: if == "":
172: main()