MCPcopy Create free account
hub / github.com/JaredStewart/coderlm / cmd_init

Function cmd_init

plugin/skills/coderlm/scripts/coderlm_cli.py:164–191  ·  view source on GitHub ↗
(args: argparse.Namespace)

Source from the content-addressed store, hash-verified

162
163
164def cmd_init(args: argparse.Namespace) -> None:
165 cwd = os.path.abspath(args.cwd or os.getcwd())
166 host = args.host or "127.0.0.1"
167 port = args.port or 3000
168 base = f"http://{host}:{port}/api/v1"
169
170 # Check server health first
171 try:
172 health = _request("GET", f"{base}/health")
173 except SystemExit:
174 return
175
176 # Create session
177 result = _request("POST", f"{base}/sessions", data={"cwd": cwd})
178 state = {
179 "session_id": result["session_id"],
180 "host": host,
181 "port": port,
182 "project": cwd,
183 "created_at": result.get("created_at", ""),
184 }
185 _save_state(state)
186
187 print(f"Session created: {result['session_id']}")
188 print(f"Project: {cwd}")
189 print(f"Server: {health.get('status', 'ok')} "
190 f"({health.get('projects', 0)} projects, "
191 f"{health.get('active_sessions', 0)} sessions)")
192
193
194def cmd_status(args: argparse.Namespace) -> None:

Callers

nothing calls this directly

Calls 3

_requestFunction · 0.85
_save_stateFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected