@@ -15,6 +15,10 @@ The LRM CLI tool supports bidirectional synchronization with LRM Cloud, allowing
1515- [ Backup System] ( #backup-system )
1616- [ Configuration Sync] ( #configuration-sync )
1717- [ Advanced Usage] ( #advanced-usage )
18+ - [ Log Command] ( #log-command )
19+ - [ Revert Command] ( #revert-command )
20+ - [ Snapshot Command] ( #snapshot-command )
21+ - [ API Reference] ( #api-reference )
1822
1923## Overview
2024
@@ -538,25 +542,215 @@ A: Yes, use `--no-backup`, but not recommended:
538542lrm cloud pull --no-backup
539543```
540544
545+ ## Log Command
546+
547+ View the sync history for your project, showing all push and revert operations.
548+
549+ ### Basic Usage
550+
551+ ``` bash
552+ # Show recent sync history (default: 10 entries)
553+ lrm cloud log
554+
555+ # Show more entries
556+ lrm cloud log -n 20
557+
558+ # Compact one-line format
559+ lrm cloud log --oneline
560+
561+ # View details of a specific history entry
562+ lrm cloud log abc12345
563+
564+ # JSON output for automation
565+ lrm cloud log --format json
566+ ```
567+
568+ ### Options
569+
570+ | Option | Description |
571+ | --------| -------------|
572+ | ` [HISTORY_ID] ` | Optional history ID to show details for a specific push |
573+ | ` -n, --number <COUNT> ` | Number of entries to show (default: 10) |
574+ | ` --page <PAGE> ` | Page number for pagination (default: 1) |
575+ | ` --oneline ` | Show compact one-line format |
576+ | ` -f, --format <FORMAT> ` | Output format: table (default), json, simple |
577+
578+ ### Example Output
579+
580+ ```
581+ Sync History
582+ ┌──────────┬─────────────────────┬───────────┬─────────┬──────────┬─────────────────────┐
583+ │ ID │ Date │ Operation │ Added │ Modified │ Message │
584+ ├──────────┼─────────────────────┼───────────┼─────────┼──────────┼─────────────────────┤
585+ │ abc12345 │ 2024-01-15 10:30:22 │ push │ 5 │ 12 │ Added translations │
586+ │ def67890 │ 2024-01-14 16:45:10 │ push │ 0 │ 3 │ Fixed typos │
587+ │ ghi11213 │ 2024-01-14 09:15:00 │ revert │ 0 │ 0 │ Revert: abc12345 │
588+ └──────────┴─────────────────────┴───────────┴─────────┴──────────┴─────────────────────┘
589+ ```
590+
591+ ## Revert Command
592+
593+ Undo a previous push by reverting to the state before that push.
594+
595+ ### Basic Usage
596+
597+ ``` bash
598+ # Revert a specific push
599+ lrm cloud revert abc12345
600+
601+ # Revert with a message explaining why
602+ lrm cloud revert abc12345 -m " Rolling back broken translations"
603+
604+ # Preview what would be reverted (dry run)
605+ lrm cloud revert abc12345 --dry-run
606+
607+ # Skip confirmation prompt
608+ lrm cloud revert abc12345 -y
609+ ```
610+
611+ ### Options
612+
613+ | Option | Description |
614+ | --------| -------------|
615+ | ` <HISTORY_ID> ` | The history entry ID to revert (required) |
616+ | ` -m, --message <MESSAGE> ` | Message describing why the revert was done |
617+ | ` -y, --yes ` | Skip confirmation prompt |
618+ | ` --dry-run ` | Show what would be reverted without actually reverting |
619+ | ` -f, --format <FORMAT> ` | Output format: table (default), json, simple |
620+
621+ ### Workflow
622+
623+ 1 . Use ` lrm cloud log ` to find the history ID of the push you want to undo
624+ 2 . Run ` lrm cloud revert <HISTORY_ID> --dry-run ` to preview changes
625+ 3 . If satisfied, run ` lrm cloud revert <HISTORY_ID> ` to perform the revert
626+ 4 . The revert creates a new history entry (visible in ` lrm cloud log ` )
627+
628+ ## Snapshot Command
629+
630+ Create and manage point-in-time snapshots of your project. Snapshots are like named bookmarks in your project's history that you can restore to at any time.
631+
632+ ### Subcommands
633+
634+ #### snapshot list
635+
636+ List all snapshots for the project:
637+
638+ ``` bash
639+ lrm cloud snapshot list
640+ lrm cloud snapshot list --page 2
641+ lrm cloud snapshot list --format json
642+ ```
643+
644+ ** Options:**
645+ - ` --page <PAGE> ` - Page number (default: 1)
646+ - ` --page-size <SIZE> ` - Items per page (default: 20)
647+ - ` -f, --format <FORMAT> ` - Output format: table (default), json, simple
648+
649+ #### snapshot create
650+
651+ Create a new snapshot of the current project state:
652+
653+ ``` bash
654+ # Create snapshot with auto-generated name
655+ lrm cloud snapshot create
656+
657+ # Create snapshot with description
658+ lrm cloud snapshot create " Before major refactor"
659+ ```
660+
661+ ** Options:**
662+ - ` [message] ` - Optional description for the snapshot
663+
664+ #### snapshot show
665+
666+ View details of a specific snapshot:
667+
668+ ``` bash
669+ lrm cloud snapshot show < snapshot-id>
670+ ```
671+
672+ #### snapshot restore
673+
674+ Restore the project to a previous snapshot:
675+
676+ ``` bash
677+ lrm cloud snapshot restore < snapshot-id>
678+ ```
679+
680+ ** Warning:** This will overwrite your current project state with the snapshot's state.
681+
682+ #### snapshot delete
683+
684+ Delete a snapshot:
685+
686+ ``` bash
687+ lrm cloud snapshot delete < snapshot-id>
688+ ```
689+
690+ #### snapshot diff
691+
692+ Compare two snapshots to see what changed:
693+
694+ ``` bash
695+ lrm cloud snapshot diff < from-snapshot-id> < to-snapshot-id>
696+ ```
697+
698+ ### When to Use Snapshots vs History
699+
700+ | Feature | Sync History (` log ` /` revert ` ) | Snapshots |
701+ | ---------| ------------------------------| -----------|
702+ | Created | Automatically on each push | Manually by user |
703+ | Purpose | Track all changes | Mark important milestones |
704+ | Restore | Undo specific pushes | Restore entire project state |
705+ | Retention | May be pruned over time | Kept until deleted |
706+
707+ ** Use Snapshots for:**
708+ - Before major refactoring
709+ - Release versions (v1.0, v2.0)
710+ - Before experimental changes
711+ - Milestone backups
712+
713+ ** Use History/Revert for:**
714+ - Undoing recent mistakes
715+ - Reviewing what changed
716+ - Debugging sync issues
717+
541718## API Reference
542719
543720### Remote Commands
544721
545- - ` lrm remote set <url> ` - Set remote URL
546- - ` lrm remote get ` - Show current remote URL
547- - ` lrm remote unset ` - Remove remote configuration
722+ - ` lrm cloud remote set <url> ` - Set remote URL
723+ - ` lrm cloud remote get ` - Show current remote URL
724+ - ` lrm cloud remote unset ` - Remove remote configuration
548725
549726### Cloud Commands
550727
728+ ** Project Setup:**
551729- ` lrm cloud clone <url> [path] ` - Clone existing project (login + link + pull)
552730- ` lrm cloud init [url] ` - Connect to cloud project (interactive or direct URL)
731+
732+ ** Authentication:**
553733- ` lrm cloud login [host] ` - Authenticate via email/password
554734- ` lrm cloud logout ` - Clear stored tokens
735+ - ` lrm cloud set-token [token] ` - Set authentication token manually
736+ - ` lrm cloud set-api-key [key] ` - Store a CLI API key for authentication
737+
738+ ** Sync Operations:**
555739- ` lrm cloud push [options] ` - Push local changes to cloud
556740- ` lrm cloud pull [options] ` - Pull remote changes from cloud
557741- ` lrm cloud status ` - Show sync status or account info
558- - ` lrm cloud set-token [token] ` - Set authentication token manually
559- - ` lrm cloud set-api-key [key] ` - Store a CLI API key for authentication
742+
743+ ** History & Recovery:**
744+ - ` lrm cloud log [history_id] ` - Show sync history
745+ - ` lrm cloud revert <history_id> ` - Revert a previous push
746+
747+ ** Snapshots:**
748+ - ` lrm cloud snapshot list ` - List all snapshots
749+ - ` lrm cloud snapshot create [message] ` - Create a new snapshot
750+ - ` lrm cloud snapshot show <id> ` - View snapshot details
751+ - ` lrm cloud snapshot restore <id> ` - Restore to a snapshot
752+ - ` lrm cloud snapshot delete <id> ` - Delete a snapshot
753+ - ` lrm cloud snapshot diff <from> <to> ` - Compare two snapshots
560754
561755### Options
562756
@@ -567,6 +761,17 @@ lrm cloud pull --no-backup
567761- ` --strategy <strategy> ` - Resolution strategy (pull only)
568762- ` --config-only ` - Sync configuration only
569763- ` --resources-only ` - Sync resources only
764+ - ` -m, --message <MESSAGE> ` - Commit message (push only)
765+
766+ ** Log Options:**
767+ - ` -n, --number <COUNT> ` - Number of entries to show (default: 10)
768+ - ` --page <PAGE> ` - Page number for pagination
769+ - ` --oneline ` - Compact one-line format
770+
771+ ** Revert Options:**
772+ - ` -m, --message <MESSAGE> ` - Message describing the revert
773+ - ` -y, --yes ` - Skip confirmation prompt
774+ - ` --dry-run ` - Preview without reverting
570775
571776** set-api-key Options:**
572777- ` [key] ` - API key to store (will prompt if not provided)
0 commit comments