tideway-cli
CLI tool for scaffolding Tideway applications.
Installation
Commands
Global options:
--json- Emit machine-readable JSON lines (useful for tooling/agents)--plan- Show planned changes without writing files
tideway new
Create a minimal Tideway app with a starter route and sensible defaults.
If you run it without extra flags, it will prompt for common options.
Options:
--preset- Preset to apply (minimal, api)--features- Tideway features to enable (comma-separated)--with-config- Generate config.rs and error.rs starter files--with-docker- Generate docker-compose.yml for local Postgres--with-ci- Generate GitHub Actions CI workflow--no-prompt- Skip interactive prompts--summary- Print generated file summary--with-env- Always generate .env.example--path- Output directory (default: project name)--force- Overwrite existing files
Example:
Preset example:
List presets:
Preset api also includes a DB-backed sample resource and migration scaffold.
Docker example:
CI example:
The starter includes a basic tests/health.rs you can run with:
tideway doctor
Diagnose missing Tideway feature flags based on detected modules.
Options:
--path- Project directory to analyze (default: current directory)--fix- Generate .env.example when missing
tideway backend
Generate backend scaffolding with auth, billing, organizations, and admin modules.
# B2C app (auth + billing + admin)
# B2B app (auth + billing + organizations + admin)
Options:
--name- Project name (default:my_app)--output- Output directory (default:./src)--database- Database type:postgresorsqlite(default:postgres)--force- Overwrite existing files
tideway init
Scan for modules and generate main.rs with proper wiring.
This detects auth/, billing/, organizations/, and admin/ modules in your src directory and generates:
main.rs- Application entry point with module registrationconfig.rs- Configuration struct with environment loading.env.example- Example environment variables
Options:
--src- Source directory to scan (default:./src)--name- Project name (default: from Cargo.toml)--force- Overwrite existing files--no-database- Skip database setup--no-migrations- Skip auto-migration on startup--minimal- Generate a minimal main.rs + sample routes module
tideway add
Add Tideway features and optional scaffolding.
When adding OpenAPI, the CLI creates src/openapi_docs.rs if it does not exist.
tideway resource
Generate a CRUD route module for a resource.
If the OpenAPI feature is enabled, --wire will also update src/openapi_docs.rs with the new routes.
Use --db to scaffold a SeaORM entity + migration and switch routes to real DB CRUD. With --wire, it also wires the database into main.rs.
Use --repo to generate a repository layer for DB-backed resources.
Use --repo-tests to generate an ignored CRUD smoke test (requires DATABASE_URL).
Use --service to generate a thin service layer on top of the repository.
Use --id-type to switch ID generation (int or uuid) for DB scaffolding. Use --add-uuid to automatically add the uuid dependency.
Use --paginate to add limit/offset query params to list endpoints.
Use --search to add a q search filter to list endpoints (requires --paginate).
tideway setup
Set up frontend dependencies (Tailwind, shadcn components).
This automatically:
- Installs and configures Tailwind CSS
- Initializes shadcn-vue
- Installs all required shadcn components (button, input, card, dialog, table, etc.)
Options:
--style- Styling:shadcn,tailwind, orunstyled(default:shadcn)--no-tailwind- Skip Tailwind setup--no-components- Skip shadcn component installation
tideway dev
Run your app with .env loaded and optional auto-migrations.
tideway migrate
Run database migrations (SeaORM by default).
tideway generate
Generate frontend components for Vue (more frameworks coming soon).
# Generate auth components
# Generate all modules
Options:
--framework- Frontend framework:vue(default:vue)--style- Styling:shadcn,tailwind, orunstyled(default:shadcn)--output- Output directory (default:./src/components/tideway)--with-views- Also generate view files--force- Overwrite existing files
Quick Start
Backend
# Create a new B2B SaaS backend
&&
# Set up environment
# Edit .env with your database URL and JWT secret
# Run (migrations run automatically on startup)
Your API will be running at http://localhost:3000 with routes:
POST /auth/register,POST /auth/login,GET /auth/meGET /organizations,POST /organizationsGET /admin/users,GET /admin/organizations
Frontend
# Create Vue project with TypeScript, Router, and Pinia
# Set up Tailwind + shadcn-vue + all components
# Generate components, views, and configure router
# Run
Your frontend will be at http://localhost:5173 with pages:
/login,/register,/forgot-password,/reset-password/billing/settings/organization,/settings/members/admin,/admin/users,/admin/organizations
CORS Setup
If your frontend and backend are on different ports, add CORS to your backend main.rs:
use ;
use CorsLayer;
// In main():
let cors = new
.allow_origin
.allow_methods
.allow_headers;
let router = app.into_router.layer;
Add tower-http to your Cargo.toml:
Generated Structure
src/
├── main.rs # Entry point with auto-migrations
├── lib.rs # Module exports
├── config.rs # Environment configuration
├── error.rs # Error types
├── entities/ # SeaORM entities
├── auth/ # Authentication module
├── billing/ # Stripe billing module
├── organizations/ # Multi-tenancy (B2B only)
└── admin/ # Admin dashboard
migration/src/ # Database migrations