@magicappdev/cli 0.0.2 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,202 @@
1
+ # MagicAppDev CLI
2
+
3
+ ![npm version](https://img.shields.io/npm/v/@magicappdev/cli)
4
+ ![npm downloads](https://img.shields.io/npm/dm/@magicappdev/cli)
5
+ ![license](https://img.shields.io/npm/l/@magicappdev/cli)
6
+
7
+ 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.
8
+
9
+ ## Table of Contents
10
+
11
+ - [Installation](#installation)
12
+ - [Usage](#usage)
13
+ - [Commands](#commands)
14
+ - [Configuration](#configuration)
15
+ - [Features](#features)
16
+ - [Development](#development)
17
+ - [License](#license)
18
+ - [Contributing](#contributing)
19
+ - [Troubleshooting](#troubleshooting)
20
+
21
+ ## Installation
22
+
23
+ You can install the MagicAppDev CLI using npm, yarn, or pnpm:
24
+
25
+ ```bash
26
+ # Using npm
27
+ npm install -g @magicappdev/cli
28
+
29
+ # Using yarn
30
+ yarn global add @magicappdev/cli
31
+
32
+ # Using pnpm
33
+ pnpm add -g @magicappdev/cli
34
+ ```
35
+
36
+ For more details, visit the [npm page](https://www.npmjs.com/package/@magicappdev/cli).
37
+
38
+ ## Usage
39
+
40
+ The CLI provides several commands to manage your MagicAppDev projects:
41
+
42
+ ```bash
43
+ # Initialize a new MagicAppDev project
44
+ magicappdev init
45
+
46
+ # Authenticate with MagicAppDev
47
+ magicappdev auth
48
+
49
+ # Start an interactive chat session
50
+ magicappdev chat
51
+
52
+ # Generate components or apps
53
+ magicappdev generate <type> <name>
54
+
55
+ # Run diagnostics on your project
56
+ magicappdev doctor
57
+ ```
58
+
59
+ ## Commands
60
+
61
+ ### `init`
62
+ Initialize a new MagicAppDev project in the current directory.
63
+
64
+ ```bash
65
+ magicappdev init
66
+ ```
67
+
68
+ ### `auth`
69
+ Authenticate with MagicAppDev services.
70
+
71
+ ```bash
72
+ magicappdev auth
73
+ ```
74
+
75
+ ### `chat`
76
+ Start an interactive chat session for app creation and management.
77
+
78
+ ```bash
79
+ magicappdev chat
80
+ ```
81
+
82
+ ### `generate`
83
+ Generate components, apps, or other resources.
84
+
85
+ ```bash
86
+ # Generate a new component
87
+ magicappdev generate component my-component
88
+
89
+ # Generate a new app
90
+ magicappdev generate app my-app
91
+ ```
92
+
93
+ ### `doctor`
94
+ Run diagnostics to check your project setup and configuration.
95
+
96
+ ```bash
97
+ magicappdev doctor
98
+ ```
99
+
100
+ ## Configuration
101
+
102
+ ### Environment Variables
103
+
104
+ You can configure the CLI using environment variables in a `.env` file:
105
+
106
+ ```env
107
+ MAGICAPPDEV_API_KEY=your_api_key_here
108
+ MAGICAPPDEV_PROJECT_DIR=./my-project
109
+ ```
110
+
111
+ ### Config File
112
+
113
+ The CLI can also be configured using a `magicappdev.config.json` file:
114
+
115
+ ```json
116
+ {
117
+ "apiKey": "your_api_key_here",
118
+ "projectDir": "./my-project",
119
+ "defaultTemplate": "web"
120
+ }
121
+ ```
122
+
123
+ ## Features
124
+
125
+ - **Project Initialization**: Quickly set up new MagicAppDev projects.
126
+ - **Authentication**: Securely authenticate with MagicAppDev services.
127
+ - **Interactive Chat**: Use AI-powered chat for app creation and management.
128
+ - **Code Generation**: Generate components, apps, and other resources.
129
+ - **Diagnostics**: Run diagnostics to ensure your project is set up correctly.
130
+
131
+ ## Development
132
+
133
+ ### Prerequisites
134
+
135
+ - Node.js (v18 or higher)
136
+ - pnpm (v8 or higher)
137
+
138
+ ### Setup
139
+
140
+ 1. Clone the repository:
141
+
142
+ ```bash
143
+ git clone https://github.com/magicappdev/magicappdev.git
144
+ cd magicappdev
145
+ ```
146
+
147
+ 2. Install dependencies:
148
+
149
+ ```bash
150
+ pnpm install
151
+ ```
152
+
153
+ 3. Build the CLI:
154
+
155
+ ```bash
156
+ cd packages/cli
157
+ pnpm run build
158
+ ```
159
+
160
+ 4. Link the CLI for local development:
161
+
162
+ ```bash
163
+ pnpm link --global
164
+ ```
165
+
166
+ ### Running Tests
167
+
168
+ To run tests for the CLI:
169
+
170
+ ```bash
171
+ pnpm run test
172
+ ```
173
+
174
+ ## License
175
+
176
+ MagicAppDev CLI is licensed under the [MIT License](LICENSE).
177
+
178
+ ## Contributing
179
+
180
+ We welcome contributions! Please see our [Contributing Guidelines](CONTRIBUTING.md) for more details.
181
+
182
+ ## Troubleshooting
183
+
184
+ ### Common Issues
185
+
186
+ - **Command Not Found**: Ensure the CLI is installed globally and your PATH is set correctly.
187
+ - **Authentication Errors**: Verify your API key and environment variables.
188
+ - **Build Errors**: Check your Node.js and pnpm versions and ensure all dependencies are installed.
189
+
190
+ ### FAQ
191
+
192
+ **Q: How do I update the CLI?**
193
+
194
+ A: Run `pnpm update -g @magicappdev/cli` to update to the latest version.
195
+
196
+ **Q: Can I use the CLI with npm or yarn?**
197
+
198
+ A: Yes, you can install the CLI using npm or yarn, but pnpm is recommended for optimal performance.
199
+
200
+ **Q: How do I report a bug?**
201
+
202
+ A: Please open an issue on our [GitHub repository](https://github.com/magicappdev/magicappdev/issues).
package/dist/cli.js CHANGED
@@ -4,8 +4,8 @@
4
4
  import { generateCommand } from "./commands/generate/index.js";
5
5
  import { doctorCommand } from "./commands/doctor.js";
6
6
  import { initCommand } from "./commands/init.js";
7
- import { authCommand } from "./commands/auth.js";
8
7
  import { chatCommand } from "./commands/chat.js";
8
+ import { authCommand } from "./commands/auth.js";
9
9
  import { createRequire } from "module";
10
10
  import { Command } from "commander";
11
11
  const require = createRequire(import.meta.url);
@@ -1 +1 @@
1
- {"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../src/commands/chat.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAcpC,eAAO,MAAM,WAAW,SA8BpB,CAAC"}
1
+ {"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../src/commands/chat.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAapC,eAAO,MAAM,WAAW,SA8BpB,CAAC"}
@@ -3,8 +3,8 @@
3
3
  */
4
4
  import { header, logo, info } from "../lib/ui.js";
5
5
  import { AgentClient } from "agents/client";
6
- import { Command } from "commander";
7
6
  import { AGENT_HOST } from "../lib/api.js";
7
+ import { Command } from "commander";
8
8
  import prompts from "prompts";
9
9
  import chalk from "chalk";
10
10
  import ora from "ora";
@@ -1,6 +1,6 @@
1
1
  import { mkdir, readFile, writeFile } from "node:fs/promises";
2
- import { join } from "node:path";
3
2
  import { homedir } from "node:os";
3
+ import { join } from "node:path";
4
4
  const CONFIG_DIR = join(homedir(), ".magicappdev");
5
5
  const CONFIG_FILE = join(CONFIG_DIR, "config.json");
6
6
  export async function saveConfig(config) {
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@magicappdev/cli",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "description": "CLI tool for creating and managing MagicAppDev apps",
5
+ "keywords": ["cli","MagicAppDev","app-dev","mobile","react-native"],
5
6
  "type": "module",
6
7
  "main": "./dist/index.js",
7
8
  "types": "./dist/index.d.ts",
@@ -26,22 +27,22 @@
26
27
  "@magicappdev/templates": "workspace:*",
27
28
  "agents": "^0.3.6",
28
29
  "chalk": "^5.4.0",
29
- "commander": "^13.0.0",
30
+ "commander": "^14.0.2",
30
31
  "execa": "^9.5.0",
31
32
  "open": "^11.0.0",
32
- "ora": "^8.1.0",
33
+ "ora": "^9.1.0",
33
34
  "prompts": "^2.4.0",
34
35
  "tslib": "^2.3.0",
35
36
  "ws": "^8.18.0"
36
37
  },
37
38
  "devDependencies": {
38
- "@types/node": "^25.0.0",
39
+ "@types/node": "^25.0.10",
39
40
  "@types/prompts": "^2.4.0",
40
41
  "@types/ws": "^8.5.10",
41
42
  "eslint": "^9.39.2",
42
43
  "eslint-config-prettier": "^10.1.8",
43
44
  "tsx": "^4.19.0",
44
- "typescript": "~5.8.2",
45
+ "typescript": "~5.9.3",
45
46
  "typescript-eslint": "^8.53.1"
46
47
  }
47
48
  }