@nometria-ai/nom 0.1.0 → 0.2.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 +2 -2
- package/package.json +1 -1
- package/src/commands/deploy.js +3 -3
- package/src/commands/login.js +3 -3
- package/src/commands/setup.js +19 -19
- package/src/lib/api.js +2 -2
package/README.md
CHANGED
|
@@ -58,7 +58,7 @@ npx @nometria-ai/nom deploy
|
|
|
58
58
|
|
|
59
59
|
| Field | Description | Default |
|
|
60
60
|
|-------|-------------|---------|
|
|
61
|
-
| `name` | Project name (becomes `{name}.
|
|
61
|
+
| `name` | Project name (becomes `{name}.nometria.com`) | from package.json |
|
|
62
62
|
| `framework` | `vite`, `nextjs`, `remix`, `static`, `node` | auto-detected |
|
|
63
63
|
| `platform` | `aws`, `gcp`, `azure`, `digitalocean`, `hetzner`, `vercel` | `aws` |
|
|
64
64
|
| `region` | Cloud region | `us-east-1` |
|
|
@@ -70,7 +70,7 @@ npx @nometria-ai/nom deploy
|
|
|
70
70
|
|
|
71
71
|
## Authentication
|
|
72
72
|
|
|
73
|
-
Get an API key at [
|
|
73
|
+
Get an API key at [nometria.com/settings/api-keys](https://nometria.com/settings/api-keys).
|
|
74
74
|
|
|
75
75
|
```bash
|
|
76
76
|
# Option 1: Login command (stores in ~/.nometria/credentials.json)
|
package/package.json
CHANGED
package/src/commands/deploy.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* nom deploy — Build, upload, and deploy to production.
|
|
3
|
-
* All calls go through Deno functions at app.
|
|
3
|
+
* All calls go through Deno functions at app.nometria.com.
|
|
4
4
|
*/
|
|
5
5
|
import { execSync } from 'node:child_process';
|
|
6
6
|
import { existsSync } from 'node:fs';
|
|
@@ -126,10 +126,10 @@ export async function deploy(flags) {
|
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
// Step 7: Print result
|
|
129
|
-
const url = finalStatus.data?.deployUrl || finalStatus.url || `https://${appName}.
|
|
129
|
+
const url = finalStatus.data?.deployUrl || finalStatus.url || `https://${appName}.nometria.com`;
|
|
130
130
|
console.log(`
|
|
131
131
|
Live at: ${url}
|
|
132
|
-
Dashboard: https://
|
|
132
|
+
Dashboard: https://nometria.com/apps/${appName}
|
|
133
133
|
`);
|
|
134
134
|
|
|
135
135
|
// Step 8: Auto-detect git repo and offer GitHub connection
|
package/src/commands/login.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Default flow (browser):
|
|
5
5
|
* 1. Start a local HTTP server on a random port
|
|
6
|
-
* 2. Open
|
|
6
|
+
* 2. Open nometria.com/extension/login?redirect_uri=http://127.0.0.1:{port}/callback
|
|
7
7
|
* 3. User signs in with Google/GitHub/email in the browser
|
|
8
8
|
* 4. Browser redirects back with Supabase JWT token
|
|
9
9
|
* 5. CLI calls /cli/create-api-key with that JWT to generate a persistent API key
|
|
@@ -116,7 +116,7 @@ async function loginWithBrowser() {
|
|
|
116
116
|
|
|
117
117
|
const port = addr.port;
|
|
118
118
|
const redirectUri = `http://127.0.0.1:${port}/callback`;
|
|
119
|
-
const appUrl = process.env.NOMETRIA_APP_URL || 'https://
|
|
119
|
+
const appUrl = process.env.NOMETRIA_APP_URL || 'https://nometria.com';
|
|
120
120
|
const loginUrl = `${appUrl}/extension/login?redirect_uri=${encodeURIComponent(redirectUri)}`;
|
|
121
121
|
|
|
122
122
|
console.log(` If the browser doesn't open, visit:\n ${loginUrl}\n`);
|
|
@@ -169,7 +169,7 @@ async function loginWithApiKey() {
|
|
|
169
169
|
console.log(`
|
|
170
170
|
Log in with API key
|
|
171
171
|
|
|
172
|
-
1. Go to https://
|
|
172
|
+
1. Go to https://nometria.com/settings/api-keys
|
|
173
173
|
2. Generate an API key
|
|
174
174
|
3. Paste it below
|
|
175
175
|
`);
|
package/src/commands/setup.js
CHANGED
|
@@ -353,7 +353,7 @@ cat ~/.nometria 2>/dev/null
|
|
|
353
353
|
If no token is found, tell the user:
|
|
354
354
|
|
|
355
355
|
> No Nometria API token found. Run \\\`nom login\\\` or \\\`/nometria-login\\\` to authenticate.
|
|
356
|
-
> Get your API key at https://
|
|
356
|
+
> Get your API key at https://nometria.com/settings/api-keys
|
|
357
357
|
|
|
358
358
|
**Stop here if no token.** Do not proceed without a valid token.
|
|
359
359
|
|
|
@@ -371,7 +371,7 @@ If it exists, extract \\\`app_id\\\` and \\\`migration_id\\\` from it.
|
|
|
371
371
|
If not, or if the user specified an app name as \\\`$ARGUMENTS\\\`, list all migrations:
|
|
372
372
|
|
|
373
373
|
\`\`\`bash
|
|
374
|
-
curl -s -X POST https://app.
|
|
374
|
+
curl -s -X POST https://app.nometria.com/listUserMigrations \\
|
|
375
375
|
-H "Content-Type: application/json" \\
|
|
376
376
|
-H "Authorization: Bearer $TOKEN" \\
|
|
377
377
|
-d '{}'
|
|
@@ -386,7 +386,7 @@ Store: \\\`APP_ID="<app_id>"\\\` and \\\`MIGRATION_ID="<migration_id>"\\\`
|
|
|
386
386
|
## Step 3: Check current deployment status
|
|
387
387
|
|
|
388
388
|
\`\`\`bash
|
|
389
|
-
curl -s -X POST https://app.
|
|
389
|
+
curl -s -X POST https://app.nometria.com/checkAwsStatus \\
|
|
390
390
|
-H "Content-Type: application/json" \\
|
|
391
391
|
-H "Authorization: Bearer $TOKEN" \\
|
|
392
392
|
-d "{\\"app_id\\": \\"$APP_ID\\"}"
|
|
@@ -401,7 +401,7 @@ Parse the response to determine the instance state.
|
|
|
401
401
|
Tell the user: "App is already running. Resyncing code to production..."
|
|
402
402
|
|
|
403
403
|
\`\`\`bash
|
|
404
|
-
curl -s -X POST https://app.
|
|
404
|
+
curl -s -X POST https://app.nometria.com/resyncHosting \\
|
|
405
405
|
-H "Content-Type: application/json" \\
|
|
406
406
|
-H "Authorization: Bearer $TOKEN" \\
|
|
407
407
|
-d "{\\"app_id\\": \\"$APP_ID\\"}"
|
|
@@ -412,7 +412,7 @@ curl -s -X POST https://app.ownmy.app/resyncHosting \\
|
|
|
412
412
|
Tell the user: "Instance is stopped. Starting and resyncing..."
|
|
413
413
|
|
|
414
414
|
\`\`\`bash
|
|
415
|
-
curl -s -X POST https://app.
|
|
415
|
+
curl -s -X POST https://app.nometria.com/updateInstanceState \\
|
|
416
416
|
-H "Content-Type: application/json" \\
|
|
417
417
|
-H "Authorization: Bearer $TOKEN" \\
|
|
418
418
|
-d "{\\"app_id\\": \\"$APP_ID\\", \\"instance_state\\": \\"start\\"}"
|
|
@@ -425,7 +425,7 @@ Then resync once it's running.
|
|
|
425
425
|
Tell the user: "Deploying new production instance..."
|
|
426
426
|
|
|
427
427
|
\`\`\`bash
|
|
428
|
-
curl -s -X POST https://app.
|
|
428
|
+
curl -s -X POST https://app.nometria.com/deployToAws \\
|
|
429
429
|
-H "Content-Type: application/json" \\
|
|
430
430
|
-H "Authorization: Bearer $TOKEN" \\
|
|
431
431
|
-d "{\\"migration_id\\": \\"$MIGRATION_ID\\"}"
|
|
@@ -436,7 +436,7 @@ curl -s -X POST https://app.ownmy.app/deployToAws \\
|
|
|
436
436
|
Poll every 5 seconds until the deployment reaches a terminal state:
|
|
437
437
|
|
|
438
438
|
\`\`\`bash
|
|
439
|
-
curl -s -X POST https://app.
|
|
439
|
+
curl -s -X POST https://app.nometria.com/checkAwsStatus \\
|
|
440
440
|
-H "Content-Type: application/json" \\
|
|
441
441
|
-H "Authorization: Bearer $TOKEN" \\
|
|
442
442
|
-d "{\\"app_id\\": \\"$APP_ID\\"}"
|
|
@@ -473,7 +473,7 @@ If \\\`nometria.json\\\` doesn't exist, create it so future deploys are faster:
|
|
|
473
473
|
"app_id": "<APP_ID>",
|
|
474
474
|
"migration_id": "<MIGRATION_ID>",
|
|
475
475
|
"app_name": "<app_name>",
|
|
476
|
-
"api_url": "https://app.
|
|
476
|
+
"api_url": "https://app.nometria.com"
|
|
477
477
|
}
|
|
478
478
|
\`\`\`
|
|
479
479
|
|
|
@@ -511,7 +511,7 @@ cat nometria.json 2>/dev/null
|
|
|
511
511
|
If no \\\`nometria.json\\\`, list migrations:
|
|
512
512
|
|
|
513
513
|
\`\`\`bash
|
|
514
|
-
curl -s -X POST https://app.
|
|
514
|
+
curl -s -X POST https://app.nometria.com/listUserMigrations \\
|
|
515
515
|
-H "Content-Type: application/json" \\
|
|
516
516
|
-H "Authorization: Bearer $TOKEN" \\
|
|
517
517
|
-d '{}'
|
|
@@ -522,7 +522,7 @@ Pick the correct migration. If \\\`$ARGUMENTS\\\` was provided, match by app nam
|
|
|
522
522
|
## Step 3: Deploy preview
|
|
523
523
|
|
|
524
524
|
\`\`\`bash
|
|
525
|
-
curl -s -X POST https://app.
|
|
525
|
+
curl -s -X POST https://app.nometria.com/deployStagingPreview \\
|
|
526
526
|
-H "Content-Type: application/json" \\
|
|
527
527
|
-H "Authorization: Bearer $TOKEN" \\
|
|
528
528
|
-d "{\\"migration_id\\": \\"$MIGRATION_ID\\", \\"production\\": false}"
|
|
@@ -569,7 +569,7 @@ If no token: tell the user to run \\\`/nometria-login\\\` and stop.
|
|
|
569
569
|
## Step 2: List all migrations
|
|
570
570
|
|
|
571
571
|
\`\`\`bash
|
|
572
|
-
curl -s -X POST https://app.
|
|
572
|
+
curl -s -X POST https://app.nometria.com/listUserMigrations \\
|
|
573
573
|
-H "Content-Type: application/json" \\
|
|
574
574
|
-H "Authorization: Bearer $TOKEN" \\
|
|
575
575
|
-d '{}'
|
|
@@ -580,7 +580,7 @@ curl -s -X POST https://app.ownmy.app/listUserMigrations \\
|
|
|
580
580
|
For each migration with \\\`delivery_type: "hosting"\\\`, check its status:
|
|
581
581
|
|
|
582
582
|
\`\`\`bash
|
|
583
|
-
curl -s -X POST https://app.
|
|
583
|
+
curl -s -X POST https://app.nometria.com/checkAwsStatus \\
|
|
584
584
|
-H "Content-Type: application/json" \\
|
|
585
585
|
-H "Authorization: Bearer $TOKEN" \\
|
|
586
586
|
-d "{\\"app_id\\": \\"<APP_ID>\\"}"
|
|
@@ -639,7 +639,7 @@ Tell the user:
|
|
|
639
639
|
|
|
640
640
|
> To get your Nometria API key:
|
|
641
641
|
>
|
|
642
|
-
> 1. Go to **https://
|
|
642
|
+
> 1. Go to **https://nometria.com/settings/api-keys**
|
|
643
643
|
> 2. Sign in to your account
|
|
644
644
|
> 3. Click **Generate New Key**
|
|
645
645
|
> 4. Copy the key and paste it here
|
|
@@ -654,7 +654,7 @@ Wait for the user to provide the token. They will paste it in the chat.
|
|
|
654
654
|
Once the user provides a token, validate it:
|
|
655
655
|
|
|
656
656
|
\`\`\`bash
|
|
657
|
-
curl -s -X POST https://app.
|
|
657
|
+
curl -s -X POST https://app.nometria.com/listUserMigrations \\
|
|
658
658
|
-H "Content-Type: application/json" \\
|
|
659
659
|
-H "Authorization: Bearer <USER_TOKEN>" \\
|
|
660
660
|
-d '{}'
|
|
@@ -698,15 +698,15 @@ npx @nometria-ai/nom deploy
|
|
|
698
698
|
|
|
699
699
|
\`\`\`bash
|
|
700
700
|
# 1. Set your token (API key or JWT)
|
|
701
|
-
export NOMETRIA_API_KEY="nometria_sk_..." # from https://
|
|
701
|
+
export NOMETRIA_API_KEY="nometria_sk_..." # from https://nometria.com/settings/api-keys
|
|
702
702
|
|
|
703
703
|
# 2. List your apps
|
|
704
|
-
curl -s -X POST https://app.
|
|
704
|
+
curl -s -X POST https://app.nometria.com/listUserMigrations \\
|
|
705
705
|
-H "Content-Type: application/json" \\
|
|
706
706
|
-H "Authorization: Bearer $NOMETRIA_API_KEY" -d '{}'
|
|
707
707
|
|
|
708
708
|
# 3. Deploy to production (resync if already running)
|
|
709
|
-
curl -s -X POST https://app.
|
|
709
|
+
curl -s -X POST https://app.nometria.com/resyncHosting \\
|
|
710
710
|
-H "Content-Type: application/json" \\
|
|
711
711
|
-H "Authorization: Bearer $NOMETRIA_API_KEY" \\
|
|
712
712
|
-d '{"app_id": "YOUR_APP_ID"}'
|
|
@@ -730,11 +730,11 @@ curl -s -X POST https://app.ownmy.app/resyncHosting \\
|
|
|
730
730
|
Every API call requires \\\`Authorization: Bearer <token>\\\` header. Both API keys (\\\`nometria_sk_...\\\`) and JWT tokens are accepted.
|
|
731
731
|
|
|
732
732
|
**Getting an API key:**
|
|
733
|
-
1. Sign in at https://
|
|
733
|
+
1. Sign in at https://nometria.com/settings/api-keys
|
|
734
734
|
2. Go to Settings -> API Token
|
|
735
735
|
3. Copy and store as \\\`NOMETRIA_API_KEY\\\` environment variable
|
|
736
736
|
|
|
737
|
-
**Base URL:** \\\`https://app.
|
|
737
|
+
**Base URL:** \\\`https://app.nometria.com\\\`
|
|
738
738
|
|
|
739
739
|
All endpoints are \\\`POST\\\` with JSON body and \\\`Content-Type: application/json\\\`.
|
|
740
740
|
|
package/src/lib/api.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* HTTP client for the Deno function endpoints at app.
|
|
2
|
+
* HTTP client for the Deno function endpoints at app.nometria.com.
|
|
3
3
|
* All CLI calls go through the Deno function layer, NOT the Python backend.
|
|
4
4
|
* Uses native fetch (Node 18+).
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
const DEFAULT_API_URL = 'https://app.
|
|
7
|
+
const DEFAULT_API_URL = 'https://app.nometria.com';
|
|
8
8
|
|
|
9
9
|
function getBaseUrl() {
|
|
10
10
|
return process.env.NOMETRIA_API_URL || DEFAULT_API_URL;
|