cli: Hint to install ssh-agent

This commit is contained in:
cloudhead 2024-01-31 14:07:28 +01:00
parent 4e9e438f41
commit 1ece339eac
No known key found for this signature in database
2 changed files with 11 additions and 1 deletions

View File

@ -10,6 +10,8 @@ Initializing your radicle 👾 identity
✓ Your Radicle DID is did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi. This identifies your device. Run `rad self` to show it at all times.
✓ You're all set.
✗ Hint: install ssh-agent to have it fill in your passphrase for you when signing.
To create a Radicle repository, run `rad init` from a Git repository with at least one commit.
To clone a repository, run `rad clone <rid>`. For example, `rad clone rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5` clones the Radicle 'heartwood' repository.
To get a list of all commands, run `rad help`.

View File

@ -113,6 +113,7 @@ pub fn init(options: Options) -> anyhow::Result<()> {
let passphrase = passphrase.trim().is_empty().not().then_some(passphrase);
let spinner = term::spinner("Creating your Ed25519 keypair...");
let profile = Profile::init(home, alias, passphrase.clone())?;
let mut agent = true;
spinner.finish();
if let Some(passphrase) = passphrase {
@ -126,7 +127,9 @@ pub fn init(options: Options) -> anyhow::Result<()> {
spinner.warn();
}
}
Err(e) if e.is_not_running() => {}
Err(e) if e.is_not_running() => {
agent = false;
}
Err(e) => Err(e)?,
}
}
@ -138,6 +141,11 @@ pub fn init(options: Options) -> anyhow::Result<()> {
);
term::success!("You're all set.");
term::blank();
if profile.config.cli.hints && !agent {
term::hint("install ssh-agent to have it fill in your passphrase for you when signing.");
term::blank();
}
term::info!(
"To create a Radicle repository, run {} from a Git repository with at least one commit.",
term::format::command("rad init")