diff --git a/radicle-cli/examples/rad-inspect-noauth.md b/radicle-cli/examples/rad-inspect-noauth.md new file mode 100644 index 00000000..1192d532 --- /dev/null +++ b/radicle-cli/examples/rad-inspect-noauth.md @@ -0,0 +1,13 @@ +The `rad inspect` command can be run without being authenticated with radicle: + +``` +$ rad self +✗ Self failed: Could not load radicle profile +✗ To setup your radicle profile, run `rad auth`. + +``` + +``` +$ rad inspect +rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji +``` diff --git a/radicle-cli/examples/rad-inspect.md b/radicle-cli/examples/rad-inspect.md new file mode 100644 index 00000000..a9c64760 --- /dev/null +++ b/radicle-cli/examples/rad-inspect.md @@ -0,0 +1,70 @@ +To display a repository's identifier, or *RID*, you may use the `rad inspect` +command from inside a working copy: + +``` +$ rad inspect +rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji +``` + +As a shorthand, you can also simply use `rad .`: + +``` +$ rad . +rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji +``` + +It's also possible to display all of the repository's git references: + +``` +$ rad inspect --refs +. +`-- z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi + `-- refs + |-- heads + | `-- master + `-- rad + |-- id + `-- sigrefs +``` + +Or display the repository identity's payload: + +``` +$ rad inspect --payload +{ + "xyz.radicle.project": { + "defaultBranch": "master", + "description": "Radicle Heartwood Protocol & Stack", + "name": "heartwood" + } +} +``` + +Finally, the `--history` flag allows you to examine the identity document's +history: + +``` +$ rad inspect --history +commit 175267b8910895ba87760313af254c2900743912 +blob d96f425412c9f8ad5d9a9a05c9831d0728e2338d +date Thu, 15 Dec 2022 17:28:04 +0000 + + Initialize Radicle + + Rad-Signature: z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi z5nGqUvrmfiSyLjNCHWTWYvVMcPUZcvo9TxPKzEKXYBdSgUzbrqf1cYsmpGgbQvYunnsrLSsubEmxZaRdKM4quqQR + + { + "delegates": [ + "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi" + ], + "payload": { + "xyz.radicle.project": { + "defaultBranch": "master", + "description": "Radicle Heartwood Protocol & Stack", + "name": "heartwood" + } + }, + "threshold": 1 + } + +``` diff --git a/radicle-cli/src/commands/inspect.rs b/radicle-cli/src/commands/inspect.rs index f2cd3e56..fb537d03 100644 --- a/radicle-cli/src/commands/inspect.rs +++ b/radicle-cli/src/commands/inspect.rs @@ -18,35 +18,41 @@ use crate::terminal::args::{Args, Error, Help}; pub const HELP: Help = Help { name: "inspect", - description: "Inspect an identity or project directory", + description: "Inspect a radicle repository", version: env!("CARGO_PKG_VERSION"), usage: r#" Usage rad inspect [