onflyt-cli 1.0.1-beta.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.
Files changed (3) hide show
  1. package/README.md +338 -0
  2. package/dist/index.js +13426 -0
  3. package/package.json +64 -0
package/README.md ADDED
@@ -0,0 +1,338 @@
1
+ <p align="center">
2
+ <svg width="128" height="128" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
3
+ <path d="M12 3L18 7V13L12 17L6 13V7L12 3Z" stroke="#f59e0b" stroke-width="2" opacity="0.4"/>
4
+ <path d="M12 8L17 11V16L12 19L7 16V11L12 8Z" stroke="#f59e0b" stroke-width="2.5" fill="#f59e0b" fill-opacity="0.1"/>
5
+ <circle cx="12" cy="12" r="2" fill="#f59e0b"/>
6
+ </svg>
7
+ </p>
8
+
9
+ <h1 align="center">Onflyt CLI</h1>
10
+
11
+ <p align="center">
12
+ <img src="https://img.shields.io/npm/v/onflyt?style=flat-square" alt="npm version">
13
+ <img src="https://img.shields.io/node/v/onflyt?style=flat-square" alt="node version">
14
+ <img src="https://img.shields.io/npm/dm/onflyt?style=flat-square" alt="downloads">
15
+ <img src="https://img.shields.io/github/license/miiglu/onflyt?style=flat-square" alt="license">
16
+ <img src="https://img.shields.io/badge/TypeScript-007ACC?style=flat-square&logo=typescript&logoColor=white" alt="TypeScript">
17
+ <img src="https://img.shields.io/badge/React-61DAFB?style=flat-square&logo=react&logoColor=black" alt="React">
18
+ <img src="https://img.shields.io/badge/Ink-Cli-ff69b4?style=flat-square" alt="Ink CLI">
19
+ <img src="https://img.shields.io/badge/Cloudflare-F38020?style=flat-square&logo=cloudflare&logoColor=white" alt="Cloudflare">
20
+ <img src="https://img.shields.io/badge/Beta-FFA500?style=flat-square" alt="Beta">
21
+ <img src="https://img.shields.io/badge/Node.js-339933?style=flat-square&logo=node.js&logoColor=white" alt="Node.js">
22
+ </p>
23
+
24
+ ## What is Onflyt?
25
+
26
+ Onflyt is the best platform for deploying Node.js and Python APIs. Deploy your APIs on a stateful serverless pod. Pay only per use - no subscription required.
27
+
28
+ - **Serverless pods** - Secure, isolated pods that survive hibernation
29
+ - **Pay per use** - Only pay for what you deploy, no subscriptions
30
+ - **Global edge network** - 280+ cities for instant global deployment
31
+
32
+ ## Features
33
+
34
+ - **Quick Deployments** - Deploy projects with a single command
35
+ - **GitHub OAuth** - Secure authentication via GitHub
36
+ - **Login & Manage** - Login to manage your applications from the CLI
37
+ - **AI Agent Templates** - Deploy AI agents and LLM-powered backends
38
+ - **Multi-Project Management** - Manage multiple projects across teams
39
+ - **Real-time Logs** - Stream live deployment logs
40
+ - **Rollback Support** - Revert to previous deployments instantly
41
+ - **Team Billing** - Track credits and manage team resources
42
+
43
+ ## Installation
44
+
45
+ ### Prerequisites
46
+
47
+ - Node.js 18 or higher
48
+ - npm, yarn, pnpm, or bun
49
+
50
+ ### Install via npm
51
+
52
+ ```bash
53
+ npm install -g onflyt
54
+ ```
55
+
56
+ ### Install via other package managers
57
+
58
+ ```bash
59
+ # Using yarn
60
+ yarn global add onflyt
61
+
62
+ # Using pnpm
63
+ pnpm add -g onflyt
64
+
65
+ # Using bun
66
+ bun add -g onflyt
67
+ ```
68
+
69
+ ## Quick Start
70
+
71
+ ```bash
72
+ # 1. Authenticate with your account
73
+ onflyt login
74
+
75
+ # 2. Initialize a project in your current directory
76
+ onflyt init
77
+
78
+ # 3. Deploy your project
79
+ onflyt deploy
80
+ ```
81
+
82
+ That's it! Your project is now live on onflyt.
83
+
84
+ ## Authentication
85
+
86
+ Onflyt uses GitHub OAuth for secure authentication.
87
+
88
+ ```bash
89
+ # Login to your account
90
+ onflyt login
91
+
92
+ # Check who you're logged in as
93
+ onflyt whoami
94
+
95
+ # Logout when you're done
96
+ onflyt logout
97
+ ```
98
+
99
+ ## Commands
100
+
101
+ ### Project Management
102
+
103
+ #### `onflyt init`
104
+
105
+ Initialize a new project in the current directory.
106
+
107
+ ```bash
108
+ # Interactive initialization
109
+ onflyt init
110
+
111
+ # With flags for quick setup
112
+ onflyt init --name my-app --framework nextjs --yes
113
+
114
+ # Available options:
115
+ # --name <name> Project name
116
+ # --template <id> Template (blank, nextjs, react-vite, etc.)
117
+ # --framework <fw> Framework (nextjs, react, node, etc.)
118
+ # --package-manager <pm> Package manager (npm, bun, yarn, pnpm)
119
+ # --git Connect Git repository
120
+ # --no-git Skip Git connection
121
+ # -y, --yes Skip all prompts
122
+ ```
123
+
124
+ #### `onflyt deploy`
125
+
126
+ Deploy your project to Onflyt cloud infrastructure.
127
+
128
+ ```bash
129
+ # Interactive deployment
130
+ onflyt deploy
131
+
132
+ # Deploy to specific team
133
+ onflyt deploy --team tm_xxxxxxxxxxxx
134
+ ```
135
+
136
+ #### `onflyt projects`
137
+
138
+ List and manage your projects.
139
+
140
+ ```bash
141
+ onflyt projects
142
+ ```
143
+
144
+ #### `onflyt delete`
145
+
146
+ Delete a project.
147
+
148
+ ```bash
149
+ onflyt delete
150
+ ```
151
+
152
+ ### Deployment Management
153
+
154
+ #### `onflyt logs`
155
+
156
+ View deployment logs.
157
+
158
+ ```bash
159
+ # View stored logs
160
+ onflyt logs <deployment-id>
161
+
162
+ # Stream live logs
163
+ onflyt logs <deployment-id> --live
164
+ # or
165
+ onflyt logs <deployment-id> -l
166
+ ```
167
+
168
+ #### `onflyt deployments`
169
+
170
+ List deployments for a project.
171
+
172
+ ```bash
173
+ onflyt deployments
174
+ ```
175
+
176
+ #### `onflyt rollback`
177
+
178
+ Rollback to a previous deployment.
179
+
180
+ ```bash
181
+ onflyt rollback
182
+ ```
183
+
184
+ ### Team & Billing
185
+
186
+ #### `onflyt teams`
187
+
188
+ List your teams.
189
+
190
+ ```bash
191
+ onflyt teams
192
+ ```
193
+
194
+ #### `onflyt credits`
195
+
196
+ Check credits balance for your teams.
197
+
198
+ ```bash
199
+ onflyt credits
200
+ ```
201
+
202
+ ## Global Options
203
+
204
+ | Option | Description |
205
+ | ----------------- | -------------------------------- |
206
+ | `-h, --help` | Show help information |
207
+ | `-v, --version` | Show version number |
208
+ | `-t, --team <id>` | Target specific team |
209
+ | `--no-open` | Don't auto-open browser on login |
210
+
211
+ ## Keyboard Shortcuts
212
+
213
+ When using interactive commands:
214
+
215
+ | Key | Action |
216
+ | --------- | ------------------ |
217
+ | `↑` / `↓` | Navigate selection |
218
+ | `Enter` | Select / Confirm |
219
+ | `Esc` | Go back / Cancel |
220
+ | `Q` | Quit |
221
+ | `Ctrl+C` | Quit |
222
+
223
+ ## Configuration
224
+
225
+ ### Project Configuration (`onflyt.json`)
226
+
227
+ Created automatically by `onflyt init`:
228
+
229
+ ```json
230
+ {
231
+ "name": "my-project",
232
+ "framework": "nextjs",
233
+ "team": "team_xxx"
234
+ }
235
+ ```
236
+
237
+ ### Credentials
238
+
239
+ Credentials are stored in `~/.onflyt/config.json`.
240
+
241
+ ## Examples
242
+
243
+ ### Deploy a Next.js project
244
+
245
+ ```bash
246
+ onflyt init --name my-next-app --framework nextjs --yes
247
+ cd my-next-app
248
+ # Add your code...
249
+ onflyt deploy
250
+ ```
251
+
252
+ ### Deploy with specific team
253
+
254
+ ```bash
255
+ onflyt deploy --team tm_xxxxxxxxxxxx
256
+ ```
257
+
258
+ ### Monitor live logs
259
+
260
+ ```bash
261
+ onflyt logs dep_xxxxxxxxxxxx --live
262
+ ```
263
+
264
+ ### Quick project initialization
265
+
266
+ ```bash
267
+ onflyt init --name my-app --framework react-vite --package-manager pnpm --yes
268
+ ```
269
+
270
+ ## Troubleshooting
271
+
272
+ ### Login issues
273
+
274
+ If you encounter login issues:
275
+
276
+ 1. Make sure GitHub is accessible
277
+ 2. Check your internet connection
278
+ 3. Try logging out and back in: `onflyt logout && onflyt login`
279
+
280
+ ### Deployment fails
281
+
282
+ 1. Check your credits balance: `onflyt credits`
283
+ 2. Verify your project configuration in `onflyt.json`
284
+ 3. View deployment logs: `onflyt logs <deployment-id>`
285
+
286
+ ### Command not found
287
+
288
+ If `onflyt` is not found after installation:
289
+
290
+ 1. Make sure npm global bin is in your PATH
291
+ 2. Try reinstalling: `npm install -g onflyt`
292
+
293
+ ## Development
294
+
295
+ ### Building from source
296
+
297
+ ```bash
298
+ # Clone the repository
299
+ git clone https://github.com/miiglu/onflyt.git
300
+ cd onflyt/services/cli
301
+
302
+ # Install dependencies
303
+ pnpm install
304
+
305
+ # Build
306
+ pnpm build
307
+
308
+ # Run locally
309
+ pnpm start
310
+ ```
311
+
312
+ ### Architecture
313
+
314
+ The CLI is built with:
315
+
316
+ - [Ink](https://github.com/vadimdemedes/ink) - React for CLIs
317
+ - [React](https://react.dev) - UI components
318
+ - [TypeScript](https://www.typescriptlang.org) - Type safety
319
+
320
+ ## Contributing
321
+
322
+ Contributions are welcome! Please feel free to submit a Pull Request.
323
+
324
+ ## License
325
+
326
+ MIT License - see [LICENSE](LICENSE) for details.
327
+
328
+ ## Support
329
+
330
+ - [Documentation](https://docs.onflyt.com/cli)
331
+ - [Website](https://onflyt.com)
332
+ - [Issues](https://github.com/miiglu/onflyt-cli/issues)
333
+
334
+ ---
335
+
336
+ <p align="center">
337
+ Built by <a href="https://miiglu.com">Miiglu</a>
338
+ </p>