CursorPool
← 返回首页

Nometria Deploy

Deploy any app to any cloud from Cursor. 20 MCP tools for deployments, previews, and instance management.

cursor.directory·1
MCP

nometria

MCP server: nometria

{
  "command": "npx",
  "args": [
    "-y",
    "@nometria-ai/claude-code"
  ],
  "env": {}
}
Skill

deploy

Deploy your app to production via Nometria

# Deploy to Production

You are deploying the user's app to production via the Nometria platform. Execute this workflow precisely.

## Step 1: Resolve API token

Find the Nometria API token. Check in this order:

```bash
# 1. Environment variables (API key or JWT token)
echo "$NOMETRIA_API_KEY"
echo "$NOMETRIA_TOKEN"

# 2. .env file in current project
grep -s 'NOMETRIA_API_KEY\|NOMETRIA_TOKEN' .env .env.local 2>/dev/null

# 3. Stored credentials from `nom login`
cat ~/.nometria/credentials.json 2>/dev/null

# 4. Home directory config (legacy)
cat ~/.nometria 2>/dev/null
```

If no token is found, tell the user:

> No Nometria API token found. Run `nom login` or `/nometria-login` to authenticate.
> Get your API key at https://ownmy.app/settings/api-keys

**Stop here if no token.** Do not proceed without a valid token.

Store the token: `TOKEN="<the token>"`

## Step 2: Identify the app

Check if there's a `nometria.json` in the workspace root:
```bash
cat nometria.json 2>/dev/null
```

If it exists, extract `app_id` and `migration_id` from it.

If not, or if the user specified an app name as `$ARGUMENTS`, list all migrations:

```bash
curl -s -X POST https://app.ownmy.app/listUserMigrations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TOKEN" \
  -d '{}'
```

From the response, find the matching migration. If multiple apps exist and the user didn't specify which one, show a numbered list and ask them to pick:

```
1. MyApp (Base44) - hosting, paid
2. OtherApp (Lovable) - hosting, paid
3. TestApp (Manus) - download, pending
```

Only proceed with migrations that have `delivery_type: "hosting"` and `payment_status: "paid"`.

Store: `APP_ID="<app_id>"` and `MIGRATION_ID="<migration_id>"`

## Step 3: Check current deployment status

```bash
curl -s -X POST https://app.ownmy.app/checkAwsStatus \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TOKEN" \
  -d "{\"app_id\": \"$APP_ID\"}"
```

Parse the response to determine the instance state.

## Step 4: Deploy or resync

**If instance is running** (`data.instanceState === "running"`):

Tell the user: "App is already running. Resyncing code to production..."

```bash
curl -s -X POST https://app.ownmy.app/resyncHosting \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TOKEN" \
  -d "{\"app_id\": \"$APP_ID\"}"
```

**If instance is stopped** (`data.instanceState === "stopped"`):

Tell the user: "Instance is stopped. Starting and resyncing..."

```bash
curl -s -X POST https://app.ownmy.app/updateInstanceState \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TOKEN" \
  -d "{\"app_id\": \"$APP_ID\", \"instance_state\": \"start\"}"
```

Then resync once it's running.

**If not deployed** (`status === "not_deployed"`):

Tell the user: "Deploying new production instance..."

```bash
curl -s -X POST https://app.ownmy.app/deployToAws \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TOKEN" \
  -d "{\"migration_id\": \"$MIGRATION_ID\"}"
```

## Step 5: Poll for completion

Poll every 5 seconds until the deployment reaches a terminal state:

```bash
curl -s -X POST https://app.ownmy.app/checkAwsStatus \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TOKEN" \
  -d "{\"app_id\": \"$APP_ID\"}"
```

Terminal states:
- `instanceState: "running"` → **Success**
- `deploymentStatus: "failed"` → **Failure** (report `errorMessage`)
- `instanceState: "terminated"` → **Failure**

Poll up to 60 times (5 minutes). Report progress every 3 polls.

## Step 6: Report result

**On success**, display:

```
✅ Deployed successfully!

   App:  <app_name>
   URL:  <deployUrl or hosted_url>
   IP:   <ipAddress>
   Type: <instanceType>
```

**On failure**, display the error and suggest checking the Nometria dashboard.

## Step 7: Save workspace config

If `nometria.json` doesn't exist, create it so future deploys are faster:

```json
{
  "app_id": "<APP_ID>",
  "migration_id": "<MIGRATION_ID>",
  "app_name": "<app_name>",
  "api_url": "https://app.ownmy.app"
}
```

