codedthemes-cli 0.1.2__tar.gz → 0.1.4__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.
- {codedthemes_cli-0.1.2 → codedthemes_cli-0.1.4}/PKG-INFO +1 -1
- {codedthemes_cli-0.1.2 → codedthemes_cli-0.1.4}/codedthemes/cli.py +23 -8
- {codedthemes_cli-0.1.2 → codedthemes_cli-0.1.4}/codedthemes/mcp_client.py +2 -2
- {codedthemes_cli-0.1.2 → codedthemes_cli-0.1.4}/codedthemes_cli.egg-info/PKG-INFO +1 -1
- {codedthemes_cli-0.1.2 → codedthemes_cli-0.1.4}/pyproject.toml +1 -1
- {codedthemes_cli-0.1.2 → codedthemes_cli-0.1.4}/README.md +0 -0
- {codedthemes_cli-0.1.2 → codedthemes_cli-0.1.4}/codedthemes/__init__.py +0 -0
- {codedthemes_cli-0.1.2 → codedthemes_cli-0.1.4}/codedthemes/config.py +0 -0
- {codedthemes_cli-0.1.2 → codedthemes_cli-0.1.4}/codedthemes/patch_utils.py +0 -0
- {codedthemes_cli-0.1.2 → codedthemes_cli-0.1.4}/codedthemes/repo_utils.py +0 -0
- {codedthemes_cli-0.1.2 → codedthemes_cli-0.1.4}/codedthemes/sync_manager.py +0 -0
- {codedthemes_cli-0.1.2 → codedthemes_cli-0.1.4}/codedthemes_cli.egg-info/SOURCES.txt +0 -0
- {codedthemes_cli-0.1.2 → codedthemes_cli-0.1.4}/codedthemes_cli.egg-info/dependency_links.txt +0 -0
- {codedthemes_cli-0.1.2 → codedthemes_cli-0.1.4}/codedthemes_cli.egg-info/entry_points.txt +0 -0
- {codedthemes_cli-0.1.2 → codedthemes_cli-0.1.4}/codedthemes_cli.egg-info/requires.txt +0 -0
- {codedthemes_cli-0.1.2 → codedthemes_cli-0.1.4}/codedthemes_cli.egg-info/top_level.txt +0 -0
- {codedthemes_cli-0.1.2 → codedthemes_cli-0.1.4}/setup.cfg +0 -0
|
@@ -95,7 +95,8 @@ def handle_init():
|
|
|
95
95
|
except:
|
|
96
96
|
pass
|
|
97
97
|
|
|
98
|
-
repo_abs_path =
|
|
98
|
+
repo_abs_path = os.path.abspath(repo_root)
|
|
99
|
+
repo_key = repo_abs_path.lower().replace(os.sep, "/")
|
|
99
100
|
print("📦 Zipping and uploading repository (this may take a moment)...")
|
|
100
101
|
upload_result = client.upload_workspace(repo_abs_path, user_email)
|
|
101
102
|
workspace_id = upload_result.get("workspace_id")
|
|
@@ -106,7 +107,7 @@ def handle_init():
|
|
|
106
107
|
|
|
107
108
|
config = load_config()
|
|
108
109
|
last_workspaces = config.get("workspaces", {})
|
|
109
|
-
last_workspaces[
|
|
110
|
+
last_workspaces[repo_key] = workspace_id
|
|
110
111
|
config["workspaces"] = last_workspaces
|
|
111
112
|
save_config(config)
|
|
112
113
|
|
|
@@ -128,7 +129,8 @@ def handle_apply(query: str):
|
|
|
128
129
|
"""
|
|
129
130
|
try:
|
|
130
131
|
repo_root = detect_repo_root()
|
|
131
|
-
repo_abs_path =
|
|
132
|
+
repo_abs_path = os.path.abspath(repo_root)
|
|
133
|
+
repo_key = repo_abs_path.lower().replace(os.sep, "/")
|
|
132
134
|
print(f"🔍 Found repository at {repo_root}")
|
|
133
135
|
|
|
134
136
|
client = MCPClient()
|
|
@@ -143,15 +145,15 @@ def handle_apply(query: str):
|
|
|
143
145
|
sync_manager = SyncManager()
|
|
144
146
|
config = load_config()
|
|
145
147
|
last_workspaces = config.get("workspaces", {})
|
|
146
|
-
workspace_id = last_workspaces.get(
|
|
148
|
+
workspace_id = last_workspaces.get(repo_key)
|
|
147
149
|
|
|
148
150
|
# Verify or re-initialize workspace
|
|
149
151
|
if workspace_id:
|
|
150
|
-
logger_debug = False # toggle for debug
|
|
151
152
|
try:
|
|
152
153
|
check = client.call("check_workspace", {"workspace_id": workspace_id})
|
|
153
154
|
if isinstance(check, dict) and check.get("status") == "ok":
|
|
154
|
-
print(f"✔ Using active workspace: {workspace_id}")
|
|
155
|
+
# print(f"✔ Using active workspace: {workspace_id}")
|
|
156
|
+
pass
|
|
155
157
|
else:
|
|
156
158
|
workspace_id = None
|
|
157
159
|
except:
|
|
@@ -161,7 +163,7 @@ def handle_apply(query: str):
|
|
|
161
163
|
print("📦 Zipping and uploading repository (this may take a moment)...")
|
|
162
164
|
upload_result = client.upload_workspace(repo_abs_path, user_email)
|
|
163
165
|
workspace_id = upload_result.get("workspace_id")
|
|
164
|
-
last_workspaces[
|
|
166
|
+
last_workspaces[repo_key] = workspace_id
|
|
165
167
|
config["workspaces"] = last_workspaces
|
|
166
168
|
save_config(config)
|
|
167
169
|
sync_manager.update_sync_state(repo_abs_path, workspace_id, user_email)
|
|
@@ -304,8 +306,17 @@ def handle_apply(query: str):
|
|
|
304
306
|
|
|
305
307
|
|
|
306
308
|
def main():
|
|
309
|
+
try:
|
|
310
|
+
from importlib.metadata import version
|
|
311
|
+
__version__ = version("codedthemes-cli")
|
|
312
|
+
except Exception:
|
|
313
|
+
__version__ = "unknown"
|
|
314
|
+
|
|
307
315
|
parser = argparse.ArgumentParser(prog="codedthemes", description="CodedThemes CLI client")
|
|
308
|
-
|
|
316
|
+
parser.add_argument("-v", "--version", action="version", version=f"%(prog)s {__version__}")
|
|
317
|
+
|
|
318
|
+
subparsers = parser.add_subparsers(dest="command", required=False) # Changed to False to allow --version to work alone
|
|
319
|
+
|
|
309
320
|
|
|
310
321
|
login_parser = subparsers.add_parser("login", help="Login to MCP server")
|
|
311
322
|
login_parser.add_argument("--server", help="MCP server URL")
|
|
@@ -317,6 +328,10 @@ def main():
|
|
|
317
328
|
|
|
318
329
|
args = parser.parse_args()
|
|
319
330
|
|
|
331
|
+
if not args.command:
|
|
332
|
+
parser.print_help()
|
|
333
|
+
sys.exit(0)
|
|
334
|
+
|
|
320
335
|
if args.command == "login":
|
|
321
336
|
handle_login(args.server)
|
|
322
337
|
elif args.command == "init":
|
|
@@ -12,8 +12,8 @@ class MCPClient:
|
|
|
12
12
|
self.server_url = (
|
|
13
13
|
os.getenv("CODEDTHEMES_SERVER")
|
|
14
14
|
or config.get("server_url")
|
|
15
|
-
or "https://mcp.codedthemes.com
|
|
16
|
-
)
|
|
15
|
+
or "https://mcp.codedthemes.com"
|
|
16
|
+
).rstrip("/")
|
|
17
17
|
self.token = config.get("access_token")
|
|
18
18
|
|
|
19
19
|
def upload_workspace(self, repo_path: str, user_id: str):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{codedthemes_cli-0.1.2 → codedthemes_cli-0.1.4}/codedthemes_cli.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|