The nf command
01 The Basics
Common Parameters
All Commands
These parameters work with all commands.
--json
Outputs the result in JSON.
Item Lists
For commands which return lists of items (users, computers, etc), you can use the following parameters:
-p <int>
Retrieve the specified page number of results. The page number defaults to 1.
-s <int>
Set the page size. The number of pages will therefore be number of items / page size. The default page size is 15.
--search <terms>
Filter the list of items returned. The exact filtering methodology can vary by command, but typically all properties are searched.
--format <format string>
Format the output in a specific way. This exists to make it easier to pipe the output to another command. Using this will output only the resulting items, and none of the additional information you might otherwise see. The way to use this is:
--format "%{i} %{username} %{otherProperty}"
You can use %{i} to access the current row number. This will reset to 1 for each page.
Otherwise, you can use any of the properties defined on the objects being returned. In this case, username and otherProperty. Property names are not case sensitive.
02 Authentication
Logging in as the first user on a new installation
To log in under these circumstances, all you have to do is run nf auth. It will create a key file which the server will automatically accept as there are no configured users.
Logging in as a previously created user
Simply run nf with whatever parameters you need to achieve your goals. You will be logged in automatically.
If you are using a different user name than you were when you set up your account, you can use nf set --user <username> then use nf as normal.
Logging in as a new user on an existing system
This depends on how your account was set up.
03 User Management
Create a user
nf user add <username>
Creates a user with a randomised initial login token. The token will be provided in the command output, and you can pass this on to the user for use on their first login.
nf user add <username> --initial-token <token>
Creates a user with a manually set initial login token.
nf user add <username> --no-token
Creates a user with no initial login token. This means that the server will accept the first login to the user account with minimal checks. Use this option with caution.
List Users
nf user list [-p <page>] [-s <pageSize>] [--search <search terms>]
nf user ls [-p <page>] [-s <pageSize>] [--search <search terms>]
Lists the configured users along with their creation and last login times.
You can use the standard page, page size and search parameters.
Set a Password
This functionality is not guarateed to exist prior to version 1.0, and is subject to change.
nf user password <user> <password>
nf user password <user> --random
nf user pw <user> <password>
nf user pw <user> --random
Command line users do not need passwords, instead relying on keyfiles. You can, however, set a password for a user, which will allow them to log in to the web interface.
This has no bearing on command line users.
Delete a user
nf user delete <username>
Deletes the specified user.