Skip to main content

SecretCommand

Enum SecretCommand 

Source
pub enum SecretCommand {
    Set {
        entity: String,
        field: String,
        generate: bool,
        recipe: RecipeArgs,
    },
    Copy {
        entity: String,
        field: String,
        clear_after: u64,
    },
    Generate {
        recipe: RecipeArgs,
    },
    Code {
        entity: String,
        field: Option<String>,
    },
    Show {
        entity: String,
        field: String,
    },
    History {
        entity: String,
        field: String,
    },
    Clear {
        entity: String,
        field: String,
    },
    Purge {
        entity: String,
        field: String,
        yes: bool,
    },
    Ask {
        from: String,
    },
    Give {
        device: String,
    },
    FromCopy,
    Save {
        file: String,
        path: Option<PathBuf>,
    },
}
Expand description

What nib secret can do, in the personal space. The entity is found by its ID, a prefix of its ID, or its name.

Variants§

§

Set

Sets a secret field of an entity, asking for the value.

It replaces the values the field has: asks for the value twice, without showing it, or with –generate, makes a new password. The library’s first secret sets up its secrets, with a passphrase of their own. The secret of one-time codes, std.one-time-code, is taken as a site shows it: as base32 text, or as the otpauth:// link of its QR code.

Fields

§entity: String

The entity.

§field: String

The secret field.

§generate: bool

Sets a new random password, as the options below say, without showing it.

§recipe: RecipeArgs

What a generated password is made of.

§

Copy

Copies a secret value to the clipboard, and clears it after a while.

The value of a secret field of an entity is marked so that clipboard histories leave it out, and clears it after a while, unless something else was copied since. nib waits until then; Ctrl+C clears it at once. Of values that compete, it copies the first.

Fields

§entity: String

The entity.

§field: String

The secret field.

§clear_after: u64

How many seconds the clipboard holds the secret.

§

Generate

Prints a new random password, which nothing keeps.

For nib secret set, there is –generate.

Fields

§recipe: RecipeArgs

What the password is made of.

§

Code

Shows the one-time code of an entity now.

It says how many seconds the code lasts, made from the secret in a field: std.one-time-code, unless another is given.

Fields

§entity: String

The entity.

§field: Option<String>

The secret field that holds the secret of one-time codes.

§

Show

Shows the values of a secret field of an entity.

Fields

§entity: String

The entity.

§field: String

The secret field.

§

History

Shows every value a secret field of an entity has had.

It shows them as nib history does.

Fields

§entity: String

The entity.

§field: String

The secret field.

§

Clear

Clears a secret field of an entity, keeping its history.

It shows no value from now on, and its history keeps those it had.

Fields

§entity: String

The entity.

§field: String

The secret field.

§

Purge

Purges one value of a secret field for good, everywhere.

The value of the entity’s field, current or past, is asked for without showing it. Without –yes, it says what it would purge, and purges nothing.

Fields

§entity: String

The entity.

§field: String

The secret field.

§yes: bool

Purges for good, which cannot be undone.

§

Ask

Asks another of your devices for the library’s secrets.

The device that holds them is named by its name, or one copy of the library on it, by its ID, as nib device list shows them: sets up the secrets here, with a passphrase of their own, asked for twice, and never the library’s. That device gives them, with nib secret give; they arrive with the next sync, and this device takes them when its secrets are next unlocked. It takes them from that device alone. A device that asked already asks another this way, without a passphrase. nib protect –secrets moves them to the keystore. With –space naming a shared space, asks another member’s device there for that space’s secrets, by its name, or its ID as nib space show –json shows it; this device’s secrets must be set up, and your other devices take the space’s from it by themselves.

Fields

§from: String

The device that holds the secrets, or the ID of a copy of the library on it.

§

Give

Gives the library’s secrets to a device of yours that asked.

The device is named by its name, or one copy of the library on it, by its ID, as nib device list shows them. Asks for the passphrase of the secrets here; they reach it with the next sync. An AI agent never gets them. With –space naming a shared space, gives that space’s secrets to another member’s device there that asked this one, by its name or ID; your own devices get them by themselves.

Fields

§device: String

The device, or the ID of a copy of the library on it.

§

FromCopy

Takes the secrets from a copy of the library beside this one.

The copy is beside this device’s, which a backup, a program that syncs folders or a person brought from another device: only the keys that the copy’s device was given. Asks for the passphrase of the copy’s secrets, unless this computer’s keystore holds their key, and for a passphrase of the secrets here, twice. Take them before revoking the copy’s device, if it alone held them.

§

Save

Saves a plain copy of a secret file, which nothing records.

NibKeep neither protects it, nor keeps track of it, nor deletes it if the file is purged. Into a folder, under the file’s name, or as a new file; without either, into the current folder. It replaces nothing.

Fields

§file: String

The secret file.

§path: Option<PathBuf>

The folder, or the path of the copy.

Trait Implementations§

Source§

impl Debug for SecretCommand

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl FromArgMatches for SecretCommand

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl Subcommand for SecretCommand

Source§

fn augment_subcommands<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self via FromArgMatches::from_arg_matches_mut Read more
Source§

fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate self via FromArgMatches::update_from_arg_matches_mut Read more
Source§

fn has_subcommand(__clap_name: &str) -> bool

Test whether Self can parse a specific subcommand

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more