Do all of the above. Execute every curl call and report results to the user.
Skill

login

Authenticate with the Nometria deployment platform

# Nometria Login

Help the user set up their Nometria API token for deployments.

## Step 1: Check existing token

```bash
# Check environment (API key or JWT)
echo "API_KEY: $([ -n "$NOMETRIA_API_KEY" ] && echo 'set' || echo 'not set')"
echo "TOKEN: $([ -n "$NOMETRIA_TOKEN" ] && echo 'set' || echo 'not set')"

# Check .env
grep -s 'NOMETRIA_API_KEY\|NOMETRIA_TOKEN' .env .env.local 2>/dev/null && echo "Found in .env" || echo ".env: not found"

# Check nom CLI credentials
cat ~/.nometria/credentials.json 2>/dev/null && echo "Found ~/.nometria/credentials.json" || echo "~/.nometria/credentials.json: not found"
```

If a token already exists, tell the user they're already authenticated and show which source it was found in. Ask if they want to update it.

## Step 2: Get the token

Tell the user:

> To get your Nometria API key:
>
> 1. Go to **https://ownmy.app/settings/api-keys**
> 2. Sign in to your account
> 3. Click **Generate New Key**
> 4. Copy the key and paste it here
>
> Your key is stored locally and never sent anywhere except the Nometria API.
> Alternatively, you can use `nom login` from the CLI.

Wait for the user to provide the token. They will paste it in the chat.

## Step 3: Validate the token

Once the user provides a token, validate it by making a test API call:

```bash
curl -s -X POST https://app.ownmy.app/listUserMigrations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <USER_TOKEN>" \
  -d '{}'
```

If the response contains `"success": true`, the token is valid.
If it returns 401 or an error, tell the user the token is invalid and ask them to try again.

## Step 4: Store the token

If the current directory has a `.env` file, append to it:

```
NOMETRIA_API_KEY=<key>
```

If no `.env` exists, create `.env` with the key.

Also check if `.gitignore` contains `.env`. If not, warn the user:

> ⚠️ Make sure `.env` is in your `.gitignore` to avoid committing your token.

## Step 5: Create workspace config

If no `nometria.json` exists and the user has migrations, ask if they want to link this workspace to one of their apps. If yes, create `nometria.json`:

```json
{
  "app_id": "<selected_app_id>",
  "migration_id": "<selected_migration_id>",
  "app_name": "<app_name>",
  "api_url": "https://app.ownmy.app"
}
```

## Step 6: Confirm

Tell the user:

```
✅ Authenticated as <email>

   Key stored in: .env
   Linked app: <app_name> (or "none - run /deploy to link")

   You can now use:
     /deploy   - Deploy to production
     /preview  - Deploy staging preview
     /status   - Check deployment status
     nom deploy - Deploy from CLI
```
Skill

preview

Deploy a staging preview of your app via Nometria

# Deploy Staging Preview

You are creating a temporary staging preview of the user's app. This is free and creates a short-lived URL.

## Step 1: Resolve token

```bash
TOKEN="${NOMETRIA_API_KEY:-${NOMETRIA_TOKEN:-$(grep -s 'NOMETRIA_API_KEY\|NOMETRIA_TOKEN' .env .env.local 2>/dev/null | head -1 | cut -d= -f2- | tr -d ' "'"'"'')}}"
echo "Token found: $([ -n "$TOKEN" ] && echo 'yes' || echo 'no')"
```

If no token: tell the user to run `nom login` or `/nometria-login` and stop.

## Step 2: Identify the app

```bash
# Try workspace config first
cat nometria.json 2>/dev/null
```

If no `nometria.json`, list migrations:

```bash
curl -s -X POST https://app.ownmy.app/listUserMigrations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TOKEN" \
  -d '{}'
```

Pick the correct migration. If `$ARGUMENTS` was provided, match by app name. Otherwise, if multiple exist, ask the user. Store `MIGRATION_ID`.

## Step 3: Deploy preview

```bash
curl -s -X POST https://app.ownmy.app/deployStagingPreview \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TOKEN" \
  -d "{\"migration_id\": \"$MIGRATION_ID\", \"production\": false}"
```

## Step 4: Report result

Parse the response. On success, display:

```
🔗 Preview deployed!

   URL: <preview_url>
   Expires: ~2 hours

   This is a temporary preview. Use /deploy for production.
```

