playcademy 0.1.0

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,293 @@
1
+ # playcademy
2
+
3
+ The official command-line interface for Playcademy - deploy and share your educational games with ease.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ bun add -g playcademy
9
+ ```
10
+
11
+ Or run directly with bunx:
12
+
13
+ ```bash
14
+ bunx playcademy <command>
15
+ ```
16
+
17
+ ## Quick Start
18
+
19
+ ```bash
20
+ # Authenticate with Playcademy
21
+ playcademy login
22
+
23
+ # Initialize configuration
24
+ playcademy init
25
+
26
+ # Deploy your game
27
+ playcademy deploy
28
+ ```
29
+
30
+ ## Commands
31
+
32
+ ### Authentication
33
+
34
+ #### `login`
35
+
36
+ Authenticate with your Playcademy account via SSO or email/password.
37
+
38
+ ```bash
39
+ playcademy login
40
+ playcademy login --sso # Browser-based SSO
41
+ playcademy login --profile work # Save to named profile
42
+ ```
43
+
44
+ #### `logout`
45
+
46
+ Remove stored credentials.
47
+
48
+ ```bash
49
+ playcademy logout
50
+ playcademy logout --profile work
51
+ ```
52
+
53
+ #### `me`
54
+
55
+ Display current user information.
56
+
57
+ ```bash
58
+ playcademy me
59
+ ```
60
+
61
+ #### `profiles`
62
+
63
+ Manage authentication profiles.
64
+
65
+ ```bash
66
+ playcademy profiles list # List all profiles
67
+ playcademy profiles remove <name>
68
+ playcademy profiles reset # Remove all profiles
69
+ ```
70
+
71
+ ### Developer Access
72
+
73
+ #### `dev apply`
74
+
75
+ Apply for developer status to create and deploy games.
76
+
77
+ ```bash
78
+ playcademy dev apply
79
+ ```
80
+
81
+ #### `dev status`
82
+
83
+ Check your current developer status.
84
+
85
+ ```bash
86
+ playcademy dev status
87
+ ```
88
+
89
+ ### Games
90
+
91
+ #### `games list`
92
+
93
+ List all your games.
94
+
95
+ ```bash
96
+ playcademy games list
97
+ ```
98
+
99
+ #### `games delete`
100
+
101
+ Delete a game.
102
+
103
+ ```bash
104
+ playcademy games delete <slug>
105
+ playcademy games delete # Interactive selection
106
+ playcademy games delete my-game -f # Skip confirmation
107
+ ```
108
+
109
+ ### Deployment
110
+
111
+ #### `init`
112
+
113
+ Initialize a configuration file in your project.
114
+
115
+ ```bash
116
+ playcademy init
117
+ ```
118
+
119
+ Creates `playcademy.config.js` (or `.json`) with your game settings.
120
+
121
+ #### `deploy`
122
+
123
+ Deploy your game to Playcademy.
124
+
125
+ ```bash
126
+ playcademy deploy
127
+ playcademy deploy --env staging # Deploy to staging
128
+ playcademy deploy --backend # Include API routes
129
+ playcademy deploy --no-backend # Skip API routes
130
+ playcademy deploy --dry-run # Validate without deploying
131
+ playcademy deploy --debug # Show debug info
132
+ ```
133
+
134
+ **Options:**
135
+
136
+ - `-c, --config <path>` - Configuration file (`playcademy.config.js` or `.json`)
137
+ - `-n, --name <name>` - Display name
138
+ - `-d, --description <desc>` - Description
139
+ - `-e, --emoji <emoji>` - Emoji icon
140
+ - `-b, --build <path>` - Path to frontend zip file
141
+ - `-u, --external-url <url>` - External URL for external games
142
+ - `--env <env>` - Environment (`production` or `staging`)
143
+ - `--backend` - Deploy API routes
144
+ - `--no-backend` - Skip API routes
145
+ - `--dry-run` - Validate only
146
+ - `--verbose` - Show detailed output
147
+ - `--debug` - Show debug information
148
+
149
+ **Configuration:**
150
+
151
+ Create `playcademy.config.js`:
152
+
153
+ ```js
154
+ export default {
155
+ name: 'My Awesome Game',
156
+ description: 'A fun puzzle game',
157
+ emoji: '🎮',
158
+ buildPath: './dist/game.zip',
159
+ }
160
+ ```
161
+
162
+ Or `playcademy.config.json`:
163
+
164
+ ```json
165
+ {
166
+ "name": "My Awesome Game",
167
+ "description": "A fun puzzle game",
168
+ "emoji": "🎮",
169
+ "buildPath": "./dist/game.zip"
170
+ }
171
+ ```
172
+
173
+ **Backend API Routes:**
174
+
175
+ Add custom API routes by creating an `api/` directory:
176
+
177
+ ```
178
+ my-game/
179
+ ├── playcademy.config.js
180
+ ├── dist/
181
+ │ └── game.zip
182
+ └── api/
183
+ └── hello.ts # GET /api/hello
184
+ ```
185
+
186
+ Backend routes are:
187
+
188
+ - ✅ Automatically deployed for hosted games
189
+ - ⊘ Opt-in for external games (use `--backend` flag)
190
+
191
+ ## Authentication
192
+
193
+ Credentials are stored in `~/.playcademy/auth.json`:
194
+
195
+ ```json
196
+ {
197
+ "default": {
198
+ "token": "YOUR_TOKEN",
199
+ "userId": "user_123",
200
+ "email": "user@example.com",
201
+ "expiresAt": "2024-12-31T23:59:59Z"
202
+ },
203
+ "profiles": {
204
+ "work": {
205
+ "token": "WORK_TOKEN",
206
+ "userId": "user_123",
207
+ "email": "user@example.com",
208
+ "expiresAt": "2024-12-31T23:59:59Z"
209
+ }
210
+ }
211
+ }
212
+ ```
213
+
214
+ ### TimeBack Integration
215
+
216
+ #### `timeback setup`
217
+
218
+ Set up TimeBack LTI integration for your game.
219
+
220
+ ```bash
221
+ playcademy timeback setup
222
+ playcademy timeback setup --dry-run
223
+ ```
224
+
225
+ #### `timeback verify`
226
+
227
+ Verify TimeBack resources are correctly configured.
228
+
229
+ ```bash
230
+ playcademy timeback verify
231
+ ```
232
+
233
+ #### `timeback update`
234
+
235
+ Update TimeBack integration configuration.
236
+
237
+ ```bash
238
+ playcademy timeback update
239
+ ```
240
+
241
+ #### `timeback cleanup`
242
+
243
+ Remove TimeBack integration (keeps game metadata).
244
+
245
+ ```bash
246
+ playcademy timeback cleanup
247
+ ```
248
+
249
+ ## Environment Variables
250
+
251
+ - `PLAYCADEMY_ENV` - Environment: `staging` or `production` (default: `production`)
252
+ - `PLAYCADEMY_BASE_URL` - Override API endpoint (default: based on `PLAYCADEMY_ENV`)
253
+ - `PLAYCADEMY_PROFILE` - Authentication profile to use (default: `default`)
254
+
255
+ **Example:**
256
+
257
+ ```bash
258
+ # Deploy to staging
259
+ PLAYCADEMY_ENV=staging playcademy deploy
260
+
261
+ # Use specific profile
262
+ PLAYCADEMY_PROFILE=work playcademy deploy
263
+
264
+ # Custom environment
265
+ PLAYCADEMY_BASE_URL=http://localhost:5174 playcademy deploy
266
+ ```
267
+
268
+ ## Configuration Files
269
+
270
+ The CLI supports multiple configuration formats:
271
+
272
+ - `playcademy.config.js` (ES modules)
273
+ - `playcademy.config.json` (JSON)
274
+ - `playcademy.config.mjs` (ES modules)
275
+
276
+ Priority: CLI flags > config file > interactive prompts
277
+
278
+ ## Architecture
279
+
280
+ Built with:
281
+
282
+ - **Commander.js** - Command parsing
283
+ - **@inquirer/prompts** - Interactive prompts
284
+ - **Colorette** - Terminal styling
285
+ - **esbuild** - Bundling (for encoding compatibility)
286
+
287
+ ## Contributing
288
+
289
+ See the main [CONTRIBUTING.md](../../CONTRIBUTING.md) for guidelines.
290
+
291
+ ## License
292
+
293
+ MIT