UNPKG

@morphixai/code

Version:

Rapidly build and ship ready-to-use cross-platform mini-apps with AI-powered development experience

298 lines (213 loc) β€’ 9.27 kB
# @morphixai/code [![npm version](https://img.shields.io/npm/v/@morphixai/code.svg)](https://www.npmjs.com/package/@morphixai/code) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) [![GitHub](https://img.shields.io/badge/GitHub-morphixai--code-black?logo=github)](https://github.com/Morphicai/morphixai-code) > **Rapidly build and ship ready-to-use cross-platform mini-apps** **MorphixAI Code** is a powerful CLI tool and development framework that enables you to quickly create, develop, and deploy cross-platform mini-apps for the MorphixAI ecosystem. πŸ“– **Documentation in other languages**: [πŸ‡¨πŸ‡³ δΈ­ζ–‡](https://github.com/Morphicai/morphixai-code/blob/main/docs/README_CN.md) | [πŸ‡―πŸ‡΅ ζ—₯本θͺž](https://github.com/Morphicai/morphixai-code/blob/main/docs/README_JA.md) | [πŸ‡°πŸ‡· ν•œκ΅­μ–΄](https://github.com/Morphicai/morphixai-code/blob/main/docs/README_KO.md) ## ✨ Features - πŸš€ **Rapid Development** - Create projects in seconds, start coding immediately - πŸ’‘ **AI-Powered** - Seamlessly works with AI coding assistants like [Cursor](https://cursor.sh) - πŸ“± **Cross-Platform** - Write once, run on Web, iOS, and Android - 🎯 **Zero Barrier** - Perfect for frontend beginners - πŸ”§ **Ready to Use** - Built-in dev server, hot reload, and build tools - 🌍 **Share Globally** - Publish to MorphixAI App Marketplace ## πŸš€ Quick Start ### Create Your First Mini-App ```bash npx @morphixai/code create m-app cd m-app npm install npm run dev ``` That's it! Your development console will open automatically at `http://localhost:8812`. πŸ’‘ **Tip**: For the best AI-assisted development experience, use [Cursor](https://cursor.sh) editor. ## πŸ“š CLI Commands ### `create` - Create New Project ```bash npx @morphixai/code create [project-name] [options] Options: -t, --template <template> Template to use (default: react-ionic) -y, --yes Skip prompts, use defaults ``` **Examples:** ```bash # Interactive mode npx @morphixai/code create # Specify project name npx @morphixai/code create m-app # Use specific template npx @morphixai/code create m-app --template react-ionic ``` ### `dev` - Start Development Server ```bash morphixai dev [options] Options: -p, --port <port> Port number (default: 8812) --console-path <path> Console path (default: /__console) --debug Enable debug mode --no-open Don't open browser automatically ``` **Examples:** ```bash # Use default port 8812 npm run dev # Use custom port morphixai dev --port 3000 # Enable debug mode morphixai dev --debug # Don't open browser automatically morphixai dev --no-open ``` ### `build` - Build for Production ```bash morphixai build [options] Options: -o, --outDir <dir> Output directory (default: dist) --sourcemap Generate source maps ``` **Examples:** ```bash # Build to default directory npm run build # Build to custom directory morphixai build --outDir build # Generate source maps morphixai build --sourcemap ``` ### `restore` - Restore Source Files ```bash morphixai restore [options] Options: -s, --source <path> Source JSON file path (default: _dev/app-files.json) -y, --yes Skip confirmation prompt --debug Enable debug mode ``` **Examples:** ```bash # Restore from _dev/app-files.json (with confirmation) morphixai restore # Restore from dist/app-files.json morphixai restore --source dist/app-files.json # Restore from remote URL morphixai restore --source https://example.com/app-files.json # Skip confirmation prompt morphixai restore --yes # Restore from custom path morphixai restore --source /path/to/app-files.json ``` **Features:** - βœ… Supports local file paths (relative or absolute) - βœ… Supports remote URLs (http:// or https://) - βœ… Automatic download from remote sources - βœ… Interactive confirmation before overwriting files **Notes:** - Only `.json` files are supported (both local and remote) - Metadata files (`app-files.js`, `app-files.json`) will be automatically excluded from restore - Remote files are downloaded to a temporary location and cleaned up after restore - **⚠️ Warning:** This command will overwrite existing files in the `src/` directory. Always confirm the changes before proceeding. ### `template` - Template Management ```bash morphixai template <command> Commands: list List available templates update Update template cache clear-cache Clear template cache ``` ### `prompts` - AI Prompts Management ```bash morphixai prompts <command> Commands: check Check prompts version update Update prompts to latest version install [editor] Install prompts for specific editor (cursor, claude, all) ``` ## 🎯 Project Structure ``` m-app/ β”œβ”€β”€ src/ # Your mini-app source code β”‚ β”œβ”€β”€ app.jsx # App entry point β”‚ β”œβ”€β”€ components/ # React components β”‚ └── styles/ # CSS modules β”œβ”€β”€ _dev/ # Development tools (auto-generated) β”œβ”€β”€ docs/ # Documentation β”œβ”€β”€ package.json # Dependencies and scripts └── project-config.json # Project configuration and ID ``` ## πŸ’‘ Use Cases MorphixAI supports building various types of mini-apps: - πŸ“Š **Productivity Tools** - Todo lists, notes, habit trackers - 🎨 **Creative Tools** - Image editors, drawing apps, design assistants - πŸ“± **Life Utilities** - Weather, calculators, unit converters - πŸ€– **AI Applications** - Smart Q&A, image recognition, content generation - πŸ’Ό **Business Apps** - Business cards, product showcases, booking systems ## πŸ€– AI-Assisted Development MorphixAI Code works seamlessly with AI coding assistants. Recommended: [Cursor](https://cursor.sh) editor. **Example workflow:** ``` You: Create a user profile card component with avatar, name, and bio AI: I'll create this component... 1. Create UserCard.jsx component 2. Add responsive styles 3. Support click interactions 4. Optimize for mobile display ``` With AI assistants, you can: - βœ… Describe requirements in natural language - βœ… Auto-generate components, styles, and logic - βœ… Follow best practices and MorphixAI specs - βœ… Get complete, runnable code instantly ## πŸ“± Where to Experience MorphixAI? - **iOS**: Search "MorphixAI" in App Store - **Android**: [Download from official website](https://baibian.app/) - **Web**: [App Marketplace](https://app-shell.focusbe.com/app-market) ## 🌍 Publish & Share ### Publish to Official App Marketplace (Recommended) 1. Ensure your mini-app works properly 2. Email details to `contact@baibian.app` 3. Include: App ID, brief description, use cases 4. Your app will appear in the marketplace after approval ### Private Sharing 1. Run locally on your computer 2. Share the code folder as zip 3. Recipients follow the same steps to run ## πŸ› οΈ System Capabilities MorphixAI Mini-Apps can access: - πŸ“¦ Data Storage - πŸ“· Camera & Photos - πŸ“ File Operations - πŸ“ Geolocation - πŸ“… Calendar Integration - πŸ”” Push Notifications - πŸ€– AI Capabilities (GPT, Claude, etc.) ## πŸ†˜ Get Help - πŸ“– **Full Documentation**: [GitHub Repository](https://github.com/Morphicai/morphixai-code) - πŸ› **Report Issues**: [GitHub Issues](https://github.com/Morphicai/morphixai-code/issues) - πŸ’¬ **Development Specs**: [MorphixAI Development Specification](https://app-shell.focusbe.com/docs/app-development-specification.md) - πŸ“§ **Contact Us**: contact@baibian.app ## πŸ“– More Resources - [Full Documentation](https://github.com/Morphicai/morphixai-code#readme) - [Contributing Guide](https://github.com/Morphicai/morphixai-code/blob/main/CONTRIBUTING.md) - [Quick Start Guide](https://github.com/Morphicai/morphixai-code/blob/main/QUICKSTART_RELEASE.md) - [CLI Prompts Guide](https://github.com/Morphicai/morphixai-code/blob/main/CLI_PROMPTS_GUIDE.md) - [Changelog](https://github.com/Morphicai/morphixai-code/blob/main/packages/cli/CHANGELOG.md) ## πŸ—ΊοΈ Roadmap - [ ] Fullscreen mode support - [ ] Built-in capabilities panel - [ ] Flutter development support - [ ] GitHub Actions integration ## 🀝 Contributing We welcome contributions of all kinds! 1. Fork the project: [github.com/Morphicai/morphixai-code](https://github.com/Morphicai/morphixai-code) 2. Create your feature branch: `git checkout -b feature/AmazingFeature` 3. Commit your changes: `git commit -m 'Add some AmazingFeature'` 4. Push to the branch: `git push origin feature/AmazingFeature` 5. Open a Pull Request See our [Contributing Guide](https://github.com/Morphicai/morphixai-code/blob/main/CONTRIBUTING.md) for more details. ## πŸ“„ License This project is licensed under the MIT License - see the [LICENSE](https://github.com/Morphicai/morphixai-code/blob/main/LICENSE) file for details. ## ⭐ Star History If this project helps you, please give us a Star! ⭐ [![Star History Chart](https://api.star-history.com/svg?repos=Morphicai/morphixai-code&type=Date)](https://star-history.com/#Morphicai/morphixai-code&Date) --- **Built with ❀️ by the [MorphixAI](https://baibian.app/) Team**