Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@
"email": "flopspm@gmail.com"
},
"keywords": ["review", "coderabbit", "github", "pr", "pull-request", "bot-comments"]
},
{
"name": "meshy",
"source": "./plugins/meshy",
"description": "Generate 3D models, textures, rigs and animations from text or images via the Meshy AI API",
"author": {
"name": "Flop",
"email": "flopspm@gmail.com"
},
"keywords": ["meshy", "3d", "ai", "text-to-3d", "image-to-3d", "generative", "model-generation"]
}
]
}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,6 @@ dev-debug.log
# Task files
# tasks.json
# tasks/

# Local Meshy plugin test artifacts
.tmp-meshy-test/
3 changes: 2 additions & 1 deletion docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ export default defineConfig({
{ text: 'Overview', link: '/plugin-catalog/' },
{ text: 'Docs Plugin', link: '/plugin-catalog/docs-plugin' },
{ text: 'Git Plugin', link: '/plugin-catalog/git-plugin' },
{ text: 'Resolve CodeRabbit Plugin', link: '/plugin-catalog/resolve-coderabbit-plugin' }
{ text: 'Resolve CodeRabbit Plugin', link: '/plugin-catalog/resolve-coderabbit-plugin' },
{ text: 'Meshy Plugin', link: '/plugin-catalog/meshy-plugin' }
]
}
],
Expand Down
1 change: 1 addition & 0 deletions docs/plugin-catalog/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ This catalog provides detailed documentation for all available plugins in the Fl
- [Docs Plugin](docs-plugin.md) - Generate and keep documentation in sync with your codebase
- [Git Plugin](git-plugin.md) - Smart git workflow commands with intelligent conflict resolution
- [Resolve CodeRabbit Plugin](resolve-coderabbit-plugin.md) - Walk through CodeRabbit inline PR comments, verify, fix, and batch-resolve
- [Meshy Plugin](meshy-plugin.md) - Generate 3D models, textures, rigs and animations from text or images via the Meshy AI API

## Extras

Expand Down
96 changes: 96 additions & 0 deletions docs/plugin-catalog/meshy-plugin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# Meshy Plugin

**Name:** `meshy`

**Description:** Generate 3D models, textures, rigs and animations from text or images via the Meshy AI API

**Author:** Flop (flopspm@gmail.com)

**Version:** 0.1.0

**Keywords:** meshy, 3d, ai, text-to-3d, image-to-3d, generative, model-generation

