Skip to content

FoldCLI Commands Work in Progress

Hi, were going to be covering the CLI commands that come with the current version of foldcli beta

Please note this page is a work in progress

Table of Contents


To setup Folderr CLI there is multiple commands all under one init command

init is a dummy command, it does nothing

foldcli init folderr

Initalize your Folderr CLI config interactively or non-interactively.
If a repository is provided non-interactively, the authorization flag MUST be supplied if it is private or else it will fail.
Interactivity happens when you do not provide the listed arguments (excluding flags)

  foldcli init folderr [directory] [repository] [flags]

  Directory: Where to store Folderr if you install it
  Repository: Where to acquire Folderr from. i.e

  -a, --authorization string   Authorization token for private repositories
      --dry                    Whether or not to run the command in dry-run mode
  -h, --help                   help for foldcli init folderr
      --mkdir                  Make directories if they don't exist
  -o, --override               Override previous settings
foldcli init db

Initalize config for database related commands

  foldcli init db <database uri> <database name> [flags]

  db, database

  foldcli init db mongodb://localhost/folderrV2?tls=true folderr
  foldcli init db mongodb://username:password@ folderr

  -h, --help       help for foldcli init db
  -o, --override   Override previous settings

Global Flags:
      --dry   Runs the command but does not change anything

Setup Applications and Services

This set of commands is under one command but is split into multiple subcommands.

First we have setup db which sets up Folderrs database and encryption keys

foldcli setup db

Set up Folderr's database structures and security (encryption) keys
Saves private & public keys to the path, and tries to install the private key to Folderr
save_path is where the keys get saved. Default: $HOME/.folderr/cli/

Does not have dry-run mode. Cannot accurately test with a dry run mode.
Test with "test" env variable. Do not use production database name/url when testing.
REQUIRES Folderr to be installed

  foldcli setup db (save_path) [flags]

  -h, --help         help for foldcli setup db
      --no-cleanup   Does not cleanup if running in test mode. Only useful for data peekers and developers.
  -v, --verbose      Shows information aside from key output.

Global Flags:
      --dry   Runs the command but does not change anything

Next we have the setup owner command which sets up the owner account on the Folderr instance. Won't work if there is already an owner

foldcli setup owner

Set's up the owner account on your Folderr instance
Please run "foldcli init db" before running this command

  foldcli setup owner [db_name] [flags]

  -e, --email string      Set's the email of the owner account
  -h, --help              help for foldcli setup owner
  -p, --password string   Set's the password of the owner account
  -u, --username string   Set's the username of the owner account

Global Flags:
      --dry   Runs the command but does not change anything

Next we have the install command which installs Folderr. May be used later for more things.

foldcli install folderr
Checks for Folderrs dependencies and installs Folderr

  foldcli install [flags]

  -a, --authorization    Authorization token for private repositories. Init will fail if the repository is private and this is not used.
  -h, --help   help for install

Global Flags:
      --dry   Runs the command but does not change anything

Encryption Key Management

The keygen command is useful for generating public/private keypairs for Folderr

It also allows us to test foldclis keys againt Folderr, which is made especially easy with this repository

foldcli keygen

Generate a private/public keypair according to Folderrs standards

  foldcli keygen <path_for_private_key> <path_for_public_key> [flags]

foldcli keygen /home/fldrr/keys/private.pem /home/fldrr/keys/public.pem

  -f, --force   Override the current keys, if they eixst
  -h, --help    help for keygen

Global Flags:
      --dry   Runs the command but does not change anything


The only command we have here for now is the version command. Which prints the version May have more versions than just foldcli's later.

foldcli version
Shows the version of the CLI

Usage: foldcli version

Current version as of writing: Alpha 0.0.6

Docs licensed under CC BY-NC-SA 4.0
Folderr licensed under AGPL-3.0