libra op
Command reference for `libra op`
Inspect and restore command-level operation history.
Synopsis
libra op log [OPTIONS]
libra op show [OPTIONS] <OP_REF>
libra op restore [OPTIONS] <OP_REF>Description
libra op provides a command-line surface over the operation graph persisted by
the operation service and wrapper layers.
It currently supports three subcommands:
op log: list recorded operations with pagination and optional command filter.op show: inspect one operation and, optionally, the captured restore view.op restore: move HEAD and branch refs back to a previously captured view.
Operation References
<OP_REF> may be either:
- A concrete operation id, for example
019e3f00-8ee5-7e62-a54c-0ab1f1bba0f9 - A reflog-style index, for example
@{0}for the newest operation or@{1}for the previous one
libra op log
List operation history.
libra op log [--page <N>] [-n <PER_PAGE>] [--command <NAME>] [--verbose]Options
-n, --number <PER_PAGE>
Number of operations to show per page. Defaults to 50.
libra op log -n 20--page <N>
Page number to display. Defaults to 1.
libra op log --page 2 -n 20--command <NAME>
Filter operations by exact command name, such as branch or op restore.
libra op log --command branch
libra op log --command "op restore"--verbose
Show one operation as a multi-line block with actor, status, and timestamp.
libra op log -n 5 --verboselibra op show
Inspect a single operation.
libra op show [--view] <OP_REF>Options
--view
Print the captured restore view, including HEAD target and refs.
libra op show @{0} --viewlibra op restore
Restore repository state to a previously captured operation view. HEAD and the
captured branch refs are reset to the target view, and local branches that are
absent from that view are pruned, so the restore reproduces the operation's
exact local-branch set. The restored HEAD branch is always kept; remote-tracking
refs and Libra-owned internal refs (the locked main/intent/traces
branches and the reserved libra/ namespace, e.g. the AI history branch
libra/intent) are never pruned.
libra op restore [--force] [--dry-run] <OP_REF>Options
--force
Allow restore to proceed even if the working tree is dirty.
libra op restore @{0} --force--dry-run
Show the target HEAD and refs without writing a new restore operation.
libra op restore @{0} --dry-runExamples
# List the newest ten operations
libra op log -n 10
# Show only branch operations on page 2
libra op log --command branch --page 2 -n 5
# Inspect the latest operation and its view snapshot
libra op show @{0} --view
# Restore to the previous operation view
libra op restore @{1}
# Preview a restore without changing repository state
libra op restore @{1} --dry-runNotes
op restorerecords a newop restoreoperation on success.op restore --dry-rundoes not write a new operation.- Restore resets HEAD and the branch refs captured in the target view, and prunes local branches that are absent from that view (the restored HEAD branch is always kept; remote-tracking refs are left untouched).