On failure, show the error message and suggest checking the dashboard.

Execute all curl commands and report the results.
Skill

status

Check deployment status of your Nometria apps

# Check Deployment Status

Show the user the current state of their Nometria deployments.

## Step 1: Resolve token

```bash
TOKEN="${NOMETRIA_API_KEY:-${NOMETRIA_TOKEN:-$(grep -s 'NOMETRIA_API_KEY\|NOMETRIA_TOKEN' .env .env.local 2>/dev/null | head -1 | cut -d= -f2- | tr -d ' "'"'"'')}}"
```

If no token: tell the user to run `/nometria-login` and stop.

## Step 2: List all migrations

```bash
curl -s -X POST https://app.ownmy.app/listUserMigrations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TOKEN" \
  -d '{}'
```

## Step 3: Check AWS status for hosting apps

For each migration with `delivery_type: "hosting"`, check its status:

```bash
curl -s -X POST https://app.ownmy.app/checkAwsStatus \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TOKEN" \
  -d "{\"app_id\": \"<APP_ID>\"}"
```

## Step 4: Display formatted table

Present results as a clear table:

```
╔══════════════════╦══════════╦═══════════╦════════════════════════════════╦═════════════════╗
║ App              ║ Platform ║ Status    ║ URL                            ║ Instance        ║
╠══════════════════╬══════════╬═══════════╬════════════════════════════════╬═════════════════╣
║ MyApp            ║ Base44   ║ ● running ║ https://myapp.ownmy.app        ║ 4gb (t4g.med)   ║
║ OtherApp         ║ Lovable  ║ ○ stopped ║ https://otherapp.ownmy.app     ║ 2gb (t4g.small) ║
║ TestProject      ║ Manus    ║ — none    ║ —                              ║ —               ║
╚══════════════════╩══════════╩═══════════╩════════════════════════════════╩═════════════════╝
```

Use these status indicators:
- `● running` — app is live
- `◐ deploying` / `◐ launching` — deployment in progress
- `○ stopped` — instance exists but is off
- `✕ failed` — deployment failed (show error if available)
- `— none` — not deployed to hosting

If `$ARGUMENTS` was provided, filter the results to match that app name.

Also show:
- Total apps: X
- Running: X
- Stopped: X

If there's a `nometria.json` in the workspace, highlight the linked app with `← linked`.

Execute all the curl calls and display the results.
规则

nometria-login

Authenticate with the Nometria deployment platform

# Nometria Login

Help the user set up their Nometria API token for deployments.

## Step 1: Check existing token

```bash
# Check environment (API key or JWT)
echo "API_KEY: $([ -n "$NOMETRIA_API_KEY" ] && echo 'set' || echo 'not set')"
echo "TOKEN: $([ -n "$NOMETRIA_TOKEN" ] && echo 'set' || echo 'not set')"

# Check .env
grep -s 'NOMETRIA_API_KEY\|NOMETRIA_TOKEN' .env .env.local 2>/dev/null && echo "Found in .env" || echo ".env: not found"

# Check nom CLI credentials
cat ~/.nometria/credentials.json 2>/dev/null && echo "Found ~/.nometria/credentials.json" || echo "~/.nometria/credentials.json: not found"
```

If a token already exists, tell the user they're already authenticated and show which source it was found in. Ask if they want to update it.

## Step 2: Get the token

Tell the user:

> To get your Nometria API key:
>
> 1. Go to **https://ownmy.app/settings/api-keys**
> 2. Sign in to your account
> 3. Click **Generate New Key**
> 4. Copy the key and paste it here
>
> Your key is stored locally and never sent anywhere except the Nometria API.
> Alternatively, you can use `nom login` from the CLI.

Wait for the user to provide the token. They will paste it in the chat.

## Step 3: Validate the token

Once the user provides a token, validate it by making a test API call:

```bash
curl -s -X POST https://app.ownmy.app/listUserMigrations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <USER_TOKEN>" \
  -d '{}'
```

If the response contains `"success": true`, the token is valid.
If it returns 401 or an error, tell the user the token is invalid and ask them to try again.

## Step 4: Store the token

If the current directory has a `.env` file, append to it:

```
NOMETRIA_API_KEY=<key>
```

If no `.env` exists, create `.env` with the key.

Also check if `.gitignore` contains `.env`. If not, warn the user:

> ⚠️ Make sure `.env` is in your `.gitignore` to avoid committing your token.

## Step 5: Create workspace config

