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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codedthemes-cli
3
- Version: 0.1.2
3
+ Version: 0.1.4
4
4
  Summary: CLI tool for Code Theme and Integration
5
5
  Author: codedthemes
6
6
  Requires-Python: >=3.10
@@ -95,7 +95,8 @@ def handle_init():
95
95
  except:
96
96
  pass
97
97
 
98
- repo_abs_path = str(repo_root)
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[repo_abs_path] = workspace_id
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 = str(repo_root)
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(repo_abs_path)
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[repo_abs_path] = workspace_id
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
- subparsers = parser.add_subparsers(dest="command", required=True)
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):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codedthemes-cli
3
- Version: 0.1.2
3
+ Version: 0.1.4
4
4
  Summary: CLI tool for Code Theme and Integration
5
5
  Author: codedthemes
6
6
  Requires-Python: >=3.10
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "codedthemes-cli"
7
- version = "0.1.2"
7
+ version = "0.1.4"
8
8
  description = "CLI tool for Code Theme and Integration"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"