@magicappdev/cli
v0.0.14
Published
CLI tool for creating and managing MagicAppDev apps
Downloads
38
Readme
MagicAppDev CLI
A powerful CLI tool for creating and managing MagicAppDev applications. The MagicAppDev CLI simplifies the process of generating, customizing, and deploying fullstack apps across web and mobile platforms.
Table of Contents
Installation
You can install the MagicAppDev CLI using npm, yarn, or pnpm:
# Using npm
npm install -g @magicappdev/cli
# Using yarn
yarn global add @magicappdev/cli
# Using pnpm
pnpm add -g @magicappdev/cliFor more details, visit the npm page.
Usage
The CLI provides several commands to manage your MagicAppDev projects:
# Initialize a new MagicAppDev project
magicappdev init
# Authenticate with MagicAppDev
magicappdev auth
# Start an interactive chat session
magicappdev chat
# Generate components or apps
magicappdev generate <type> <name>
# Run diagnostics on your project
magicappdev doctorCommands
init
Initialize a new MagicAppDev project in the current directory.
magicappdev initauth
Authenticate with MagicAppDev services.
magicappdev authchat
Start an interactive chat session for app creation and management.
magicappdev chatgenerate
Generate components, apps, or other resources.
# Generate a new component
magicappdev generate component my-component
# Generate a new app
magicappdev generate app my-appdoctor
Run diagnostics to check your project setup and configuration.
magicappdev doctorConfiguration
Environment Variables
You can configure the CLI using environment variables in a .env file:
MAGICAPPDEV_API_KEY=your_api_key_here
MAGICAPPDEV_PROJECT_DIR=./my-projectConfig File
The CLI can also be configured using a magicappdev.config.json file:
{
"apiKey": "your_api_key_here",
"projectDir": "./my-project",
"defaultTemplate": "web"
}Features
- Project Initialization: Quickly set up new MagicAppDev projects.
- Authentication: Securely authenticate with MagicAppDev services.
- Interactive Chat: Use AI-powered chat for app creation and management.
- Code Generation: Generate components, apps, and other resources.
- Diagnostics: Run diagnostics to ensure your project is set up correctly.
Development
Prerequisites
- Node.js (v18 or higher)
- pnpm (v8 or higher)
Setup
Clone the repository:
git clone https://github.com/magicappdev/magicappdev.git cd magicappdevInstall dependencies:
pnpm installBuild the CLI:
cd packages/cli pnpm run buildLink the CLI for local development:
pnpm link --global
Running Tests
To run tests for the CLI:
pnpm run testLicense
MagicAppDev CLI is licensed under the MIT License.
Troubleshooting
Common Issues
- Command Not Found: Ensure the CLI is installed globally and your PATH is set correctly.
- Authentication Errors: Verify your API key and environment variables.
- Build Errors: Check your Node.js and pnpm versions and ensure all dependencies are installed.
FAQ
Q: How do I update the CLI?
A: Run pnpm update -g @magicappdev/cli to update to the latest version.
Q: Can I use the CLI with npm or yarn?
A: Yes, you can install the CLI using npm or yarn, but pnpm is recommended for optimal performance.
Q: How do I report a bug?
A: Please open an issue on our GitHub repository.
