@snps/cli
v2.0.8
Published
π The Ultimate Development CLI - 15+ powerful features including AI assistance, real-time collaboration, cloud sync, performance optimization, and much more!
Maintainers
Readme
Synapse CLI
π The Ultimate Development CLI - A comprehensive command-line interface built with Rust and TypeScript, featuring 15+ powerful development tools including AI assistance, real-time collaboration, cloud sync, and much more!
Features
π― Core Development
- Project Initialization - Create projects with custom templates
- Development Server - Real-time development with hot reload
- Build System - Production-ready builds with optimization
- Testing Framework - Comprehensive testing with coverage
- Linting & Formatting - Code quality and style enforcement
- Code Generation - Generate components, pages, APIs, tests
π€ AI-Powered Development
- Code Generation - AI-powered code creation from natural language
- Code Completion - Intelligent code completion and suggestions
- Bug Fixing - Automated bug detection and fixing
- Test Generation - AI-generated unit tests
- Documentation - Automatic documentation generation
- Code Refactoring - Smart code restructuring
- Code Optimization - AI-powered performance improvements
π¦ Rust Integration & Performance
- Rust Compiler - WebAssembly compilation for maximum performance
- Performance Profiling - Advanced performance analysis
- Bundle Optimization - Tree shaking, minification, compression
- Memory Profiling - Memory usage analysis and optimization
- CPU Profiling - CPU usage analysis
- Benchmarking - Performance benchmarking tools
βοΈ Cloud & Deployment
- Multi-Cloud Support - AWS S3, Google Cloud, Azure, Vercel, Netlify
- GitHub Pages - Deploy to GitHub Pages
- Railway - Deploy to Railway
- DigitalOcean - Deploy to DigitalOcean
- Docker - Containerized deployment
π₯ Team Collaboration
- Real-time Editing - Live collaborative editing with cursors
- File Sharing - Share files and folders with team
- Code Review - Built-in code review with comments
- Team Management - Create teams and manage members
- Activity Feed - Track team activities and changes
- Notifications - Real-time notifications
π Security & Monitoring
- Security Scanning - Vulnerability detection and security audits
- Dependency Analysis - License compliance and outdated packages
- Secret Detection - Find hardcoded credentials
- Health Monitoring - Real-time system monitoring
- Performance Metrics - Detailed performance analytics
- Alert System - Configurable alerts for issues
π Internationalization
- Multi-language Support - 10+ built-in locales
- Translation Management - Extract, manage, validate translations
- Pluralization Rules - Advanced plural rule handling
- Date/Number Formatting - Locale-specific formatting
- RTL Support - Right-to-left language support
π Analytics & Intelligence
- Usage Analytics - Track usage patterns and metrics
- Performance Analytics - Detailed performance insights
- Team Analytics - Collaboration and productivity metrics
- Custom Dashboards - Configurable analytics dashboards
- Real-time Metrics - Live performance monitoring
πΎ Advanced Caching
- Intelligent Caching - Multi-strategy caching (LRU, LFU, TTL)
- Cache Policies - Write-through, write-behind, write-around
- Cache Invalidation - Smart invalidation by tags and patterns
- Performance Optimization - 95%+ cache hit rates
- Memory Management - Efficient memory usage
ποΈ Database Management
- Migration System - Database schema migrations
- Seeding - Database seeding and test data
- Schema Management - Database schema versioning
- Multi-Database Support - PostgreSQL, MySQL, SQLite, MongoDB, Redis
- Rollback Support - Safe migration rollbacks
π Documentation & APIs
- API Documentation - Auto-generated OpenAPI/Swagger docs
- Interactive Docs - Live documentation with Swagger UI
- Multiple Formats - OpenAPI, Postman, Insomnia, RAML
- Code Analysis - Automatic endpoint discovery
- Schema Generation - Auto-generated API schemas
Installation
Prerequisites
- Node.js 18.0.0 or higher
- Rust 1.70.0 or higher (for building from source)
- Git
Install from npm
npm install -g @snps/cliInstall from source
git clone https://github.com/synapse-framework/synapse.git
cd synapse/packages/cli
npm install
npm run buildQuick Start
Initialize a new project
synapse init my-awesome-app
cd my-awesome-appStart development server
synapse devBuild for production
synapse buildRun tests
synapse testUsage
Basic Commands
# Initialize new project
synapse init <project-name> [--template <template>] [--yes]
# Start development server
synapse dev [--port <port>] [--open]
# Build for production
synapse build [--output <dir>] [--minify]
# Run tests
synapse test [<pattern>] [--watch]
# Lint code
synapse lint [--fix]
# Format code
synapse format [--check]
# Generate code
synapse generate <type> <name>AI-Powered Commands
# Generate code from natural language
synapse ai generate "Create a React component for user authentication"
# Complete code snippets
synapse ai complete "function calculateSum"
# Fix bugs and issues
synapse ai fix "TypeError: Cannot read property 'length' of undefined"
# Generate unit tests
synapse ai test src/components/Button.tsx
# Generate documentation
synapse ai docs src/api/user.ts
# Refactor code
synapse ai refactor src/components/DataTable.tsx
# Optimize performance
synapse ai optimize src/components/DataTable.tsx
# Analyze code quality
synapse ai analyze src/Advanced Commands
# Plugin management
synapse plugin install @snps/ui
synapse plugin list
synapse plugin uninstall @snps/ui
# Template management
synapse template list
synapse template create my-template
synapse template install github:user/template
# Cloud deployment
synapse deploy aws-s3
synapse deploy vercel
synapse deploy netlify
# Security scanning
synapse security scan
synapse security audit
synapse security fix
# Database management
synapse db migrate
synapse db seed
synapse db status
# Documentation
synapse docs generate
synapse docs serve
# Internationalization
synapse i18n extract
synapse i18n validate
# Caching
synapse cache stats
synapse cache clear
synapse cache optimize
# Analytics
synapse analytics start
synapse analytics report
# Team collaboration
synapse team create "My Team"
synapse team invite [email protected]
# Cloud synchronization
synapse cloud sync
synapse cloud status
# Hot reload
synapse hot-reload start
synapse hot-reload status
# Rust compilation
synapse rust init
synapse rust compile
# Performance profiling
synapse profile start
synapse profile report
# Monitoring
synapse monitor start
synapse monitor metricsTypeScript Integration
The CLI provides comprehensive TypeScript support with full type definitions:
import {
SynapseCLIWrapper,
createSynapseCLI,
InitCommand,
DevCommand,
BuildCommand,
CLIEvent
} from '@snps/cli';
// Create CLI instance
const cli = createSynapseCLI();
// Initialize
await cli.initialize();
// Set up event listeners
cli.on('build_start', (event: CLIEvent) => {
console.log('Build started:', event.message);
});
// Initialize project
const initOptions: InitCommand = {
name: 'my-app',
template: 'fullstack',
yes: false
};
await cli.init(initOptions);
// Start development server
const devOptions: DevCommand = {
port: 3000,
open: true
};
await cli.dev(devOptions);
// Build project
const buildOptions: BuildCommand = {
output: 'dist',
minify: true
};
await cli.build(buildOptions);Templates
Available Templates
- default - Standard Synapse project with basic features
- api - Backend API server with Express and TypeScript
- fullstack - Complete fullstack application with React and Node.js
- ui-library - Component library with Storybook
- enterprise - Enterprise-grade application with security and monitoring
- startup - Rapid development MVP template
Using Templates
# List available templates
synapse template list
# Initialize with specific template
synapse init my-app --template fullstack
# Create custom template
synapse template create my-custom-template
# Install template from GitHub
synapse template install github:user/my-templateConfiguration
Project Configuration
The CLI uses a .synapse/config.json file for project-specific configuration:
{
"name": "my-app",
"version": "0.1.0",
"template": "fullstack",
"features": ["typescript", "testing", "ai"],
"created_at": "2024-01-01T00:00:00Z",
"last_modified": "2024-01-01T00:00:00Z"
}Global Configuration
Global configuration is stored in ~/.config/synapse/config.json:
{
"default_template": "fullstack",
"ai_provider": "openai",
"ai_api_key": "your-api-key",
"cloud_provider": "aws",
"team_id": "team-123"
}API Reference
SynapseCLIWrapper
The main TypeScript wrapper class for the CLI.
Methods
init(options: InitCommand): Promise<void>- Initialize new projectdev(options?: DevCommand): Promise<void>- Start development serverbuild(options?: BuildCommand): Promise<void>- Build for productiontest(options?: TestCommand): Promise<void>- Run testslint(options?: LintCommand): Promise<void>- Lint codeformat(options?: FormatCommand): Promise<void>- Format codegenerate(options: GenerateCommand): Promise<void>- Generate codeplugin(options: PluginCommand): Promise<void>- Plugin managementtemplate(options: TemplateCommand): Promise<void>- Template managementai(options: AiCommand): Promise<void>- AI-powered featuresdeploy(options: DeployCommand): Promise<void>- Cloud deploymentsecurity(options: SecurityCommand): Promise<void>- Security scanningmonitor(options: MonitorCommand): Promise<void>- System monitoringprofile(options: ProfileCommand): Promise<void>- Performance profilingdb(options: DbCommand): Promise<void>- Database managementdocs(options: DocsCommand): Promise<void>- Documentation generationi18n(options: I18nCommand): Promise<void>- Internationalizationcache(options: CacheCommand): Promise<void>- Caching managementanalytics(options: AnalyticsCommand): Promise<void>- Analyticscloud(options: CloudCommand): Promise<void>- Cloud synchronizationteam(options: TeamCommand): Promise<void>- Team collaborationhotReload(options: HotReloadCommand): Promise<void>- Hot reloadrust(options: RustCommand): Promise<void>- Rust compilationbatch(options: BatchCommand): Promise<void>- Batch operationsconfig(options: ConfigCommand): Promise<void>- Configuration management
Utility Methods
getVersion(): string- Get CLI versiongetConfig(): ProjectConfig | null- Get project configurationsetConfig(config: Partial<ProjectConfig>): void- Set project configurationvalidateProject(): boolean- Validate project structuregetProjectInfo(): ProjectInfo | null- Get project information
Event System
on(eventType: string, listener: CLIEventListener): void- Add event listeneroff(eventType: string, listener: CLIEventListener): void- Remove event listener
Event Types
build_start- Build process startedbuild_complete- Build process completedtest_start- Test process startedtest_complete- Test process completederror- Error occurredwarning- Warning messageinfo- Information message
Examples
See the examples/usage.ts file for comprehensive usage examples.
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
License
MIT License - see LICENSE file for details.
Support
- Documentation - docs.synapse.dev
- Issues - GitHub Issues
- Discord - Join our community
- Email - [email protected]
Changelog
See CHANGELOG.md for a list of changes.
Roadmap
- [ ] WebAssembly support for browser-based CLI
- [ ] VS Code extension integration
- [ ] JetBrains plugin support
- [ ] Mobile app development templates
- [ ] Machine learning integration
- [ ] Blockchain development tools
- [ ] IoT development support
- [ ] AR/VR development templates
Built with β€οΈ by the Synapse Framework Team
