List of CLI Commands
This document lists all available CLI commands for Yew Search. Commands are executed from within the backend Docker container using the pnpm run cli:prod script.
User Management Commands
user:create
Create a new user account.
Description: Creates a new user with email, name, and password. The password is entered interactively with masked input.
Usage:
docker exec -it yew-backend pnpm run cli:prod user:create --email="admin@example.com" --name="Admin User"
Options:
-e, --email <email>(required) - User's email address-n, --name <name>(optional) - User's display name
Interactive Prompts:
- Password (masked with
*)
Example Output:
✓ User created successfully
ID: 01234567-89ab-cdef-0123-456789abcdef
Email: admin@example.com
Name: Admin User
user:update-password
Update an existing user's password.
Description: Updates a user's password by email or user ID. Prompts for new password and confirmation.
Usage:
# Update by email
docker exec -it yew-backend pnpm run cli:prod user:update-password --email="admin@example.com"
# Update by user ID
docker exec -it yew-backend pnpm run cli:prod user:update-password --id="01234567-89ab-cdef-0123-456789abcdef"
Options:
-e, --email <email>(optional) - User's email address-i, --id <id>(optional) - User's ID- At least one identifier (email or id) must be provided
Interactive Prompts:
- New password (masked with
*) - Confirm password (masked with
*)
Example Output:
✓ Password updated successfully
User ID: 01234567-89ab-cdef-0123-456789abcdef
Email: admin@example.com
Integration Commands
user-integration:create
Create a test user integration.
Description: Creates a test integration for development and testing purposes.
Usage:
docker exec -it yew-backend pnpm run cli:prod user-integration:create
Options: None
Example Output:
✓ Created test integration
ID: 01234567-89ab-cdef-0123-456789abcdef
Domain: hello-world
General Commands
View all available commands
List all registered CLI commands and their descriptions.
Usage:
docker exec -it yew-backend pnpm run cli:prod --help
View command-specific help
Get detailed help for a specific command.
Usage:
docker exec -it yew-backend pnpm run cli:prod user:create --help
Running Commands
From Docker Container
When running Yew Search in Docker Compose, execute commands inside the backend container:
docker exec -it yew-backend pnpm run cli:prod <command-name> [options]
From Local Development
When running the backend locally during development:
cd backend
pnpm run cli <command-name> [options]
Exit Codes
All CLI commands follow standard Unix exit code conventions:
0- Success1- Error (validation failed, user not found, database error, etc.)
Error Handling
Commands provide clear error messages with the ✗ symbol:
✗ User with email admin@example.com already exists
✗ Password cannot be empty
✗ Passwords do not match
✗ User not found: test@example.com
✗ Failed to create user: Database connection failed
Success messages use the ✓ symbol:
✓ User created successfully
✓ Password updated successfully
✓ Created test integration
Troubleshooting
Command produces zero output and exits with code 1 in Docker
Use pnpm run cli:prod (compiled, node dist/cli/cli.js), not pnpm run cli (ts-node against src/cli/cli.ts) — the backend Dockerfile deletes
src/ after building, so the ts-node-based script has nothing to run
against inside the container and fails silently. pnpm run cli is for
native local development only (cd backend && pnpm run start:dev flow),
where src/ still exists.
If output is still silent with cli:prod, it's likely a NestJS module
bootstrap failure inside CliModule (e.g. a missing provider/import) —
nest-commander's error logging can itself get suppressed depending on
the logger level passed to CommandFactory.run, so a broken DI graph can
fail with no visible error at all. backend/src/cli/cli.ts passes
['error', 'warn'] specifically so this stays visible; if you still see
nothing, bypass nest-commander and call
NestFactory.createApplicationContext(CliModule, { logger: ['error', 'warn', 'log'] }) directly to surface the real error.
Development
For information on creating new CLI commands, see Writing CLI Commands.