Monorepo management for opam overlays
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add --url option to devcontainer and update CLI help

- Add --url option to override devcontainer.json source URL
- Update main CLI help to recommend starting with devcontainer
- Add note that monopam is designed to run in a devcontainer

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

+28 -6
+28 -6
bin/main.ml
··· 1367 1367 1368 1368 (* Devcontainer command *) 1369 1369 1370 + let default_devcontainer_url = 1371 + "https://raw.githubusercontent.com/avsm/claude-ocaml-devcontainer/refs/heads/main/.devcontainer/devcontainer.json" 1372 + 1370 1373 let devcontainer_cmd = 1371 1374 let doc = "Setup and enter a devcontainer environment" in 1372 1375 let man = ··· 1376 1379 "Creates and enters a devcontainer environment for OCaml development \ 1377 1380 with monopam and Claude. If the target directory doesn't have a \ 1378 1381 .devcontainer configuration, it will be created automatically."; 1382 + `P 1383 + "This is the recommended way to get started with monopam. The \ 1384 + devcontainer provides a consistent environment with OCaml, opam, \ 1385 + and all required tools pre-installed."; 1379 1386 `S "WHAT IT DOES"; 1380 1387 `P "For a new directory (no .devcontainer/):"; 1381 1388 `I ("1.", "Creates the target directory if needed"); ··· 1386 1393 `P "For an existing directory with .devcontainer/:"; 1387 1394 `I ("1.", "Starts the devcontainer if not running"); 1388 1395 `I ("2.", "Opens an interactive shell inside the container"); 1396 + `S Manpage.s_options; 1397 + `P "Use $(b,--url) to specify a custom devcontainer.json URL if you want \ 1398 + to use a different base configuration."; 1389 1399 `S Manpage.s_examples; 1390 1400 `P "Create a new devcontainer workspace:"; 1391 1401 `Pre "monopam devcontainer ~/my-ocaml-project"; 1392 1402 `P "Enter an existing devcontainer:"; 1393 1403 `Pre "monopam devcontainer ~/my-ocaml-project"; 1404 + `P "Use a custom devcontainer.json:"; 1405 + `Pre "monopam devcontainer --url https://example.com/devcontainer.json ~/project"; 1394 1406 ] 1395 1407 in 1396 1408 let info = Cmd.info "devcontainer" ~doc ~man in ··· 1398 1410 let doc = "Target directory for the devcontainer workspace." in 1399 1411 Arg.(required & pos 0 (some string) None & info [] ~docv:"PATH" ~doc) 1400 1412 in 1401 - let run path () = 1413 + let url_arg = 1414 + let doc = "URL to fetch devcontainer.json from. Defaults to the claude-ocaml-devcontainer template." in 1415 + Arg.(value & opt string default_devcontainer_url & info ["url"] ~docv:"URL" ~doc) 1416 + in 1417 + let run path url () = 1402 1418 (* Resolve to absolute path *) 1403 1419 let abs_path = 1404 1420 if Filename.is_relative path then ··· 1415 1431 (try Unix.mkdir abs_path 0o755 with Unix.Unix_error (Unix.EEXIST, _, _) -> ()); 1416 1432 (try Unix.mkdir devcontainer_dir 0o755 with Unix.Unix_error (Unix.EEXIST, _, _) -> ()); 1417 1433 (* Fetch devcontainer.json using curl *) 1418 - let url = "https://raw.githubusercontent.com/avsm/claude-ocaml-devcontainer/refs/heads/main/.devcontainer/devcontainer.json" in 1419 - Fmt.pr "Fetching devcontainer.json...@."; 1434 + Fmt.pr "Fetching devcontainer.json from %s...@." url; 1420 1435 let curl_cmd = Printf.sprintf "curl -fsSL '%s' -o '%s'" url devcontainer_json in 1421 1436 let ret = Sys.command curl_cmd in 1422 1437 if ret <> 0 then begin ··· 1442 1457 else 1443 1458 `Ok () 1444 1459 in 1445 - Cmd.v info Term.(ret (const run $ path_arg $ logging_term)) 1460 + Cmd.v info Term.(ret (const run $ path_arg $ url_arg $ logging_term)) 1446 1461 1447 1462 (* Main command group *) 1448 1463 ··· 1454 1469 `P 1455 1470 "Monopam synchronizes packages between an opam overlay repository, \ 1456 1471 individual git checkouts, and a monorepo using git subtrees."; 1472 + `P 1473 + "Monopam is designed to run inside a devcontainer that provides a \ 1474 + consistent OCaml development environment with all required tools \ 1475 + pre-installed."; 1457 1476 `S "QUICK START"; 1458 - `P "First time setup:"; 1477 + `P "Start by creating a devcontainer workspace:"; 1459 1478 `Pre 1460 - "mkdir ~/tangled && cd ~/tangled\n\ 1479 + "monopam devcontainer ~/tangled"; 1480 + `P "Inside the devcontainer, initialize your workspace:"; 1481 + `Pre 1482 + "cd ~/tangled\n\ 1461 1483 monopam verse init --handle yourname.bsky.social\n\ 1462 1484 cd mono"; 1463 1485 `P "Daily workflow:";