onflyt-cli 1.0.1-beta.2 → 1.0.1-beta.3

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.

Potentially problematic release.


This version of onflyt-cli might be problematic. Click here for more details.

Files changed (67) hide show
  1. package/dist/App.d.ts +3 -0
  2. package/dist/App.js +8 -0
  3. package/dist/commands/credits.d.ts +3 -0
  4. package/dist/commands/credits.js +101 -0
  5. package/dist/commands/delete.d.ts +7 -0
  6. package/dist/commands/delete.js +220 -0
  7. package/dist/commands/deploy.d.ts +6 -0
  8. package/dist/commands/deploy.js +715 -0
  9. package/dist/commands/deployments.d.ts +6 -0
  10. package/dist/commands/deployments.js +225 -0
  11. package/dist/commands/help.d.ts +3 -0
  12. package/dist/commands/help.js +76 -0
  13. package/dist/commands/init.d.ts +11 -0
  14. package/dist/commands/init.js +422 -0
  15. package/dist/commands/login.d.ts +6 -0
  16. package/dist/commands/login.js +150 -0
  17. package/dist/commands/logout.d.ts +3 -0
  18. package/dist/commands/logout.js +19 -0
  19. package/dist/commands/logs.d.ts +7 -0
  20. package/dist/commands/logs.js +307 -0
  21. package/dist/commands/projects.d.ts +3 -0
  22. package/dist/commands/projects.js +203 -0
  23. package/dist/commands/rollback.d.ts +6 -0
  24. package/dist/commands/rollback.js +316 -0
  25. package/dist/commands/teams.d.ts +3 -0
  26. package/dist/commands/teams.js +81 -0
  27. package/dist/commands/whoami.d.ts +3 -0
  28. package/dist/commands/whoami.js +34 -0
  29. package/dist/components/Loading.d.ts +13 -0
  30. package/dist/components/Loading.js +42 -0
  31. package/dist/index.d.ts +1 -0
  32. package/dist/index.js +77 -116
  33. package/dist/lib/api.d.ts +27 -0
  34. package/dist/lib/api.js +109 -0
  35. package/dist/lib/config.d.ts +32 -0
  36. package/dist/lib/config.js +52 -0
  37. package/dist/lib/deploy-api.d.ts +97 -0
  38. package/dist/lib/deploy-api.js +335 -0
  39. package/dist/lib/deploy.d.ts +36 -0
  40. package/dist/lib/deploy.js +181 -0
  41. package/dist/lib/framework.d.ts +27 -0
  42. package/dist/lib/framework.js +184 -0
  43. package/dist/lib/git.d.ts +25 -0
  44. package/dist/lib/git.js +149 -0
  45. package/dist/lib/scaffold.d.ts +21 -0
  46. package/dist/lib/scaffold.js +190 -0
  47. package/dist/shared/frameworks/registry.d.ts +21 -0
  48. package/dist/shared/frameworks/registry.js +196 -0
  49. package/dist/shared/index.d.ts +4 -0
  50. package/dist/shared/index.js +4 -0
  51. package/dist/shared/limits.d.ts +16 -0
  52. package/dist/shared/limits.js +44 -0
  53. package/dist/shared/pricing.d.ts +2 -0
  54. package/dist/shared/pricing.js +7 -0
  55. package/dist/shared/templates/registry.d.ts +9 -0
  56. package/dist/shared/templates/registry.js +47 -0
  57. package/package.json +2 -3
  58. package/src/App.tsx +1 -1
  59. package/src/commands/deploy.tsx +1 -1
  60. package/src/commands/help.tsx +1 -1
  61. package/src/commands/init.tsx +1 -1
  62. package/src/commands/projects.tsx +1 -1
  63. package/src/components/Loading.tsx +1 -1
  64. package/src/index.tsx +1 -1
  65. package/src/lib/deploy-api.ts +3 -3
  66. package/src/lib/framework.ts +2 -2
  67. package/src/lib/shared.ts +350 -0
