0
# CLI Interface
1
2
Parse Dashboard provides a comprehensive command-line interface for running the dashboard as a standalone application with extensive configuration options.
3
4
## Capabilities
5
6
### Main CLI Command
7
8
The primary command for running Parse Dashboard from the command line.
9
10
```bash { .api }
11
parse-dashboard [options]
12
13
# Main options:
14
--appId [appId] # Parse App ID
15
--masterKey [masterKey] # Parse Master Key
16
--masterKeyTtl [masterKeyTtl] # Master Key TTL in seconds
17
--serverURL [serverURL] # Parse Server URL
18
--graphQLServerURL [graphQLServerURL] # GraphQL Server URL
19
--dev # Enable development mode
20
--appName [appName] # Application display name
21
--config [config] # Path to configuration file
22
--host [host] # Host to bind (default: 0.0.0.0)
23
--port [port] # Port to listen (default: 4040)
24
--mountPath [mountPath] # Mount path for dashboard
25
--allowInsecureHTTP [allowInsecureHTTP] # Allow HTTP connections
26
--sslKey [sslKey] # Path to SSL private key
27
--sslCert [sslCert] # Path to SSL certificate
28
--trustProxy [trustProxy] # Trust proxy headers
29
--cookieSessionSecret [secret] # Session cookie secret
30
--cookieSessionMaxAge [maxAge] # Session timeout in seconds
31
--createUser # Interactive user creation tool
32
--createMFA # Interactive MFA setup tool
33
```
34
35
### Environment Variables
36
37
All CLI options can be configured via environment variables:
38
39
```bash { .api }
40
# Core Parse Server connection
41
PARSE_DASHBOARD_APP_ID # --appId
42
PARSE_DASHBOARD_MASTER_KEY # --masterKey
43
PARSE_DASHBOARD_SERVER_URL # --serverURL
44
PARSE_DASHBOARD_GRAPHQL_SERVER_URL # --graphQLServerURL
45
PARSE_DASHBOARD_APP_NAME # --appName
46
47
# Server configuration
48
HOST # --host
49
PORT # --port
50
MOUNT_PATH # --mountPath
51
52
# Security and SSL
53
PARSE_DASHBOARD_ALLOW_INSECURE_HTTP # --allowInsecureHTTP
54
PARSE_DASHBOARD_TRUST_PROXY # --trustProxy
55
PARSE_DASHBOARD_SSL_KEY # --sslKey
56
PARSE_DASHBOARD_SSL_CERT # --sslCert
57
58
# Session management
59
PARSE_DASHBOARD_COOKIE_SESSION_SECRET # --cookieSessionSecret
60
PARSE_DASHBOARD_COOKIE_SESSION_MAX_AGE # --cookieSessionMaxAge
61
62
# Configuration
63
PARSE_DASHBOARD_CONFIG # JSON configuration string
64
PARSE_DASHBOARD_AGENT # JSON agent configuration
65
66
# Additional user authentication
67
PARSE_DASHBOARD_USER_ID # Single user ID for basic auth
68
PARSE_DASHBOARD_USER_PASSWORD # Single user password for basic auth
69
```
70
71
### CLI Helper Functions
72
73
Interactive utilities for user and MFA management:
74
75
```javascript { .api }
76
// Available through CLIHelper module
77
interface CLIHelper {
78
/**
79
* Interactive user creation utility
80
* Prompts for username, password, and access settings
81
* Generates bcrypt hash for secure password storage
82
* Optionally sets up MFA with QR code generation
83
*/
84
createUser(): Promise<void>;
85
86
/**
87
* Interactive MFA setup utility
88
* Generates TOTP secret and displays QR code for authenticator apps
89
* Supports multiple algorithms (SHA1, SHA256, SHA512, etc.)
90
* Configurable digits and time period
91
*/
92
createMFA(): Promise<void>;
93
}
94
```
95
96
**Usage Examples:**
97
98
```bash
99
# Basic single app setup
100
parse-dashboard --appId myAppId --masterKey myMasterKey --serverURL http://localhost:1337/parse --appName "My App"
101
102
# Development mode (no authentication, HTTP allowed)
103
parse-dashboard --dev --appId myAppId --masterKey myMasterKey --serverURL http://localhost:1337/parse
104
105
# Using configuration file
106
parse-dashboard --config ./dashboard-config.json
107
108
# Custom host and port
109
parse-dashboard --host 127.0.0.1 --port 8080 --config ./config.json
110
111
# SSL enabled
112
parse-dashboard --sslKey ./private-key.pem --sslCert ./certificate.pem --config ./config.json
113
114
# Create user interactively
115
parse-dashboard --createUser
116
117
# Create MFA secret interactively
118
parse-dashboard --createMFA
119
120
# Environment variable configuration
121
export PARSE_DASHBOARD_APP_ID=myAppId
122
export PARSE_DASHBOARD_MASTER_KEY=myMasterKey
123
export PARSE_DASHBOARD_SERVER_URL=http://localhost:1337/parse
124
export PORT=8080
125
parse-dashboard
126
```
127
128
## Types
129
130
### CLI Options Interface
131
132
```javascript { .api }
133
interface CLIOptions {
134
appId?: string;
135
masterKey?: string;
136
masterKeyTtl?: string;
137
serverURL?: string;
138
graphQLServerURL?: string;
139
dev?: boolean;
140
appName?: string;
141
config?: string;
142
host?: string;
143
port?: string;
144
mountPath?: string;
145
allowInsecureHTTP?: string; // String in CLI, parsed to boolean
146
sslKey?: string;
147
sslCert?: string;
148
trustProxy?: string; // String in CLI, parsed to boolean
149
cookieSessionSecret?: string;
150
cookieSessionMaxAge?: string; // String in CLI, parsed to number
151
createUser?: boolean;
152
createMFA?: boolean;
153
userId?: string; // For basic single-user auth
154
userPassword?: string; // For basic single-user auth
155
agent?: string; // JSON string of agent configuration
156
}
157
```