Repository navigation
v0.4.0 - Schema Management CLI
✨ InstantDB Schema Management CLI
This release adds a comprehensive CLI tool for managing InstantDB schemas directly from Dart/Flutter projects. The CLI wraps the official InstantDB Node.js CLI and provides seamless integration for schema synchronization.
🚀 New Features
Built-in Schema CLI
Manage InstantDB schemas from any Dart/Flutter project:
# Available in any project that depends on instantdb_flutter
dart run instantdb_flutter:schema pull # Pull from cloud
dart run instantdb_flutter:schema push # Push to cloud
dart run instantdb_flutter:schema status # Show status
dart run instantdb_flutter:schema validate # Validate schema
dart run instantdb_flutter:schema diff # Compare (coming soon)
dart run instantdb_flutter:schema help # Show helpFeatures
- ✅ Pull schemas from cloud - Download TypeScript schemas from InstantDB
- ✅ Push schemas to cloud - Upload TypeScript schemas to InstantDB
- ✅ Schema status - View local schema files and CLI availability
- ✅ Schema validation - Validate Dart schema file syntax
- ✅ Color-coded output - Info, success, warnings, and errors
- ✅ Interactive confirmations - Safe operations with user prompts
- ✅ Custom locations -
--schema-fileflag for custom paths - ✅ App ID override -
--app-idflag for multi-environment support - ✅ Verbose logging -
--verboseflag for detailed output
📦 Integration Options
Direct CLI Usage
# Works from any project with instantdb_flutter dependency
dart run instantdb_flutter:schema pullJust/Make Integration
Add to your justfile:
schema-pull:
dart run instantdb_flutter:schema pull
schema-push:
dart run instantdb_flutter:schema push
schema-status:
dart run instantdb_flutter:schema statusThen use: just schema-pull, just schema-push, etc.
NPM Scripts
Add to package.json:
{
"scripts": {
"schema:pull": "dart run instantdb_flutter:schema pull",
"schema:push": "dart run instantdb_flutter:schema push"
}
}📖 Documentation
Quick Start
- Install Node.js and npx (required for InstantDB CLI)
- Authenticate:
npx instant-cli@latest login - Set app ID:
export INSTANT_APP_ID=your-app-id - Run commands:
dart run instantdb_flutter:schema help
Comprehensive Guides
- README.md - Schema Management section with quick start
- SCHEMA_MANAGEMENT.md - Complete guide including:
- All CLI commands with examples
- Integration patterns (CLI, justfile, npm scripts)
- Current workflow (manual conversion)
- Future workflow (automated conversion - planned)
- Best practices and troubleshooting
- Roadmap and planned features
🔧 Technical Details
New Files:
bin/schema.dart- CLI implementation (374 lines)SCHEMA_MANAGEMENT.md- Documentation (390 lines)
Modified Files:
pubspec.yaml- Addedargs: ^2.6.0dependency + executablejustfile- Added schema management commandsREADME.md- Added Schema Management sectionCHANGELOG.md- Full release notes
CLI Features:
- Color-coded output (blue=info, green=success, yellow=warning, red=error)
- Interactive confirmations for destructive operations
- Custom schema file locations
- App ID override support
- Verbose logging mode
⚠️ Current Limitations
Manual Conversion Required:
- TypeScript → Dart schema conversion is manual (for now)
- Dart → TypeScript schema conversion is manual (for now)
You need to maintain both instant.schema.ts (TypeScript) and your Dart schema definitions in sync manually.
🗺️ Roadmap
Planned Enhancements:
- Automatic TypeScript ↔ Dart schema conversion
- Visual schema diff with highlighting
- Schema migration generation
- Schema backup and restore
- Multi-environment management (dev/staging/prod)
- Schema snapshots with rollback support
📋 Migration Guide
No breaking changes - this is a pure feature addition. Existing code continues to work unchanged.
To start using schema management:
- Ensure Node.js and npx are installed
- Authenticate with InstantDB:
npx instant-cli@latest login - Set your app ID:
export INSTANT_APP_ID=your-app-id - Run:
dart run instantdb_flutter:schema help
🎯 Use Cases
Team Collaboration
- Pull latest schema before starting work
- Push schema changes for team review
- Validate schemas in CI/CD pipelines
Multi-Environment Deployment
# Development
INSTANT_APP_ID=dev-app-123 dart run instantdb_flutter:schema push
# Production
INSTANT_APP_ID=prod-app-456 dart run instantdb_flutter:schema pushCI/CD Integration
# .github/workflows/test.yml
- name: Validate Schema
run: dart run instantdb_flutter:schema validate📚 Resources
- CLI Help:
dart run instantdb_flutter:schema help - Full Documentation: SCHEMA_MANAGEMENT.md
- InstantDB CLI Docs: https://www.instantdb.com/docs/cli
- Package Repository: https://github.com/pillowsoft/instantdb_flutter
- Report Issues: https://github.com/pillowsoft/instantdb_flutter/issues
🙏 Feedback Welcome
This is the first release of the schema management CLI. We'd love to hear your feedback and suggestions!
- 💡 Feature requests: https://github.com/pillowsoft/instantdb_flutter/issues/new
- 🐛 Bug reports: https://github.com/pillowsoft/instantdb_flutter/issues/new
- 📖 Documentation improvements: Submit a PR
⬆️ Upgrading
Update your pubspec.yaml:
dependencies:
instantdb_flutter: ^0.4.0Then run:
flutter pub getThe schema CLI will be immediately available:
dart run instantdb_flutter:schema help