NERDDISCO commited on
Commit
b407e44
·
1 Parent(s): 1552af3

feat(cli): improved dx

Browse files
Files changed (1) hide show
  1. packages/cli/src/cli.ts +51 -4
packages/cli/src/cli.ts CHANGED
@@ -155,8 +155,19 @@ async function connectToSpecificPort(
155
  */
156
  program
157
  .command("find-port")
158
- .description(
159
- "Find robot port with interactive cable detection (Python lerobot compatible)"
 
 
 
 
 
 
 
 
 
 
 
160
  )
161
  .action(async () => {
162
  try {
@@ -188,6 +199,14 @@ program
188
  )
189
  .option("--robot.id <id>", "Robot ID", "default")
190
  .option("--output <path>", "Output calibration file path")
 
 
 
 
 
 
 
 
191
  .action(async (options) => {
192
  try {
193
  const robotType = options["robot.type"];
@@ -310,6 +329,19 @@ program
310
  .option("--robot.id <id>", "Robot ID", "default")
311
  .option("--teleop.type <type>", "Teleoperator type", "keyboard")
312
  .option("--duration <seconds>", "Duration in seconds (0 = unlimited)", "0")
 
 
 
 
 
 
 
 
 
 
 
 
 
313
  .action(async (options) => {
314
  try {
315
  const robotType = options["robot.type"];
@@ -391,6 +423,14 @@ program
391
  )
392
  .option("--robot.id <id>", "Robot ID", "default")
393
  .option("--motors <ids>", "Specific motor IDs to release (comma-separated)")
 
 
 
 
 
 
 
 
394
  .action(async (options) => {
395
  try {
396
  const robotType = options["robot.type"];
@@ -427,8 +467,15 @@ program
427
  */
428
  program
429
  .name("lerobot")
430
- .description("Node.js robotics control CLI - Python lerobot compatible")
431
- .version("0.1.0");
 
 
 
 
 
 
 
432
 
433
  /**
434
  * Parse CLI arguments and run
 
155
  */
156
  program
157
  .command("find-port")
158
+ .description("Find robot port with interactive cable detection")
159
+ .addHelpText(
160
+ "after",
161
+ `
162
+ Examples:
163
+ $ lerobot find-port
164
+
165
+ This command will:
166
+ 1. List current ports
167
+ 2. Ask you to unplug your robot
168
+ 3. Detect which port disappeared
169
+ 4. Ask you to reconnect
170
+ `
171
  )
172
  .action(async () => {
173
  try {
 
199
  )
200
  .option("--robot.id <id>", "Robot ID", "default")
201
  .option("--output <path>", "Output calibration file path")
202
+ .addHelpText(
203
+ "after",
204
+ `
205
+ Examples:
206
+ $ lerobot calibrate --robot.type=so100_follower --robot.port=/dev/ttyUSB0 --robot.id=my_arm
207
+ $ lerobot calibrate --robot.type=so100_follower --robot.port=COM4 --robot.id=production_arm
208
+ `
209
+ )
210
  .action(async (options) => {
211
  try {
212
  const robotType = options["robot.type"];
 
329
  .option("--robot.id <id>", "Robot ID", "default")
330
  .option("--teleop.type <type>", "Teleoperator type", "keyboard")
331
  .option("--duration <seconds>", "Duration in seconds (0 = unlimited)", "0")
332
+ .addHelpText(
333
+ "after",
334
+ `
335
+ Examples:
336
+ $ lerobot teleoperate --robot.type=so100_follower --robot.port=/dev/ttyUSB0 --robot.id=my_arm
337
+ $ lerobot teleop --robot.type=so100_follower --robot.port=COM4 --robot.id=my_arm --duration=60
338
+
339
+ Controls:
340
+ w/s - Motor 1 q/e - Motor 3 t/g - Motor 5
341
+ a/d - Motor 2 r/f - Motor 4 y/h - Motor 6
342
+ Ctrl+C - Stop and exit
343
+ `
344
+ )
345
  .action(async (options) => {
346
  try {
347
  const robotType = options["robot.type"];
 
423
  )
424
  .option("--robot.id <id>", "Robot ID", "default")
425
  .option("--motors <ids>", "Specific motor IDs to release (comma-separated)")
426
+ .addHelpText(
427
+ "after",
428
+ `
429
+ Examples:
430
+ $ lerobot release-motors --robot.type=so100_follower --robot.port=/dev/ttyUSB0 --robot.id=my_arm
431
+ $ lerobot release-motors --robot.type=so100_follower --robot.port=COM4 --robot.id=my_arm --motors=1,2,3
432
+ `
433
+ )
434
  .action(async (options) => {
435
  try {
436
  const robotType = options["robot.type"];
 
467
  */
468
  program
469
  .name("lerobot")
470
+ .description(
471
+ "Control your robot with Node.js (inspired by LeRobot in Python)"
472
+ )
473
+ .version("0.1.0")
474
+ .addHelpText(
475
+ "after",
476
+ `
477
+ `
478
+ );
479
 
480
  /**
481
  * Parse CLI arguments and run