If no `nometria.json` exists and the user has migrations, ask if they want to link this workspace to one of their apps. If yes, create `nometria.json`:

```json
{
  "app_id": "<selected_app_id>",
  "migration_id": "<selected_migration_id>",
  "app_name": "<app_name>",
  "api_url": "https://app.ownmy.app"
}
```

## Step 6: Confirm

Tell the user:

```
✅ Authenticated as <email>

   Key stored in: .env
   Linked app: <app_name> (or "none - run /deploy to link")

   You can now use:
     /deploy   - Deploy to production
     /preview  - Deploy staging preview
     /status   - Check deployment status
     nom deploy - Deploy from CLI
```
规则

preview

Deploy a staging preview of your app via Nometria

# Deploy Staging Preview

You are creating a temporary staging preview of the user's app. This is free and creates a short-lived URL.

## Step 1: Resolve token

```bash
TOKEN="${NOMETRIA_API_KEY:-${NOMETRIA_TOKEN:-$(grep -s 'NOMETRIA_API_KEY\|NOMETRIA_TOKEN' .env .env.local 2>/dev/null | head -1 | cut -d= -f2- | tr -d ' "'"'"'')}}"
echo "Token found: $([ -n "$TOKEN" ] && echo 'yes' || echo 'no')"
```

If no token: tell the user to run `nom login` or `/nometria-login` and stop.

## Step 2: Identify the app

```bash
# Try workspace config first
cat nometria.json 2>/dev/null
```

If no `nometria.json`, list migrations:

```bash
curl -s -X POST https://app.ownmy.app/listUserMigrations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TOKEN" \
  -d '{}'
```

Pick the correct migration. If `$ARGUMENTS` was provided, match by app name. Otherwise, if multiple exist, ask the user. Store `MIGRATION_ID`.

## Step 3: Deploy preview

```bash
curl -s -X POST https://app.ownmy.app/deployStagingPreview \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TOKEN" \
  -d "{\"migration_id\": \"$MIGRATION_ID\", \"production\": false}"
```

## Step 4: Report result

Parse the response. On success, display:

```
🔗 Preview deployed!

   URL: <preview_url>
   Expires: ~2 hours

   This is a temporary preview. Use /deploy for production.
```

On failure, show the error message and suggest checking the dashboard.

Execute all curl commands and report the results.
规则

status

Check deployment status of your Nometria apps

# Check Deployment Status

Show the user the current state of their Nometria deployments.

## Step 1: Resolve token

```bash
TOKEN="${NOMETRIA_API_KEY:-${NOMETRIA_TOKEN:-$(grep -s 'NOMETRIA_API_KEY\|NOMETRIA_TOKEN' .env .env.local 2>/dev/null | head -1 | cut -d= -f2- | tr -d ' "'"'"'')}}"
```

If no token: tell the user to run `/nometria-login` and stop.

## Step 2: List all migrations

```bash
curl -s -X POST https://app.ownmy.app/listUserMigrations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TOKEN" \
  -d '{}'
```

## Step 3: Check AWS status for hosting apps

For each migration with `delivery_type: "hosting"`, check its status:

```bash
curl -s -X POST https://app.ownmy.app/checkAwsStatus \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TOKEN" \
  -d "{\"app_id\": \"<APP_ID>\"}"
```

## Step 4: Display formatted table

Present results as a clear table:

```
╔══════════════════╦══════════╦═══════════╦════════════════════════════════╦═════════════════╗
║ App              ║ Platform ║ Status    ║ URL                            ║ Instance        ║
╠══════════════════╬══════════╬═══════════╬════════════════════════════════╬═════════════════╣
║ MyApp            ║ Base44   ║ ● running ║ https://myapp.ownmy.app        ║ 4gb (t4g.med)   ║
║ OtherApp         ║ Lovable  ║ ○ stopped ║ https://otherapp.ownmy.app     ║ 2gb (t4g.small) ║
║ TestProject      ║ Manus    ║ — none    ║ —                              ║ —               ║
╚══════════════════╩══════════╩═══════════╩════════════════════════════════╩═════════════════╝
```

Use these status indicators:
- `● running` — app is live
- `◐ deploying` / `◐ launching` — deployment in progress
- `○ stopped` — instance exists but is off
- `✕ failed` — deployment failed (show error if available)
- `— none` — not deployed to hosting

If `$ARGUMENTS` was provided, filter the results to match that app name.

