Api2 min read
CLI Tool
CLI Tool
The OpsKnight CLI is a recovery and automation tool for user management.
Important: For normal operations, use the web interface:
- First admin: Use the
/setuppage when OpsKnight first starts- Additional users: Use Settings → Users → Invite User
The CLI is primarily for recovery scenarios (e.g., locked out of all admin accounts) or CI/CD automation.
Usage
npm run opsknight -- [options]
When to Use the CLI
| Scenario | Recommended Method |
|---|---|
| First-time setup | /setup page in browser |
| Adding team members | Invite via UI |
| Locked out of admin | CLI |
| CI/CD user provisioning | CLI |
| Password reset (no email) | CLI with --update |
Create a User
npm run opsknight -- \
--user "John Doe" \
--email [email protected] \
--password SecurePass123! \
--role admin
Options
| Option | Description | Required |
|---|---|---|
--user |
User's full name | ✅ |
--email |
Email address | ✅ |
--password |
Password | ✅ |
--role |
Role: admin, responder, user |
✅ |
--update |
Update existing user | - |
Update a User
npm run opsknight -- \
--user "John Doe" \
--email [email protected] \
--password NewPassword123! \
--role responder \
--update
Docker Usage
docker exec -it opsknight_app npm run opsknight -- \
--user "Admin" \
--email [email protected] \
--password SecurePass123! \
--role admin
Kubernetes Usage
kubectl exec -it deploy/opsknight -- npm run opsknight -- \
--user "Admin" \
--email [email protected] \
--password SecurePass123! \
--role admin
Best Practices
- Use strong passwords.
- Store credentials securely.
- Prefer SSO for production.
Last updated for v1
Edit this page on GitHub