@base44-preview/cli 0.0.14-pr.93.54ecdc1 → 0.0.15-pr.102.d2fdfed

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 CHANGED
@@ -1,76 +1,263 @@
1
1
  # Base44 CLI
2
2
 
3
- Command-line interface for building applications with [Base44's backend service](https://docs.base44.com/developers/backend/overview/introduction).
3
+ A unified command-line interface for managing Base44 applications, entities, functions, deployments, and related services.
4
4
 
5
- Base44's backend service provides a managed backend for your applications — data storage with entities, serverless functions, authentication, and hosting. The CLI lets you:
6
-
7
- - **Create projects** from templates (backend-only or full-stack React)
8
- - **Sync** entities and functions defined in local code with your Base44 backend
9
- - **Deploy sites** to Base44's hosting platform
10
-
11
- To get started, see the full list of commands below or check out the [documentation](https://docs.base44.com/developers/references/cli/get-started/overview).
5
+ **Zero dependencies** - installs in seconds with no dependency resolution.
12
6
 
13
7
  ## Installation
14
8
 
15
9
  ```bash
10
+ # Using npm (globally)
16
11
  npm install -g base44
17
- ```
18
12
 
19
- Or run commands directly with npx:
20
-
21
- ```bash
13
+ # Or run directly with npx
22
14
  npx base44 <command>
23
15
  ```
24
16
 
25
- Requires Node.js 20.19.0 or higher.
26
-
27
- ## Quick start
17
+ ## Quick Start
28
18
 
29
19
  ```bash
30
- # Authenticate
20
+ # 1. Login to Base44
31
21
  base44 login
32
22
 
33
- # Create a project
23
+ # 2. Create a new project
34
24
  base44 create
25
+
26
+ # 3. Deploy everything (entities, functions, and site)
27
+ npm run build
28
+ base44 deploy
35
29
  ```
36
30
 
37
- The CLI will guide you through project setup. For step-by-step tutorials, see the quickstart guides:
31
+ ## Commands
38
32
 
39
- - [Backend only](https://docs.base44.com/developers/backend/quickstart/quickstart-backend-only) — for headless apps or custom frontends
40
- - [React](https://docs.base44.com/developers/backend/quickstart/quickstart-with-react) — full-stack with Vite + React
33
+ ### Authentication
41
34
 
42
- ## Commands
35
+ | Command | Description |
36
+ |---------|-------------|
37
+ | `base44 login` | Authenticate with Base44 using device code flow |
38
+ | `base44 whoami` | Display current authenticated user |
39
+ | `base44 logout` | Logout from current device |
40
+
41
+ ### Project Management
42
+
43
+ | Command | Description |
44
+ |---------|-------------|
45
+ | `base44 create` | Create a new Base44 project from a template |
46
+ | `base44 link` | Link an existing local project to Base44 |
47
+ | `base44 dashboard` | Open the app dashboard in your browser |
48
+
49
+ ### Deployment
50
+
51
+ | Command | Description |
52
+ |---------|-------------|
53
+ | `base44 deploy` | Deploy all resources (entities, functions, and site) |
54
+
55
+ ### Entities
56
+
57
+ | Command | Description |
58
+ |---------|-------------|
59
+ | `base44 entities push` | Push local entity schemas to Base44 |
60
+
61
+ ### Functions
62
+
63
+ | Command | Description |
64
+ |---------|-------------|
65
+ | `base44 functions deploy` | Deploy local functions to Base44 |
66
+
67
+ ### Site
43
68
 
44
69
  | Command | Description |
45
- | ------- | ----------- |
46
- | [`create`](https://docs.base44.com/developers/references/cli/commands/create) | Create a new Base44 project from a template |
47
- | [`link`](https://docs.base44.com/developers/references/cli/commands/link) | Link a local project to a project on Base44 |
48
- | [`dashboard`](https://docs.base44.com/developers/references/cli/commands/dashboard) | Open the app dashboard in your browser |
49
- | [`login`](https://docs.base44.com/developers/references/cli/commands/login) | Authenticate with Base44 |
50
- | [`logout`](https://docs.base44.com/developers/references/cli/commands/logout) | Sign out and clear stored credentials |
51
- | [`whoami`](https://docs.base44.com/developers/references/cli/commands/whoami) | Display the current authenticated user |
52
- | [`entities push`](https://docs.base44.com/developers/references/cli/commands/entities-push) | Push local entity schemas to Base44 |
53
- | [`functions deploy`](https://docs.base44.com/developers/references/cli/commands/functions-deploy) | Deploy local functions to Base44 |
54
- | [`site deploy`](https://docs.base44.com/developers/references/cli/commands/site-deploy) | Deploy built site files to Base44 hosting |
55
-
56
- ## Help
70
+ |---------|-------------|
71
+ | `base44 site deploy` | Deploy built site files to Base44 hosting |
72
+
73
+ ### Types
74
+
75
+ | Command | Description |
76
+ |---------|-------------|
77
+ | `base44 types` | Generate TypeScript types from entity schemas |
78
+
79
+ **Options:**
80
+ - `-o, --output <dir>` - Output directory (default: `src/base44`)
81
+ - `--entities-only` - Only generate entity types, skip client types
82
+
83
+ ## TypeScript Type Generation
84
+
85
+ Generate fully-typed interfaces from your entity schemas for type-safe SDK usage.
86
+
87
+ ### Usage
88
+
89
+ ```bash
90
+ # Generate types (outputs to src/base44/)
91
+ base44 types
92
+
93
+ # Custom output directory
94
+ base44 types --output ./types
95
+ ```
96
+
97
+ ### Generated Files
98
+
99
+ | File | Contents |
100
+ |------|----------|
101
+ | `entities.ts` | Entity interfaces, CreateInput, UpdateInput, Filter types |
102
+ | `client.ts` | Typed SDK client interface |
103
+ | `index.ts` | Barrel exports |
104
+
105
+ ### Setup with @base44/sdk
106
+
107
+ 1. Generate types:
108
+ ```bash
109
+ base44 types
110
+ ```
111
+
112
+ 2. Add to `tsconfig.json`:
113
+ ```json
114
+ {
115
+ "include": ["src", "src/base44/entities.ts"]
116
+ }
117
+ ```
118
+
119
+ 3. Use in your code:
120
+ ```typescript
121
+ import { createClient } from '@base44/sdk';
122
+ import type { TypedBase44Client } from './base44/client';
123
+
124
+ const base44 = createClient({ appId: 'my-app' }) as TypedBase44Client;
125
+
126
+ // Fully typed!
127
+ const { items: tasks } = await base44.entities.Task.list();
128
+ await base44.entities.Task.create({ title: 'Buy milk' });
129
+ ```
130
+
131
+ ### Example
132
+
133
+ Given an entity schema:
134
+ ```jsonc
135
+ // base44/entities/task.jsonc
136
+ {
137
+ "name": "Task",
138
+ "type": "object",
139
+ "properties": {
140
+ "title": { "type": "string", "description": "Task title" },
141
+ "completed": { "type": "boolean", "default": false }
142
+ },
143
+ "required": ["title"]
144
+ }
145
+ ```
146
+
147
+ Generated types:
148
+ ```typescript
149
+ export interface Task extends BaseEntity {
150
+ title: string;
151
+ completed?: boolean;
152
+ }
153
+
154
+ export interface TaskCreateInput {
155
+ title: string;
156
+ completed?: boolean;
157
+ }
158
+ ```
159
+
160
+ ## Configuration
161
+
162
+ ### Project Configuration
163
+
164
+ Base44 projects are configured via a `config.jsonc` (or `config.json`) file in the `base44/` subdirectory:
165
+
166
+ ```jsonc
167
+ // base44/config.jsonc
168
+ {
169
+ "name": "My Project",
170
+ "entitiesDir": "./entities", // Default: ./entities
171
+ "functionsDir": "./functions", // Default: ./functions
172
+ "site": {
173
+ "outputDirectory": "../dist" // Path to built site files
174
+ }
175
+ }
176
+ ```
177
+
178
+ ### App Configuration
179
+
180
+ Your app ID is stored in a `.app.jsonc` file in the `base44/` directory. This file is created automatically when you run `base44 create` or `base44 link`:
181
+
182
+ ```jsonc
183
+ // base44/.app.jsonc
184
+ {
185
+ "id": "your-app-id"
186
+ }
187
+ ```
188
+
189
+ ## Project Structure
190
+
191
+ A typical Base44 project has this structure:
192
+
193
+ ```
194
+ my-project/
195
+ ├── base44/
196
+ │ ├── config.jsonc # Project configuration
197
+ │ ├── .app.jsonc # App ID (git-ignored)
198
+ │ ├── entities/ # Entity schema files
199
+ │ │ ├── user.jsonc
200
+ │ │ └── product.jsonc
201
+ │ └── functions/ # Backend functions
202
+ │ └── my-function/
203
+ │ ├── config.jsonc
204
+ │ └── index.js
205
+ ├── src/
206
+ │ ├── base44/ # Generated types (from `base44 types`)
207
+ │ │ ├── entities.ts
208
+ │ │ ├── client.ts
209
+ │ │ └── index.ts
210
+ │ └── ... # Your frontend code
211
+ ├── dist/ # Built site files (for deployment)
212
+ └── package.json
213
+ ```
214
+
215
+ ## Development
216
+
217
+ ### Prerequisites
218
+
219
+ - Node.js >= 20.19.0
220
+ - npm
221
+
222
+ ### Setup
57
223
 
58
224
  ```bash
59
- base44 --help
60
- base44 <command> --help
225
+ # Clone the repository
226
+ git clone https://github.com/base44/cli.git
227
+ cd cli
228
+
229
+ # Install dependencies
230
+ npm install
231
+
232
+ # Build
233
+ npm run build
234
+
235
+ # Run in development mode
236
+ npm run dev -- <command>
61
237
  ```
62
238
 
63
- ## Version
239
+ ### Available Scripts
64
240
 
65
241
  ```bash
66
- base44 --version
242
+ npm run build # Build with tsdown
243
+ npm run typecheck # Type check with tsc
244
+ npm run dev # Run in development mode with tsx
245
+ npm run lint # Lint with ESLint
246
+ npm test # Run tests with Vitest
67
247
  ```
68
248
 
69
- ## Alpha
249
+ ### Running the Built CLI
250
+
251
+ ```bash
252
+ # After building
253
+ npm start -- <command>
70
254
 
71
- The CLI and Base44 backend service are currently in alpha. We're actively improving them based on user feedback. Share your thoughts and feature requests on our [feedback board](https://feedback.base44.com/roadmap).
255
+ # Or directly
256
+ ./dist/cli/index.js <command>
257
+ ```
258
+ ## Contributing
72
259
 
73
- Found a bug? [Open an issue](https://github.com/base44/cli/issues).
260
+ See [AGENTS.md](./AGENTS.md) for development guidelines and architecture documentation.
74
261
 
75
262
  ## License
76
263