Also show:
- Total apps: X
- Running: X
- Stopped: X

If there's a `nometria.json` in the workspace, highlight the linked app with `← linked`.

Execute all the curl calls and display the results.
规则

deploy

Deploy your app to production via Nometria

# Deploy to Production

You are deploying the user's app to production via the Nometria platform. Execute this workflow precisely.

## Step 1: Resolve API token

Find the Nometria API token. Check in this order:

```bash
# 1. Environment variables (API key or JWT token)
echo "$NOMETRIA_API_KEY"
echo "$NOMETRIA_TOKEN"

# 2. .env file in current project
grep -s 'NOMETRIA_API_KEY\|NOMETRIA_TOKEN' .env .env.local 2>/dev/null

# 3. Stored credentials from `nom login`
cat ~/.nometria/credentials.json 2>/dev/null

# 4. Home directory config (legacy)
cat ~/.nometria 2>/dev/null
```

If no token is found, tell the user:

> No Nometria API token found. Run `nom login` or `/nometria-login` to authenticate.
> Get your API key at https://ownmy.app/settings/api-keys

**Stop here if no token.** Do not proceed without a valid token.

Store the token: `TOKEN="<the token>"`

## Step 2: Identify the app

Check if there's a `nometria.json` in the workspace root:
```bash
cat nometria.json 2>/dev/null
```

If it exists, extract `app_id` and `migration_id` from it.

If not, or if the user specified an app name as `$ARGUMENTS`, list all migrations:

```bash
curl -s -X POST https://app.ownmy.app/listUserMigrations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TOKEN" \
  -d '{}'
```

From the response, find the matching migration. If multiple apps exist and the user didn't specify which one, show a numbered list and ask them to pick:

```
1. MyApp (Base44) - hosting, paid
2. OtherApp (Lovable) - hosting, paid
3. TestApp (Manus) - download, pending
```

Only proceed with migrations that have `delivery_type: "hosting"` and `payment_status: "paid"`.

Store: `APP_ID="<app_id>"` and `MIGRATION_ID="<migration_id>"`

## Step 3: Check current deployment status

```bash
curl -s -X POST https://app.ownmy.app/checkAwsStatus \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TOKEN" \
  -d "{\"app_id\": \"$APP_ID\"}"
```

Parse the response to determine the instance state.

## Step 4: Deploy or resync

**If instance is running** (`data.instanceState === "running"`):

Tell the user: "App is already running. Resyncing code to production..."

```bash
curl -s -X POST https://app.ownmy.app/resyncHosting \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TOKEN" \
  -d "{\"app_id\": \"$APP_ID\"}"
```

**If instance is stopped** (`data.instanceState === "stopped"`):

Tell the user: "Instance is stopped. Starting and resyncing..."

```bash
curl -s -X POST https://app.ownmy.app/updateInstanceState \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TOKEN" \
  -d "{\"app_id\": \"$APP_ID\", \"instance_state\": \"start\"}"
```

Then resync once it's running.

**If not deployed** (`status === "not_deployed"`):

Tell the user: "Deploying new production instance..."

```bash
curl -s -X POST https://app.ownmy.app/deployToAws \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TOKEN" \
  -d "{\"migration_id\": \"$MIGRATION_ID\"}"
```

## Step 5: Poll for completion

Poll every 5 seconds until the deployment reaches a terminal state:

```bash
curl -s -X POST https://app.ownmy.app/checkAwsStatus \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TOKEN" \
  -d "{\"app_id\": \"$APP_ID\"}"
```

Terminal states:
- `instanceState: "running"` → **Success**
- `deploymentStatus: "failed"` → **Failure** (report `errorMessage`)
- `instanceState: "terminated"` → **Failure**

Poll up to 60 times (5 minutes). Report progress every 3 polls.

## Step 6: Report result

**On success**, display:

```
✅ Deployed successfully!

   App:  <app_name>
   URL:  <deployUrl or hosted_url>
   IP:   <ipAddress>
   Type: <instanceType>
```

**On failure**, display the error and suggest checking the Nometria dashboard.

## Step 7: Save workspace config

If `nometria.json` doesn't exist, create it so future deploys are faster:

```json
{
  "app_id": "<APP_ID>",
  "migration_id": "<MIGRATION_ID>",
  "app_name": "<app_name>",
  "api_url": "https://app.ownmy.app"
}
```

Do all of the above. Execute every curl call and report results to the user.

来源:https://github.com/nometria/claude-code-plugin