The Meshy plugin gives Claude Code access to the full [Meshy AI](https://www.meshy.ai) 3D generation API through a **single zero-dependency Node script** (`meshy.mjs`) wrapped in a model-invoked skill. It deliberately avoids the official MCP server: an MCP server loads all of its tool schemas into context on every session, while a skill loads only its one-line description until it's actually needed — far cheaper for an API you reach for occasionally. The script runs identically on macOS, Linux, and Windows (it only needs Node), with no `npm install` and no build step.

## Installation

```bash
claude plugin install meshy@flugins
```

**Important:** After installing the plugin, restart Claude Code to activate skills.

**Tip:** Enable auto-update via `/plugin` → **Installed** → select the plugin → enable auto-update.

## Requirements

- **Node.js 18+** on `PATH` (`node --version`) — the script uses native `fetch` and streams; no other runtime or dependency is required.
- A **Meshy API key** in the `MESHY_AI_API_KEY` environment variable (or `MESHY_API_KEY`, or passed via `--api-key`). Create one at [meshy.ai/settings/api](https://www.meshy.ai/settings/api). Keys look like `msy_...`.
- Credits on your Meshy account for paid operations. A free, no-cost **test key** (`msy_dummy_api_key_for_test_mode_12345678`) returns sample assets without spending credits — handy for dry-runs.

## Features

### Skills

- [Meshy 3D Generation](#meshy-3d-generation) - Generate 3D models, textures, rigs, animations and images from text or photos, check credit balance, and download finished assets

### Usage

Ask in natural language — *"make a 3D model of a red ceramic mug"*, *"turn this photo into a 3D model"*, *"rig this character"*, *"how many Meshy credits do I have?"* — and the skill activates automatically. It picks the right endpoint, runs the bundled CLI (which handles the asynchronous create → poll → download lifecycle internally), parses the single JSON object the script prints, and reports where the files were saved and how many credits were spent. For long jobs it can fire-and-forget with `--no-wait` and resume later with `status` / `download`.

### Configuration

No plugin-specific configuration. The skill reads the API key from the environment (`MESHY_AI_API_KEY` / `MESHY_API_KEY`) or a `--api-key` flag, and the script ships sensible defaults (20-minute poll timeout, 5-second poll interval, automatic retry with backoff on rate limits). The full endpoint and parameter reference lives in `skills/meshy/docs/api-reference.md` and is loaded on demand rather than into every session.

---

## Meshy 3D Generation

**Skill:** `meshy`
**Type:** Model-invoked (automatic) / user-invocable

Drives the entire Meshy REST API from one generic client. The script exposes every endpoint behind a uniform `create → poll → download` engine and prints exactly one machine-readable JSON object to STDOUT (progress goes to STDERR), so Claude never has to scrape human text or write its own polling loop.

### How it Activates

The skill activates whenever you mention 3D generation or Meshy. Examples:

- "generate a 3D model of a low-poly tree"
- "turn this image into a 3D mesh"
- "re-texture this model to look like weathered bronze"
- "rig and animate this character"
- "check my Meshy balance"

You can also invoke it explicitly from the `/` menu.

### Capabilities

| Area | Commands |
|------|----------|
| 3D generation | `text-to-3d` (+ `refine`), `image-to-3d`, `multi-image-to-3d` |
| Post-processing | `retexture`, `remesh`, `rig`, `animate`, `convert`, `resize`, `uv-unwrap` |
| Image generation | `text-to-image`, `image-to-image` |
| 3D printing | `analyze-printability` (free), `repair-printability`, `multi-color-print` |
| Experimental | `creative-lab` (keychain / fridge-magnet / figure / lamp, prototype → build) |
| Account & tasks | `balance`, `status <type> <id>`, `list <type>`, `download <type> <id>` |

### Key Behaviors

- **Asynchronous handled for you.** Every generation `POST` returns a task id; the script polls until the task reaches `SUCCEEDED`/`FAILED`/`CANCELED`, streaming progress to STDERR. Use `--no-wait` to return the id immediately and resume later.
- **Downloads with `--out`.** Result URLs are short-lived signed links (models are retained for only a few days). Pass `--out <dir>` to stream assets to disk immediately; `--formats glb,fbx` selects model formats (default `glb`), and `--textures` / `--thumbnail` / `--all` pull extras. If a URL has expired, `download` re-fetches the task once for fresh links.
- **Local images, no manual base64.** Pass a local file to `--image` / `--images` / `--texture-image-url` and the CLI encodes it into a data URI for you.
- **Whole API reachable.** Common parameters have typed flags; anything exotic is reachable via `--param key=value` or `--json '{...}'`.
- **Clear failure signals.** Exit codes distinguish auth (`3`), insufficient credits (`4`), rate-limit (`5`), task-failed (`7`), timeout (`8`), and network (`9`), and the JSON `error.kind` mirrors them.

### Credits (approximate)

Preview text-to-3D ≈ 5 (meshy-5) to 20 (meshy-6 / low-poly); refine ≈ 10; image-to-3D ≈ 20–30; remesh / rig ≈ 5; animate ≈ 3; convert / resize ≈ 1; `analyze-printability` is free. Run `balance` before a large job; an exit code `4` means you're out of credits.

### What the Skill Will NOT Do

- Never spends credits on a non-trivial job without confirming with you first
- Never writes its own polling loop — the script owns the lifecycle
- Never hand-rolls base64 for images — local paths are encoded by the CLI
- Never requires an MCP server or any npm dependency

See the [SKILL.md reference](https://github.com/Flopsstuff/flugins/blob/main/plugins/meshy/skills/meshy/SKILL.md) and the bundled [`docs/api-reference.md`](https://github.com/Flopsstuff/flugins/blob/main/plugins/meshy/skills/meshy/docs/api-reference.md) for the full command and parameter specification.
11 changes: 11 additions & 0 deletions plugins/meshy/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "meshy",
"version": "0.1.0",
"description": "Generate 3D models, textures, rigs and animations from text or images via the Meshy AI API — a zero-dependency Node client wrapped in a skill",
"homepage": "https://github.com/Flopsstuff/flugins",
"author": {
"name": "Flop",
"email": "flopspm@gmail.com"
},
"keywords": ["meshy", "3d", "ai", "text-to-3d", "image-to-3d", "generative", "model-generation"]
}
66 changes: 66 additions & 0 deletions plugins/meshy/skills/meshy/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
name: meshy
description: Generate 3D assets from text or images via the Meshy AI API — text-to-3D and image-to-3D models, multi-image-to-3D, re-texturing, remeshing, auto-rigging, animation, 2D image generation, format conversion/resize/UV-unwrap, and 3D-printing prep. Use this skill whenever the user wants to create / generate / make a 3D model, mesh, or texture, turn a prompt or photo into 3D, rig or animate a character, check their Meshy credit balance, or otherwise mentions Meshy. Drives a bundled zero-dependency Node CLI; no MCP server needed.
disable-model-invocation: false
user-invocable: true
allowed-tools: >-
Read AskUserQuestion
Bash(node ${CLAUDE_SKILL_DIR}/scripts/*)
---

Generate 3D assets with the **Meshy AI** REST API through a bundled, zero-dependency Node CLI (`meshy.mjs`). The script handles auth, the async create→poll→download lifecycle, retries, and asset downloads; you just choose a command, run it, and parse its JSON output.

## Requirements (check before first use)

- **Node 18+** must be on PATH (`node --version`). If missing, tell the user to install Node — the script cannot run without it.
- An API key in **`$MESHY_AI_API_KEY`** (or `$MESHY_API_KEY`, or pass `--api-key`). Keys look like `msy_...` and are created at https://www.meshy.ai/settings/api. There is a free, no-cost **test key** `msy_dummy_api_key_for_test_mode_12345678` that returns sample assets without spending credits — use it for dry-runs.

## How to run it

```bash
node "${CLAUDE_SKILL_DIR}/scripts/meshy.mjs" <command> [options]
```

**Output contract — rely on this, don't re-read files:**
- **STDOUT** is exactly one JSON object. Parse it; never scrape the human text.
- **STDERR** carries progress lines (`[text-to-3d <id> IN_PROGRESS 42% • 30s]`) and warnings.
- **Exit codes:** `0` ok · `2` usage · `3` auth (no/invalid key) · `4` insufficient credits · `5` rate-limit · `6` not-found · `7` task failed · `8` poll timeout · `9` network · `130` interrupted.

The script **polls internally** until the task finishes — do **not** write your own polling loop. For very long jobs you may pass `--no-wait` (returns the `task_id` immediately) and later resume with `status` / `download`.

## Core workflow

1. **Pre-flight:** confirm `node` exists and a key is set. Optionally run `node "${CLAUDE_SKILL_DIR}/scripts/meshy.mjs" balance` to show remaining credits before spending.
2. **Pick the command** from the user's intent (see table below; full parameters in `docs/api-reference.md`).
3. **Run it.** Generation commands cost credits — for anything beyond a trivial request, briefly confirm with the user first, and prefer the **test key** when validating an approach.
4. **Always pass `--out <dir>`** when the user wants the asset saved — result URLs are signed and **expire within ~days**. Without `--out` the JSON still contains the URLs but nothing is downloaded.
5. **Parse the JSON**, then report: the `status`, where files were written (`downloads.written[].path`), `credits_consumed`, and any `downloads.skipped` / `downloads.errors`. On a non-zero exit, read `error.kind` / `error.message` and explain it (e.g. `credits` → out of credits, `auth` → key problem). If a long job was interrupted or timed out, the `task_id` in the output lets you resume with `download <type> <id> --out <dir>`.

## Commands (most common)

| Intent | Command |
|---|---|
| Text → 3D model | `text-to-3d --prompt "a red ceramic mug"` |
| Higher-quality textured pass | `refine --preview-task-id <id> --enable-pbr` |
| Image → 3D model | `image-to-3d --image ./photo.png` (local file is auto-base64'd) or `--image-url <url>` |
| Several images → 3D | `multi-image-to-3d --images a.png,b.png,c.png` |
| Re-texture a model | `retexture --input-task-id <id> --text-style-prompt "weathered bronze"` |
| Remesh (topology/polycount) | `remesh --input-task-id <id> --topology quad --target-polycount 20000` |
| Auto-rig a character | `rig --input-task-id <id>` |
| Animate a rigged model | `animate --rig-task-id <id> --action <action>` |
| Text → 2D image | `text-to-image --ai-model nano-banana --prompt "..."` |
| Convert / resize / UV-unwrap | `convert --input-task-id <id> --target-formats glb,fbx` · `resize` · `uv-unwrap` |
| Credit balance | `balance` |
| Task snapshot / resume | `status <type> <id>` (add `--wait` to block) |
| Download a finished task | `download <type> <id> --out <dir> [--all]` |
| Full help / catalog | `help` · `help --json` |

Useful options: `--out <dir>`, `--formats glb,fbx` (default `glb`), `--textures`/`--thumbnail`/`--all`, `--no-wait`, `--ai-model meshy-5|meshy-6|latest`, `--pretty`. Any API field not exposed as a flag is reachable via `--param key=value` or `--json '{...}'`.

## Notes & gotchas

- **Credits:** preview text-to-3d ≈ 5 (meshy-5) or up to 20 (meshy-6/lowpoly); refine ≈ 10; image-to-3d 20–30; rig/animate/remesh small. `analyze-printability` is free. Check `balance` if unsure; an exit code `4` means out of credits.
- **`meshy-5`** is the cheapest model for a quick text-to-3d preview; default `ai_model` is `latest`.
- **Don't hand-roll base64** for images — pass a local path to `--image` / `--images` / `--texture-image-url` and the CLI encodes it.
- **Creative Lab** (`creative-lab --product <keychain|fridge-magnet|figure|lamp> --stage prototype|build`) is experimental and thinly documented; rely on `--param`/`--json` for its body.
- For the complete endpoint/parameter reference, read **`docs/api-reference.md`** in this skill directory (`${CLAUDE_SKILL_DIR}/docs/api-reference.md`) — load it on demand, not every run.
Loading