@@ -0,0 +1,196 @@
1
+ export const FRAMEWORKS = {
2
+ nextjs: {
3
+ label: "Next.js",
4
+ family: "node",
5
+ deploymentType: "container",
6
+ defaults: {
7
+ buildCommand: "next build",
8
+ installCommand: "bun install",
9
+ outputDirectory: ".next",
10
+ },
11
+ isServer: true,
12
+ },
13
+ remix: {
14
+ label: "Remix",
15
+ family: "node",
16
+ deploymentType: "container",
17
+ defaults: {
18
+ buildCommand: "bun run build",
19
+ installCommand: "bun install",
20
+ outputDirectory: "build",
21
+ },
22
+ isServer: true,
23
+ },
24
+ react: {
25
+ label: "React",
26
+ family: "node",
27
+ deploymentType: "static",
28
+ defaults: {
29
+ buildCommand: "bun run build",
30
+ installCommand: "bun install",
31
+ outputDirectory: "build",
32
+ },
33
+ isServer: false,
34
+ },
35
+ vite: {
36
+ label: "Vite",
37
+ family: "node",
38
+ deploymentType: "static",
39
+ defaults: {
40
+ buildCommand: "bun run build",
41
+ installCommand: "bun install",
42
+ outputDirectory: "dist",
43
+ },
44
+ isServer: false,
45
+ },
46
+ nuxt: {
47
+ label: "Nuxt",
48
+ family: "node",
49
+ deploymentType: "container",
50
+ defaults: {
51
+ buildCommand: "bun run build",
52
+ installCommand: "bun install",
53
+ outputDirectory: ".output",
54
+ },
55
+ isServer: true,
56
+ },
57
+ svelte: {
58
+ label: "Svelte",
59
+ family: "node",
60
+ deploymentType: "static",
61
+ defaults: {
62
+ buildCommand: "bun run build",
63
+ installCommand: "bun install",
64
+ outputDirectory: "build",
65
+ },
66
+ isServer: false,
67
+ },
68
+ node: {
69
+ label: "Node.js",
70
+ family: "node",
71
+ deploymentType: "container",
72
+ defaults: {
73
+ buildCommand: "bun run build",
74
+ installCommand: "bun install",
75
+ outputDirectory: "dist",
76
+ startCommand: "node dist/index.js",
77
+ },
78
+ isServer: true,
79
+ },
80
+ express: {
81
+ label: "Express",
82
+ family: "node",
83
+ deploymentType: "container",
84
+ defaults: {
85
+ buildCommand: "bun run build",
86
+ installCommand: "bun install",
87
+ outputDirectory: "dist",
88
+ startCommand: "node dist/index.js",
89
+ },
90
+ isServer: true,
91
+ },
92
+ hono: {
93
+ label: "Hono",
94
+ family: "node",
95
+ deploymentType: "container",
96
+ defaults: {
97
+ buildCommand: "bun run build",
98
+ installCommand: "bun install",
99
+ outputDirectory: "dist",
100
+ startCommand: "node dist/index.js",
101
+ },
102
+ isServer: true,
103
+ },
104
+ nestjs: {
105
+ label: "NestJS",
106
+ family: "node",
107
+ deploymentType: "container",
108
+ defaults: {
109
+ buildCommand: "bun run build",
110
+ installCommand: "bun install",
111
+ outputDirectory: "dist",
112
+ startCommand: "node dist/main.js",
113
+ },
114
+ isServer: true,
115
+ },
116
+ astro: {
117
+ label: "Astro",
118
+ family: "node",
119
+ deploymentType: "static",
120
+ defaults: {
121
+ buildCommand: "bun run build",
122
+ installCommand: "bun install",
123
+ outputDirectory: "dist",
124
+ },
125
+ isServer: false,
126
+ },
127
+ static: {
128
+ label: "Static Site",
129
+ family: "node",
130
+ deploymentType: "static",
131
+ defaults: {
132
+ buildCommand: "",
133
+ installCommand: "",
134
+ outputDirectory: ".",
135
+ },
136
+ isServer: false,
137
+ },
138
+ fastapi: {
139
+ label: "FastAPI",
140
+ family: "nixpacks",
141
+ deploymentType: "container",
142
+ defaults: {
143
+ buildCommand: "uv pip install --python 3.11 -r requirements.txt",
144
+ startCommand: "uvicorn main:app --host 0.0.0.0 --port 8080",
145
+ },
146
+ isServer: true,
147
+ },
148
+ flask: {
149
+ label: "Flask",
150
+ family: "nixpacks",
151
+ deploymentType: "container",
152
+ defaults: {
153
+ buildCommand: "uv pip install --python 3.11 -r requirements.txt",
154
+ startCommand: "flask run --host 0.0.0.0 --port 8080",
155
+ },
156
+ isServer: true,
157
+ },
158
+ django: {
159
+ label: "Django",
160
+ family: "nixpacks",
161
+ deploymentType: "container",
162
+ defaults: {
163
+ buildCommand: "uv pip install --python 3.11 -r requirements.txt",
164
+ startCommand: "python3 manage.py runserver 0.0.0.0:8080",
165
+ },
166
+ isServer: true,
167
+ },
168
+ };
169
+ export function getFramework(id) {
170
+ return FRAMEWORKS[id.toLowerCase()];
171
+ }
172
+ export function getDefaultBuildCommand(frameworkId) {
173
+ return FRAMEWORKS[frameworkId.toLowerCase()]?.defaults.buildCommand;
174
+ }
175
+ export function getDefaultOutputDirectory(frameworkId) {
176
+ return FRAMEWORKS[frameworkId.toLowerCase()]?.defaults.outputDirectory;
177
+ }
178
+ export function getDefaultStartCommand(frameworkId) {
179
+ return FRAMEWORKS[frameworkId.toLowerCase()]?.defaults.startCommand;
180
+ }
181
+ export function getInstallCommand(frameworkId, packageManager) {
182
+ const pm = packageManager.toLowerCase();
183
+ const framework = FRAMEWORKS[frameworkId.toLowerCase()];
184
+ if (pm === "pip" || pm === "poetry") {
185
+ if (pm === "poetry")
186
+ return "poetry install";
187
+ return (framework?.defaults.installCommand || "pip install -r requirements.txt");
188
+ }
189
+ const installCommands = {
190
+ bun: "bun install",
191
+ npm: "npm install",
192
+ yarn: "yarn install",
193
+ pbun: "pbun install",
194
+ };
195
+ return installCommands[pm] || `${pm} install`;
196
+ }
@@ -0,0 +1,4 @@
1
+ export * from "./frameworks/registry";
2
+ export * from "./templates/registry";
3
+ export * from "./pricing";
4
+ export * from "./limits";
@@ -0,0 +1,4 @@
1
+ export * from "./frameworks/registry";
2
+ export * from "./templates/registry";
3
+ export * from "./pricing";
4
+ export * from "./limits";
@@ -0,0 +1,16 @@
1
+ export type SpendTier = "free" | "low" | "medium" | "high";
2
+ export interface TeamLimits {
3
+ maxProjects: number;
4
+ maxInstancesPerProject: number;
5
+ tier: SpendTier;
6
+ tierLabel: string;
7
+ }
8
+ export declare const SPEND_THRESHOLDS: {
9
+ readonly free: 0;
10
+ readonly low: 10;
11
+ readonly medium: 50;
12
+ readonly high: 200;
13
+ };
14
+ export declare const TIER_LIMITS: Record<SpendTier, TeamLimits>;
15
+ export declare function getLimitsBySpend(totalSpend: number): TeamLimits;
16
+ export declare function getTierLabel(totalSpend: number): string;
@@ -0,0 +1,44 @@
1
+ export const SPEND_THRESHOLDS = {
2
+ free: 0,
3
+ low: 10,
4
+ medium: 50,
5
+ high: 200,
6
+ };
7
+ export const TIER_LIMITS = {
8
+ free: {
9
+ maxProjects: 3,
10
+ maxInstancesPerProject: 1,
11
+ tier: "free",
12
+ tierLabel: "Free Usage",
13
+ },
14
+ low: {
15
+ maxProjects: 10,
16
+ maxInstancesPerProject: 2,
17
+ tier: "low",
18
+ tierLabel: "Low Spend",
19
+ },
20
+ medium: {
21
+ maxProjects: Infinity,
22
+ maxInstancesPerProject: 4,
23
+ tier: "medium",
24
+ tierLabel: "Medium Spend",
25
+ },
26
+ high: {
27
+ maxProjects: Infinity,
28
+ maxInstancesPerProject: 10,
29
+ tier: "high",
30
+ tierLabel: "High Spend",
31
+ },
32
+ };
33
+ export function getLimitsBySpend(totalSpend) {
34
+ if (totalSpend >= SPEND_THRESHOLDS.high)
35
+ return TIER_LIMITS.high;
36
+ if (totalSpend >= SPEND_THRESHOLDS.medium)
37
+ return TIER_LIMITS.medium;
38
+ if (totalSpend >= SPEND_THRESHOLDS.low)
39
+ return TIER_LIMITS.low;
40
+ return TIER_LIMITS.free;
41
+ }
42
+ export function getTierLabel(totalSpend) {
43
+ return getLimitsBySpend(totalSpend).tierLabel;
44
+ }
@@ -0,0 +1,2 @@
1
+ export type PodTier = "micro" | "lite" | "standard" | "pro" | "business";
2
+ export declare const TIER_HOURLY_PRICE: Record<PodTier, number>;
@@ -0,0 +1,7 @@
1
+ export const TIER_HOURLY_PRICE = {
2
+ micro: 0,
3
+ lite: 0.015,
4
+ standard: 0.05,
5
+ pro: 0.08,
6
+ business: 0.12,
7
+ };
@@ -0,0 +1,9 @@
1
+ export interface Template {
2
+ id: string;
3
+ name: string;
4
+ description: string;
5
+ repoUrl: string;
6
+ framework: string;
7
+ }
8
+ export declare const TEMPLATES: Template[];
9
+ export declare function getTemplate(id: string): Template | undefined;
@@ -0,0 +1,47 @@
1
+ export const TEMPLATES = [
2
+ {
3
+ id: "blank",
4
+ name: "Blank",
5
+ description: "Minimal project setup",
6
+ repoUrl: "https://github.com/onflyt/blank",
7
+ framework: "static",
8
+ },
9
+ {
10
+ id: "nextjs",
11
+ name: "Next.js Starter",
12
+ description: "Next.js with App Router",
13
+ repoUrl: "https://github.com/onflyt/nextjs-starter",
14
+ framework: "nextjs",
15
+ },
16
+ {
17
+ id: "react-vite",
18
+ name: "React + Vite",
19
+ description: "React with Vite bundler",
20
+ repoUrl: "https://github.com/onflyt/react-vite",
21
+ framework: "react",
22
+ },
23
+ {
24
+ id: "node-api",
25
+ name: "Node.js API",
26
+ description: "Express/Fastify REST API",
27
+ repoUrl: "https://github.com/onflyt/node-api",
28
+ framework: "node",
29
+ },
30
+ {
31
+ id: "fastapi",
32
+ name: "FastAPI",
33
+ description: "Python FastAPI backend",
34
+ repoUrl: "https://github.com/onflyt/fastapi-starter",
35
+ framework: "fastapi",
36
+ },
37
+ {
38
+ id: "ai-agent",
39
+ name: "AI Agent",
40
+ description: "AI Agent starter with OpenAI",
41
+ repoUrl: "https://github.com/onflyt/ai-agent",
42
+ framework: "python",
43
+ },
44
+ ];
45
+ export function getTemplate(id) {
46
+ return TEMPLATES.find((t) => t.id === id);
47
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "onflyt-cli",
3
- "version": "1.0.1-beta.2",
3
+ "version": "1.0.1-beta.3",
4
4
  "type": "module",
5
5
  "description": "Onflyt CLI - Deploy Node.js and Python APIs to serverless pods. Pay only per use.",
6
6
  "repository": {
@@ -13,7 +13,7 @@
13
13
  },
14
14
  "scripts": {
15
15
  "dev": "tsx src/index.tsx",
16
- "build": "pnpm -r --filter=@miiglu/shared build && esbuild src/index.tsx --bundle --platform=node --outfile=dist/index.js --format=esm --external:react-devtools-core --external:ink --external:react --external:react-dom --external:figlet",
16
+ "build": "esbuild src/index.tsx --bundle --platform=node --outfile=dist/index.js --format=esm --external:react-devtools-core --external:ink --external:react --external:react-dom --external:figlet",
17
17
  "build:prod": "pnpm -r --filter=@miiglu/shared build && esbuild src/index.tsx --bundle --platform=node --outfile=dist/index.js --format=esm --external:react-devtools-core --external:ink --external:react --external:react-dom --external:figlet",
18
18
  "start": "node dist/index.js",
19
19
  "pack": "npm pack --pack-destination dist"
@@ -37,7 +37,6 @@
37
37
  "author": "Miiglu",
38
38
  "license": "MIT",
39
39
  "dependencies": {
40
- "@miiglu/shared": "workspace:*",
41
40
  "@octokit/oauth-methods": "^6.0.2",
42
41
  "archiver": "^7.0.1",
43
42
  "figlet": "^1.11.0",
package/src/App.tsx CHANGED
@@ -4,7 +4,7 @@ import { Text, Box } from "ink";
4
4
  const App = () => {
5
5
  return (
6
6
  <Box flexDirection="column">
7
- <Text bold>Onflyt CLI v1.0.1-beta.1</Text>
7
+ <Text bold>Onflyt CLI v1.0.1-beta.3</Text>
8
8
  <Text>Type onflyt --help for available commands</Text>
9
9
  </Box>
10
10
  );
@@ -23,7 +23,7 @@ import {
23
23
  DeploymentStatus,
24
24
  deployManual,
25
25
  } from "../lib/deploy-api.js";
26
- import { TIER_HOURLY_PRICE } from "@miiglu/shared";
26
+ import { TIER_HOURLY_PRICE } from "../lib/shared";
27
27
  import { api } from "../lib/api.js";
28
28
 
29
29
  type Step =
@@ -6,7 +6,7 @@ const Help: React.FC = () => {
6
6
  \x1b[38;2;255;191;0m
7
7
  ╔══════════════════════════════════════════╗
8
8
  ║ \u25E1 ONFLYT ║
9
- ║ Deploy CLI v1.0.1-beta.1
9
+ ║ Deploy CLI v1.0.1-beta.3
10
10
  ╚══════════════════════════════════════════╝
11
11
  \x1b[0m
12
12
 
@@ -17,7 +17,7 @@ import {
17
17
  getDefaultOutputDirectory,
18
18
  getDefaultStartCommand,
19
19
  getInstallCommand,
20
- } from "@miiglu/shared";
20
+ } from "../lib/shared";
21
21
  import { Logo } from "../components/Loading.js";
22
22
 
23
23
  interface InitProps {
@@ -4,7 +4,7 @@ import { isLoggedIn, getConfig } from "../lib/config.js";
4
4
  import { api } from "../lib/api.js";
5
5
  import { Logo } from "../components/Loading.js";
6
6
  import Spinner from "ink-spinner";
7
- import { FRAMEWORKS } from "@miiglu/shared";
7
+ import { FRAMEWORKS } from "../lib/shared";
8
8
 
9
9
  type Step =
10
10
  | "loading"
@@ -27,7 +27,7 @@ export const Logo: React.FC = () => (
27
27
  <Text> </Text>
28
28
  <Text bold color="black" backgroundColor="rgb(255,191,0)">
29
29
  {" "}
30
- v1.0.1-beta.1{" "}
30
+ v1.0.1-beta.3{" "}
31
31
  </Text>
32
32
  </Box>
33
33
  <Box marginTop={1}>
package/src/index.tsx CHANGED
@@ -17,7 +17,7 @@ import Rollback from "./commands/rollback.js";
17
17
 
18
18
  const cli = meow(
19
19
  `
20
- Onflyt CLI v1.0.1-beta.1
20
+ Onflyt CLI v1.0.1-beta.3
21
21
 
22
22
  Usage
23
23
  $ onflyt <command>
@@ -11,8 +11,8 @@ import {
11
11
  } from "fs";
12
12
  import { join, relative, basename } from "path";
13
13
  import { execSync } from "child_process";
14
- import { TIER_HOURLY_PRICE, PodTier } from "@miiglu/shared";
15
- import { getLimitsBySpend, TeamLimits, getTierLabel } from "@miiglu/shared";
14
+ import { TIER_HOURLY_PRICE, PodTier } from "./shared";
15
+ import { getLimitsBySpend, TeamLimits, getTierLabel } from "./shared";
16
16
 
17
17
  export interface Team {
18
18
  teamId: string;
@@ -104,7 +104,7 @@ function formatPrice(price: number): string {
104
104
  return `$${price.toFixed(3)}/hr`;
105
105
  }
106
106
 
107
- import { FRAMEWORKS, FrameworkConfig } from "@miiglu/shared";
107
+ import { FRAMEWORKS, FrameworkConfig } from "./shared";
108
108
 
109
109
  export function isPodProject(framework?: string): boolean {
110
110
  if (!framework) return false;
@@ -5,7 +5,7 @@ import {
5
5
  getFramework,
6
6
  getDefaultOutputDirectory,
7
7
  FrameworkConfig,
8
- } from "@miiglu/shared";
8
+ } from "./shared";
9
9
 
10
10
  export interface Framework {
11
11
  id: string;
@@ -224,4 +224,4 @@ export class FrameworkDetector {
224
224
  }
225
225
  }
226
226
 
227
- export { getFramework } from "@miiglu/shared";
227
+ export { getFramework } from "./shared";