CLI Tool
Command-line interface for managing Mist users and system settings.
The Mist CLI (mist-cli) is a powerful command-line tool that allows administrators to manage their Mist installation directly from the terminal. It's automatically installed when you install Mist using the standard installation script.
Installation
The CLI tool is automatically installed during Mist installation and is available at /usr/local/bin/mist-cli.
To verify installation:
mist-cli versionAvailable Commands
Available Commands
The CLI supports the following main commands:
user- Manage userssettings- Manage system settingsversion- Show CLI versionhelp- Show help message
Use mist-cli <command> --help for more information about each command.
User Management
Manage user accounts including password changes and listing users.
Change User Password
Change a user's password with optional interactive or non-interactive mode.
Interactive mode (recommended):
mist-cli user change-password --username adminThis will prompt you to enter and confirm the new password securely.
Non-interactive mode:
mist-cli user change-password --username admin --password newpass123Examples:
# Change admin password (interactive)
mist-cli user change-password --username admin
# Change user password directly
mist-cli user change-password --username john --password SecurePass123List Users
Display all users in the system with their details.
mist-cli user listOutput:
Users:
----------------------------------------------
ID Username Email Role
----------------------------------------------
1 admin admin@example.com owner
2 developer dev@example.com member
----------------------------------------------
Total: 2 usersSystem Settings Management
Manage system-wide settings that control Mist behavior.
List All Settings
View all current system settings:
mist-cli settings listOutput:
System Settings:
----------------------------------------------
Setting Value
----------------------------------------------
wildcard_domain example.com
mist_app_name mist
production_mode true
secure_cookies true
auto_cleanup_containers false
auto_cleanup_images false
----------------------------------------------Get Specific Setting
Retrieve the value of a specific setting:
mist-cli settings get --key wildcard_domainAvailable setting keys:
wildcard_domain- Wildcard domain for auto-generated app domainsmist_app_name- Subdomain name for Mist dashboardproduction_mode- Enable production mode (true/false)secure_cookies- Enable secure cookies for HTTPS (true/false)auto_cleanup_containers- Auto cleanup stopped containers (true/false)auto_cleanup_images- Auto cleanup dangling images (true/false)
Set Setting Value
Update a system setting:
mist-cli settings set --key <key> --value <value>Examples:
# Set wildcard domain
mist-cli settings set --key wildcard_domain --value apps.example.com
# Enable production mode
mist-cli settings set --key production_mode --value true
# Enable secure cookies
mist-cli settings set --key secure_cookies --value true
# Enable auto cleanup
mist-cli settings set --key auto_cleanup_containers --value true
mist-cli settings set --key auto_cleanup_images --value true
# Change Mist dashboard subdomain
mist-cli settings set --key mist_app_name --value dashboardCommon Use Cases
Initial Setup
After installing Mist, set up your wildcard domain:
# Configure wildcard domain
mist-cli settings set --key wildcard_domain --value apps.example.com
# Set Mist dashboard subdomain
mist-cli settings set --key mist_app_name --value mist
# Enable production mode
mist-cli settings set --key production_mode --value truePassword Recovery
If you've forgotten the admin password:
# Reset admin password
sudo mist-cli user change-password --username adminEnable Auto Cleanup
To automatically clean up Docker resources:
# Enable container cleanup
mist-cli settings set --key auto_cleanup_containers --value true
# Enable image cleanup
mist-cli settings set --key auto_cleanup_images --value trueCheck Current Configuration
View all settings and users:
# List all settings
mist-cli settings list
# List all users
mist-cli user listPermissions
The CLI requires direct access to the Mist database at /var/lib/mist/mist.db. You may need to run commands with sudo:
sudo mist-cli user change-password --username adminTroubleshooting
Database Not Found
Error:
Error: database file not found at /var/lib/mist/mist.db. Please ensure Mist is installed and runningSolution: Ensure Mist is properly installed and the service is running:
sudo systemctl status mistPermission Denied
Error: Permission issues when accessing the database
Solution: Run the command with sudo:
sudo mist-cli settings listUnknown Setting Key
Error:
Error: Unknown setting key 'invalid_key'Solution: Use mist-cli settings --help to see available setting keys.
Help & Support
For more information on any command, use the --help flag:
mist-cli --help
mist-cli user --help
mist-cli settings --help