pub enum Command {
Show 30 variants
Init {
folder: Option<PathBuf>,
message: Option<String>,
yes: bool,
name: Option<String>,
device: Option<String>,
passphrase: bool,
languages: Option<Languages>,
join: Option<PairingCode>,
secrets: bool,
allow_fat: bool,
},
Languages {
ranges: Option<String>,
device: bool,
app: bool,
clear: bool,
},
Status {
library_wide: bool,
secrets: bool,
},
Verify {
export: Option<PathBuf>,
drive_checked: bool,
},
New {
kind: String,
values: Vec<String>,
language: Option<Tag>,
},
Show {
entity: String,
on: Option<Day>,
as_of: Option<Moment>,
},
Move {
entity: String,
to: String,
without_history: bool,
keep_behind: bool,
leave_secrets: bool,
yes: bool,
},
Merge {
entity: String,
other: Option<String>,
undo: bool,
},
Export {
folder: PathBuf,
current: bool,
},
Import {
paths: Vec<PathBuf>,
from: Option<String>,
},
History {
entity: String,
field: Option<String>,
},
Edit(EditArgs),
Purge {
entity: Option<String>,
value: Option<String>,
behind: bool,
yes: bool,
},
Find {
words: Vec<String>,
all: bool,
},
List {
kind: Option<String>,
conditions: Vec<String>,
sort: Option<String>,
on: Option<Day>,
},
Type {
command: TypeCommand,
},
File {
command: FileCommand,
},
Trees(TreeCommand),
Protect {
passphrase: bool,
secrets: bool,
},
Secret {
command: SecretCommand,
},
Policy {
command: PolicyCommand,
},
Space {
command: SpaceCommand,
},
Device {
command: DeviceCommand,
},
Backup {
command: BackupCommand,
},
Recovery {
command: RecoveryCommand,
},
Purges {
command: Option<PurgesCommand>,
},
Sync {
serve: bool,
wait: u64,
at_login: Option<Switch>,
port: u16,
},
Pull {
wait: u64,
partial: bool,
clone: bool,
no_clone: bool,
},
Mcp {
action: McpAction,
},
Absent(Absent),
}Expand description
What nib can do.
Variants§
Init
Makes a library, once on each computer, or a folder in one a tree.
Where no library is found, in the folders it is in, or named by –library or
NIBKEEP_LIBRARY, makes the current folder, or the one –library names, a library: you
as its user, named after your account on this computer, as whoami prints it, or as
–name says, linked to a person with your full name, if the system knows it, this
device, and a personal space. The library keeps them in the folder .nib; the rest of
the folder is yours, for your files. With –join, makes it a copy of a library you have
on another device instead: there, nib device pair shows the code to give. A library is
brought back with nib recovery restore.
In a library’s folder, or with the library that –library or NIBKEEP_LIBRARY names,
makes the current folder, or the one given, a tree, as git init does: NibKeep keeps
every version of its files, by their paths, and nib commit records them. The folder
given may be anywhere: its own library, if it is in one, or else the current folder’s,
keeps it. A tree’s folder outside the library’s gets a file .nib that names the
library, by which nib finds it there; for a tree that lost the file, init writes it
again. Its files
become the tree’s copies, committed as its first revision: a purge of a file’s content
deletes its copy where it was not edited, so it asks first. What .nibignore files
name is left out, in Git’s syntax for .gitignore, and always .nib, every .git,
and the inside of folders that hold Git repositories. A tree is never inside another,
nor started in a folder that holds a Git repository. Files such as .env and private
keys, and what .nibsecret files name, go in as secret files, sealed for the secrets,
whose passphrase it asks for, or sets up.
Fields
name: Option<String>Your own name, such as Ada Lovelace, not the library’s, which is its folder’s: you
become the library’s user, linked to a person of that name. Without it, your
account’s name, as whoami prints it, and your full name for the person, if the
system knows it. Giving it makes a library.
passphrase: boolProtects the library’s keys with a passphrase instead of the platform’s keystore. Giving it makes a library.
languages: Option<Languages>The languages you read, ranked, such as en, *-Latn, ru: English first, then
anything in the Latin script, then Russian. Without it, the system’s. Giving it
makes a library.
join: Option<PairingCode>Joins the library of another device of yours, which shows this code: nib device pair shows it there. Both devices must be on the same network.
secrets: boolWith –join, asks the device that shows the code for the library’s secrets too, with a passphrase of their own here, asked for twice before the code is used. It gives them if its secrets are unlocked, as nib device pair –give-secrets does; otherwise nib secret give does there later.
allow_fat: boolKeeps the library on this drive although its file system keeps no journal, as FAT32 and exFAT, which most USB sticks have. There, a drive removed without ejecting it, or that loses its power, while the library is open, must be checked for errors before the library is used again: nib says so then. Giving it makes a library.
Languages
Shows or sets the languages that values are shown in.
The languages are ranked, such as en, *-Latn, ru. This app’s list comes before this
device’s, and this device’s before yours.
Fields
Status
Shows what changed in the tree here, or what the library holds.
In a tree’s folder, shows what changed in the tree’s copy here since it was written or committed: new, edited, moved and deleted files, and executable bits, and the Git repositories found, with the work they hold that their remotes lack; and what changed in the tree elsewhere. Only the files whose size or modification time changed are read. Elsewhere, or with –library-wide, shows what the library holds.
Fields
Verify
Checks every change, log file and readable file of the library.
Every blob this device can read is read in full. Fails if anything is wrong.
Fields
New
Adds an entity of a type, with its values.
Its values are given as field=value, such as nib new book name="Leviathan Wakes" published=2011.
Fields
Show
Shows an entity, found by its ID, a prefix of its ID, or its name.
Fields
Move
Moves an entity to another space, such as one you share.
A new entity there gets its values, with their history as you carry it, its types and its files, and links to it lead there. A folder or a list moves with all it holds, through every level, which nib lists first. The old space keeps the history it had, for those who can read it.
Fields
keep_behind: boolKeeps what it leaves in the old space. Otherwise that is purged once another device, yours or another member’s, holds what moved: what your role there lets you purge, and the rest once an admin of that space purges it.
Merge
Merges an entity into another that it turns out to be the same as.
The other shows what both say from then on, and references to either lead to it. With –undo, sets apart again an entity merged into ENTITY: the only one, or the one given.
Fields
Export
Exports the library into a folder, as JSON, files and their sums.
The folder, empty or new, gets the library’s entities as JSON, the files they refer to as they were added, and the SHA-256 sums of them all, which read without NibKeep. The folder is not encrypted, and secret values are left out.
Fields
Import
Imports an export of a library, or Google Takeout’s photos.
A folder that nib export made brings what it holds and the library lacks, with the same IDs, so that importing it again adds nothing. Its records of users, devices, replicas and spaces are left out, and an export whose sums do not match is refused.
Anything else is taken for Google Takeout’s archive of Google Photos: its parts, zip or tgz files, all at once, or the folder one was unpacked into, read where they are. Each photo and video comes with what its JSON file says, when and where it was taken and its description, in place of what it says of itself, as that is where corrections made in Google Photos are; its name as uploaded; and in a folder for each album it is in, inside a folder named after the source. A photo the library holds already, as from a phone, is stored once, found in one more place. Other products of the archive, as Drive, are left out. Imported again, what an import added is not read again, so one cut short goes on where it stopped.
Fields
History
Shows every value an entity has had, or one field’s.
Each value comes with when it was recorded, by whom, and when it was replaced.
Edit(EditArgs)
Changes an entity’s values or types.
field=value sets a field, correcting the value it shows;
field+=value adds a value, which with --date records a change, such as a new
employer, that ends the value before it in a field with one value; field-=value
removes a value; and field= clears the field. type+=TYPE gives the entity
another type, and type-=TYPE takes one away; its values stay. Where a type of the
entity has a field named type, org.nibkeep.type+= and -= change the types.
Purge
Purges values for good, everywhere, with their history.
field=value purges that value of an entity, current or past, and field= every
value the field has held. What else the changes that held them held stays, and what
they replaced stays replaced. Without –yes, it says what it would purge, and purges
nothing. With –behind and no entity, lists what moves left behind and asked you to
purge, as an admin of its space.
Fields
Find
Finds the entities whose values hold every word.
The last word also matches the start of a longer one. Then, through links, what they lead to: the books of an author they are, a pen name they use, and the books credited to it. Lists the first 50 of each space and says how many more there are.
List
Lists the entities, or those of a type.
They are listed by name or in the order of a field, such as nib list book --where in-series="The Expanse" --sort number-in-series. A field is
one of the type’s, or else of the other types that its entities have, as an audiobook
can be an edition too; which one a short name finds can change with the entities, so
scripts give full names, such as std.published.
Fields
conditions: Vec<String>Lists only the entities whose field shows this value today. A reference is given by the ID, the start of the ID or the name of what it refers to. Give it several times for entities that meet every condition.
Type
Works with types: the fields that entities of a type may have.
Fields
command: TypeCommandWhat to do with types.
File
Works with files, each stored once with every place it was found.
A file’s content is stored once, however often it is added.
Fields
command: FileCommandWhat to do with files.
Trees(TreeCommand)
The commands of trees, named as other version control systems name theirs.
Protect
Protects the library’s keys, or its secrets, anew.
The keys go to the platform’s keystore, or with –passphrase, under a new passphrase; with –secrets, the library’s secrets do instead, after their passphrase. The library’s passphrase and its secrets’ are never the same.
Fields
Secret
Works with secret values, such as passwords, and secret files.
No other command shows or takes secret values. Each asks for the passphrase of the library’s secrets, which is not the library’s, and forgets the secrets when it ends; nib secret generate needs no library.
Fields
command: SecretCommandWhat to do with secret values.
Policy
Works with storage policies: how many copies files need, and where.
A policy says how many copies the files of the personal space need, and whether this device keeps them in NibKeep’s store or where they are. Rules choose a file’s policy in order, unless the file has a policy of its own. The first command gives the space the default policies, Critical, Standard and Replaceable.
Fields
command: PolicyCommandWhat to do with policies.
Space
Works with spaces, the parts of the library shared as a whole.
Each space holds its own entities, and is shared, or not, as a whole. Your personal space is never shared.
Fields
command: SpaceCommandWhat to do with spaces.
Device
Works with your devices, which sync over the home network.
Each device holds copies of the library, which sync with each other.
Fields
command: DeviceCommandWhat to do with devices.
Backup
Works with your backups on drives and network shares.
A backup is a folder on a USB drive, a drive kept away from home, or a network share, which your computers keep up to date whenever they find it, such as when the drive is plugged in. It holds the library’s data encrypted, and no keys: whoever finds it reads nothing, and you restore from it on a device of yours.
Fields
command: BackupCommandWhat to do with backups.
Recovery
Works with recovery codes, and brings a library back.
A recovery code is on paper, and brings the library back when every device is lost, from a backup, or when this computer’s library no longer unlocks. It holds keys and no data. Whoever has the code and a backup reads everything, so keep it as safely as a passport.
Fields
command: RecoveryCommandWhat to do with recovery codes.
Purges
Lists the purges that wait here, and stops one or ends its wait.
A purge waits on this device, and on your backups plugged in here, before what it destroyed goes for good. An archive node keeps it apart, unreadable to everyone, for a while after it learns of a purge, 30 days unless marked otherwise (nib device mark –waits), so that no mistake or infected device wipes data everywhere at once. Meanwhile, a purge can be stopped here, which brings back everywhere what it destroyed, or its wait ended sooner.
Fields
command: Option<PurgesCommand>What to do with a purge that waits.
Sync
Syncs the library with your other devices on the home network.
Each gets what the other has, files too. Where a program syncs this device for all, as nib sync –serve or an app that has the library open does, it asks that one to sync now, and says what happened. As nib push, it sends your commits, as Git’s push does.
Fields
serve: boolSyncs this device for every program here, until stopped: answers your other devices, and syncs with them as changes come and they appear on the network. Where another program does that already, it waits, and takes over when that one ends.
wait: u64How long to look for your other devices on the network, in seconds; where a program syncs this device, how much longer than two minutes to wait for it.
Pull
Syncs with your other devices, then updates the copy of the tree.
It syncs as nib sync does, then brings the copy of the tree here to the tree as they left it, as nib update does: what Git’s pull does. The copy is brought up to date even if the sync fails, which it says after.
Fields
Mcp
Serves nib to AI clients, and lets them work on your library.
An AI client runs nib mcp serve, on your library where nib mcp enable allowed AI agents, or on an AI agent’s copy of the library, which nib device pair –ai-agent adds.
Absent(Absent)
The commands of other version control systems that nib does not have.
Trait Implementations§
Source§impl FromArgMatches for Command
impl FromArgMatches for Command
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut<'b>(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§impl Subcommand for Command
impl Subcommand for Command
Source§fn augment_subcommands<'b>(__clap_app: Command) -> Command
fn augment_subcommands<'b>(__clap_app: Command) -> Command
Source§fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§fn has_subcommand(__clap_name: &str) -> bool
fn has_subcommand(__clap_name: &str) -> bool
Self can parse a specific subcommandAuto Trait Implementations§
impl Forget for Command
impl Freeze for Command
impl Move for Command
impl RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl UnsafeUnpin for Command
impl UnwindSafe for Command
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
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)
fn as_any(&self) -> &(dyn Any + 'static)
&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)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.