Skip to main content

DeviceCommand

Enum DeviceCommand 

Source
pub enum DeviceCommand {
    Pair {
        ai_agent: Option<String>,
        phone: bool,
        spaces: Vec<String>,
        give_secrets: bool,
        port: Port,
    },
    List,
    Revoke {
        device: String,
        yes: bool,
        codes: bool,
    },
    Mark {
        device: String,
        archive: bool,
        everyday: bool,
        away: bool,
        home: bool,
        keeps: Option<Keeps>,
        waits: Option<Waits>,
        new_spaces: Option<NewSpacesArg>,
    },
    Review,
    Accept {
        device: String,
        yes: bool,
    },
}
Expand description

What nib device can do.

Variants§

§

Pair

Adds another device of yours, or an AI agent’s copy of the library.

It shows a code to give to nib init –join on the device, which then gets a copy of the library. The code works for ten minutes, three wrong tries end it, and both devices must be on the same network. A computer gets every space of this device’s, and takes the spaces made later; a phone, with –phone, gets your personal space alone, and asks before it takes a space made later. The new device gets no secrets, but with –give-secrets.

Fields

§ai_agent: Option<String>

Adds a copy of the library for an AI agent instead, named after it, such as Claude, which nib mcp serves it: it gets no secrets, and may not purge, add or revoke devices, or change the library’s own records, such as types and storage policies. Run nib init –join where nib mcp will run.

§phone: bool

Adds a phone: it gets your personal space alone, or the spaces given with –in, and asks before it takes a space made later, with nib space take there.

§spaces: Vec<String>

A space besides your personal one that the new device gets, by its name or the start of its ID, instead of the default, every space for a computer and none for a phone; give it once for each. For an AI agent, a space that it may read and write too: a shared space must allow AI agents, which its admins say with nib space ai-agents; an admin’s device allows them here at once. Pair the AI agent anew to change its spaces.

§give_secrets: bool

Gives the new device the library’s secrets too, if it asks for them, as nib init –join –secrets does: asks for the passphrase of the secrets here before it shows the code.

§port: Port

The port to take the connection on.

§

List

Lists your devices: the copies of the library on them.

Each copy is kept by an app; those revoked are listed too, with how many of their changes wait for review.

§

Revoke

Revokes a device of yours, such as a lost phone.

It revokes every copy of the library on the device, or one copy by its ID: no device syncs with it any more, what it changed that this device does not have is set aside for review, and the library gets a new key that it does not get. Revoking is final. Without –yes, it says what it would revoke, and revokes nothing.

Fields

§device: String

The device, by its name or ID, one copy of the library by its ID, or an AI agent by its name, as nib device list shows them.

§yes: bool

Revokes for good, which cannot be undone.

§codes: bool

Revokes too the recovery codes made on it, which it names: whoever has the device may have read them as they were made. Without it, they stay.

§

Mark

Marks a device as an archive node or everyday, at home or away.

An archive node, such as a NAS or a desktop, keeps the files that policies assign it, or as an everyday device, as every device is until marked; and as kept away from home, such as a relative’s NAS, or at home. Copies on an archive node, and away from home, count where a policy asks for them. Your devices tell the others at their next syncs. Without a mark, it says how the device is marked.

Fields

§device: String

The device, by its name or ID, or one copy of the library on it by its ID.

§archive: bool

Marks it as an archive node.

§everyday: bool

Marks it as an everyday device.

§away: bool

Marks it as kept away from home.

§home: bool

Marks it as kept at home.

§keeps: Option<Keeps>

How many bytes of files it keeps as an everyday device, such as 20GB: the files pinned to it, then the newest and those opened lately, while some device is an archive node; default for a tenth of its disk, or nothing on a phone.

§waits: Option<Waits>

How many days it waits as an archive node, from 1 to 365, before it destroys what a purge destroys, during which nib purges there can stop the purge; none for not at all, default for 30. A shorter wait, or none, holds only once the wait before it has passed, so that no infected device can shorten it and purge at once.

§new_spaces: Option<NewSpacesArg>

Whether nib’s copy of the library on this device takes the spaces made later on your other devices, as a computer does, or asks first, as a phone does, with nib space take: said only on the device itself, so that no other device can say it for it, and by each app’s copy for itself.

§

Review

Lists the changes of revoked devices that were set aside.

They were set aside as no device that revoked them had them; so are those of devices nobody added.

§

Accept

Accepts every change of a device that was set aside.

They count after all, with their own times. Changes that say who may write to the library, such as one that revokes another device, are never accepted. Without –yes, it says how many it would accept.

Fields

§device: String

The device, by its name or ID, one copy of the library by its ID, or an AI agent by its name.

§yes: bool

Accepts them.

Trait Implementations§

Source§

impl Debug for DeviceCommand

Source§

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

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

impl FromArgMatches for DeviceCommand

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 DeviceCommand

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