WoWSQL Command Line Interface
Project description
WoWSQL CLI
Command-line interface for managing WoWSQL backend services. A comprehensive CLI tool similar to wowsql CLI for managing databases, storage, migrations, and more.
Installation
From PyPI (Recommended)
pip install wowsql-cli
From Source
cd cli
pip install -e .
Note: The CLI package is named wowsql_cli internally to avoid conflicts with the SDK's wowsql package, but the command is still wowsql.
Quick Start
- Login:
wowsql login
# Or with email
wowsql login --email your@email.com
- Initialize a project:
wowsql init
# Or link to existing project
wowsql link your-project-slug
- List projects:
wowsql projects list
- Set default project:
wowsql projects set-default your-project-slug
- Query database:
wowsql db query "SELECT * FROM users LIMIT 10"
Commands
Authentication
wowsql login [--email] [--api-key] [--profile]- Login to WoWSQLwowsql logout [--profile]- Logout and clear credentialswowsql auth status- Show authentication status and current profilewowsql auth switch-profile <name>- Switch to a different profile
Project Management
wowsql init [--project] [--template] [--force]- Initialize a new WoWSQL project in current directorywowsql projects list [--format]- List all projectswowsql projects get <slug>- Get detailed project informationwowsql projects create <name> [--description] [--region]- Create a new projectwowsql projects update <slug> [--name] [--description]- Update project settingswowsql projects delete <slug>- Delete a project (⚠️ Permanent)wowsql projects set-default <slug>- Set the default project for commandswowsql projects current- Show the current default projectwowsql link <project-slug>- Link current directory to a WoWSQL projectwowsql unlink- Unlink current directory from project
Database Operations
Table Management
wowsql db tables list [--project] [--format]- List all tables in the databasewowsql db tables describe <table> [--project]- Get table schema and column information
Query & Data Operations
wowsql db query "<sql>" [--file] [--project] [--format]- Execute a SQL querywowsql db insert <table> [--data] [--file] [--project]- Insert data into a tablewowsql db update <table> --where "<condition>" --data '{"key": "value"}' [--project]- Update data in a tablewowsql db delete <table> --where "<condition>" [--project]- Delete data from a table
Import/Export
wowsql db export <table> [--output] [--format] [--project]- Export table data to JSON or CSVwowsql db import <table> --file <path> [--format] [--project]- Import data from JSON or CSV file
Database Management
wowsql db dump [--output] [--schema-only] [--data-only] [--tables] [--project]- Export entire database to SQL filewowsql db restore --file <path> [--confirm] [--project]- Restore database from SQL filewowsql db seed [--file] [--project]- Seed database with initial data from SQL or JSON filewowsql db diff [--project] [--format]- Compare local and remote database schemaswowsql db connect [--project]- Get database connection information
Schema Management
wowsql db schema dump [--output] [--project]- Export database schema only (no data)wowsql db schema diff [--project] [--format]- Show schema differences between local and remote
Performance Tools
wowsql db explain "<sql>" [--project] [--format]- Explain query execution planwowsql db analyze <table> [--project]- Analyze table and update statisticswowsql db optimize <table> [--project]- Optimize table
Database Objects
Views
wowsql views list [--project] [--format]- List all database viewswowsql views create <name> [--file] "<sql>" [--project]- Create a database viewwowsql views describe <name> [--project] [--format]- Describe view structure
Stored Procedures
wowsql procedures list [--project] [--format]- List all stored procedureswowsql procedures create <name> [--file] "<sql>" [--project]- Create a stored procedurewowsql procedures execute <name> [--params] [--project] [--format]- Execute a stored procedure
Indexes
wowsql indexes list [<table>] [--project] [--format]- List indexes for a table or all tableswowsql indexes create <name> <table> <columns> [--unique] [--project]- Create an index on a tablewowsql indexes analyze <table> [--project] [--format]- Analyze index usage for a table
Triggers
wowsql triggers list [<table>] [--project] [--format]- List triggers for a table or all tableswowsql triggers create <name> <table> <timing> <event> [--file] "<sql>" [--project]- Create a database triggerwowsql triggers delete <name> [--confirm] [--project]- Delete a trigger
Migrations
wowsql migration new <name> [--project]- Create a new migration filewowsql migration list [--project]- List all migrationswowsql migration status [--project]- Show migration status (applied/pending)wowsql migration up [--count] [--project]- Apply pending migrationswowsql migration down [--count] [--project]- Rollback the last migration(s)
Storage Operations
wowsql storage list [--prefix] [--project]- List files in storagewowsql storage upload <file> [--path] [--folder] [--project]- Upload a file to storagewowsql storage download <path> [--output] [--project]- Download a file from storagewowsql storage delete <path> [--project]- Delete a file from storagewowsql storage quota [--project]- Check storage quota and usage
Secrets Management
wowsql secrets list [--project] [--format]- List all project secretswowsql secrets set <key> <value> [--public] [--project]- Set a secret valuewowsql secrets get <key> [--project]- Get a secret valuewowsql secrets unset <key> [--project]- Delete a secret
Logs & Monitoring
wowsql logs view [--follow] [--filter] [--limit] [--project] [--format]- View project logswowsql status [--project] [--format]- Show project status and health
Backup & Restore
wowsql backup create [--name] [--project]- Create a database backupwowsql backup list [--project] [--format]- List all backups for a projectwowsql backup restore <backup-id> [--confirm] [--project]- Restore database from backupwowsql backup download <backup-id> [--output] [--project]- Download backup file
Configuration Management
wowsql config get <key> [--project]- Get a configuration valuewowsql config set <key> <value> [--project]- Set a configuration valuewowsql config list [--project] [--format]- List all configuration values
Validation
wowsql validate [--project]- Validate project configuration, database connection, schema, and migrations
TypeScript Type Generation
wowsql gen typescript [--output] [--project]- Generate TypeScript types from database schema
Local Development
wowsql local start- Start local development environment (Postgres, Redis, MinIO)wowsql local stop- Stop local development environmentwowsql local status- Check status of local serviceswowsql local reset- Reset local environment (⚠️ Deletes all data)wowsql local logs [--service] [--follow]- View logs from local services
Output Formats
Most commands support multiple output formats:
--output table(default) - Human-readable table format--output json- JSON format for scripting--output yaml- YAML format
Example:
wowsql projects list --output json | jq '.[0].slug'
Configuration
Configuration is stored in ~/.wowsql/config.yaml. You can manage multiple profiles for different environments.
Configuration File Structure
api_url: https://api.wowsql.com
current_profile: default
profiles:
default:
api_url: https://api.wowsql.com
production:
api_url: https://api.wowsql.com
Using Profiles
# Use a specific profile
wowsql --profile production projects list
# Switch default profile
wowsql auth switch-profile production
Project Configuration
When you run wowsql init or wowsql link, a .wowsql/config.yaml file is created in your project directory. This allows commands to automatically use the linked project without specifying --project every time.
Examples
Complete Workflow
# 1. Login
wowsql login
# 2. Initialize project
wowsql init --template basic
# 3. Create a migration
wowsql migration new create_users_table
# 4. Edit the migration file in migrations/
# Then apply it
wowsql migration up
# 5. Seed the database
wowsql db seed --file seed.sql
# 6. Query the database
wowsql db query "SELECT * FROM users"
# 7. Create a backup
wowsql backup create --name "pre-deployment"
# 8. Generate TypeScript types
wowsql gen typescript --output src/types/database.ts
Database Management
# Dump entire database
wowsql db dump --output backup.sql
# Dump schema only
wowsql db dump --schema-only --output schema.sql
# Restore from backup
wowsql db restore --file backup.sql --confirm
# Compare schemas
wowsql db diff
Secrets Management
# Set a secret
wowsql secrets set API_KEY "sk_live_12345"
# Set a public secret (can be exposed to client)
wowsql secrets set STRIPE_KEY "pk_live_..." --public
# List all secrets
wowsql secrets list
# Get a secret value
wowsql secrets get API_KEY
Performance Optimization
# Explain a query
wowsql db explain "SELECT * FROM users WHERE email = 'test@example.com'"
# Analyze table statistics
wowsql db analyze users
# Optimize table
wowsql db optimize users
# Analyze indexes
wowsql indexes analyze users
Tips & Best Practices
-
Set a Default Project: Use
wowsql projects set-default <slug>to avoid specifying--projectin every command -
Use JSON Output for Scripts: Pipe JSON output to
jqor other tools for automation -
Link Projects: Run
wowsql linkin your project directory to automatically use that project -
Use Profiles: Create separate profiles for development, staging, and production environments
-
Regular Backups: Create backups before major changes:
wowsql backup create --name "before-migration-$(date +%Y%m%d)"
-
Validate Before Deploying: Always run
wowsql validatebefore deploying changes
Troubleshooting
Authentication Issues
# Check auth status
wowsql auth status
# Re-login if needed
wowsql logout
wowsql login
Project Not Found
# List all projects
wowsql projects list
# Set default project
wowsql projects set-default <slug>
# Or use --project flag
wowsql db query "SELECT 1" --project <slug>
Command Not Found
# Reinstall CLI
pip install --upgrade wowsql-cli
# Or from source
cd cli && pip install -e .
Documentation
For complete documentation with detailed examples, see docs.wowsql.com/cli
Support
- GitHub Issues: github.com/wowsql/cli/issues
- Documentation: docs.wowsql.com
- Email: support@wowsql.com
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wowsql_cli-1.7.0.tar.gz.
File metadata
- Download URL: wowsql_cli-1.7.0.tar.gz
- Upload date:
- Size: 44.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f33a9d896e3c787f9c9c81bb02d249446a6e0a46154187b095f51e830cd57f6c
|
|
| MD5 |
e048751bf8b70fa277d35f1e0ec498cf
|
|
| BLAKE2b-256 |
965dab720a414d7d42241242160c25c80f3034013942f1731352c6e2c64695b1
|
File details
Details for the file wowsql_cli-1.7.0-py3-none-any.whl.
File metadata
- Download URL: wowsql_cli-1.7.0-py3-none-any.whl
- Upload date:
- Size: 51.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5736c82ac41b2c65d346fab85a09d495dfd1a0d8378f475b9986a95768a3e9ac
|
|
| MD5 |
09fb2d308a5fa1204682771baedfe920
|
|
| BLAKE2b-256 |
dbb6830e48edf4f5f75b0b4ac573db7580c8a43fcefe62482f581fa85fe0aeb8
|