CLI Management
Nexo Share includes a powerful Command Line Interface (CLI) that allows administrators to manage users, configuration, and system tasks directly from the console. Since Nexo Share runs in a Docker container, you must execute these commands inside the running container.
Accessing the CLI
To run a CLI command, you use docker exec to execute the command inside the backend container.
The basic syntax is:
docker exec -it <container_name> bun src/index.ts <command> [arguments]
[!NOTE] Replace
<container_name>with the actual name of your backend container (e.g.,nexoshare-backendornexoshare_backend_1). You can find the name by runningdocker ps.
Viewing the Help Menu
To see a list of all available commands, run:
docker exec -it nexoshare-backend bun src/index.ts help
Available Commands
User Management
Manage user accounts, passwords, and administrative privileges.
| Command | Usage | Description |
|---|---|---|
list-users |
list-users |
Show a table of all registered users. |
create-user |
create-user <email> <name> <pass> <is_admin> |
Create a new user manually. Set is_admin to true or false. |
set-admin |
set-admin <email> <true/false> |
Promote or demote a user to/from admin status. |
reset-password |
reset-password <email> <newpass> |
Force reset a user’s password. |
delete-user |
delete-user <email> |
Delete a user and all their data permanently. |
2fa-disable |
2fa-disable <email> |
Emergency disable 2FA for a user (e.g. if lost device). |
Examples:
# Create a new admin user
docker exec -it nexoshare-backend bun src/index.ts create-user [email protected] "Admin User" "SuperSecret123" true
# Reset a user's password
docker exec -it nexoshare-backend bun src/index.ts reset-password [email protected] "NewPassword!23"
Configuration
View and modify system settings without using the file system or database directly.
| Command | Usage | Description |
|---|---|---|
config-list |
config-list |
Show all current configuration settings. |
config-get |
config-get <key> |
Show the value of a specific setting. |
config-set |
config-set <key> <value> |
Set a configuration value. Auto-detects numbers and booleans. |
config-unset |
config-unset <key> |
Remove a custom setting and revert to default. |
config-smtp |
config-smtp <host> <port> <user> <pass> <from> <secure> |
Quickly configure all SMTP settings in one go. |
config-sso |
config-sso <issuer> <client_id> <secret> |
Configure and enable OpenID Connect (SSO). |
security-toggle |
security-toggle <feature> <true/false> |
Toggle security features: 2fa, passkeys, or reset. |
setup-reset |
setup-reset |
Reset the “setup match” flag to force the setup wizard to appear again. |
Examples:
# Enable 2FA requirement for all users
docker exec -it nexoshare-backend bun src/index.ts security-toggle 2fa true
# Change the app name
docker exec -it nexoshare-backend bun src/index.ts config-set appName "My Secure Share"
System Tasks
Perform maintenance and system checks.
| Command | Usage | Description |
|---|---|---|
cleanup |
cleanup |
Manually run the garbage collector to remove expired shares and orphaned files. |
system-info |
system-info |
Display server environment information and status. |
# Run manual cleanup
docker exec -it nexoshare-backend bun src/index.ts cleanup