framlit-mcp 0.1.1 → 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 CHANGED
@@ -1,8 +1,8 @@
1
- # Framlit MCP
1
+ # Framlit MCP + CLI
2
2
 
3
- MCP (Model Context Protocol) server for [Framlit](https://framlit.app) - AI-powered video generation.
3
+ MCP server and CLI for [Framlit](https://framlit.app) AI-powered video generation.
4
4
 
5
- Generate Remotion videos directly from your IDE using natural language.
5
+ Generate Remotion videos from your IDE or terminal using natural language.
6
6
 
7
7
  ## Features
8
8
 
@@ -11,6 +11,9 @@ Generate Remotion videos directly from your IDE using natural language.
11
11
  - **Project Management**: Create, list, and update Framlit projects
12
12
  - **Video Rendering**: Render videos to MP4 via AWS Lambda
13
13
  - **Templates**: Browse and use video templates
14
+ - **Narration**: AI-generated voiceover with ElevenLabs TTS
15
+ - **Style Variations**: Generate multiple visual styles from one prompt
16
+ - **Batch Rendering**: Render multiple videos at once with variable substitution
14
17
 
15
18
  ## Installation
16
19
 
@@ -22,12 +25,13 @@ Generate Remotion videos directly from your IDE using natural language.
22
25
  ### Get Your API Key
23
26
 
24
27
  1. Go to [Framlit Settings](https://framlit.app/settings/api-keys)
25
- 2. Click "Create API Key"
26
- 3. Copy the key (you'll only see it once!)
28
+ 2. Click "Create Key" and copy the key (you'll only see it once!)
27
29
 
28
- ### Configure in Cursor
30
+ ### MCP Server (IDE Integration)
29
31
 
30
- Add to your Cursor settings (`.cursor/mcp.json`):
32
+ Add to your editor's MCP config:
33
+
34
+ **Cursor** (`.cursor/mcp.json`), **Claude Desktop** (`claude_desktop_config.json`), **VS Code** (MCP settings), **Windsurf** (MCP settings):
31
35
 
32
36
  ```json
33
37
  {
@@ -43,43 +47,77 @@ Add to your Cursor settings (`.cursor/mcp.json`):
43
47
  }
44
48
  ```
45
49
 
46
- Or install globally:
50
+ ### CLI (Terminal)
47
51
 
48
52
  ```bash
53
+ # Use directly via npx
54
+ npx framlit generate "A logo animation with rotating 3D text"
55
+
56
+ # Or install globally
49
57
  npm install -g framlit-mcp
58
+ framlit generate "Product demo with fade-in text"
50
59
  ```
51
60
 
52
- ## Usage
61
+ ## CLI Usage
53
62
 
54
- Once configured, you can use Framlit tools in Cursor:
63
+ ```bash
64
+ # Generate video code
65
+ framlit generate "Logo animation with rotating text" --format landscape
55
66
 
56
- ### Generate Video Code
67
+ # Modify existing code
68
+ framlit modify --code ./video.tsx --instruction "Change background to blue"
57
69
 
58
- ```
59
- Create a 3D logo animation with the text "HELLO" rotating in space
60
- ```
70
+ # Manage projects
71
+ framlit projects list
72
+ framlit projects get <id>
73
+ framlit projects create "My Video" --code ./video.tsx
74
+ framlit projects update <id> --name "New Name"
61
75
 
62
- The AI will use `framlit_generate_code` to generate Remotion code.
76
+ # Render video
77
+ framlit render <projectId>
78
+ framlit render status <renderId> --poll # Stream progress as NDJSON
63
79
 
64
- ### Modify Existing Code
80
+ # Browse templates
81
+ framlit templates --category social
65
82
 
66
- ```
67
- Change the background color to blue and make the text larger
68
- ```
83
+ # Preview code
84
+ framlit preview ./video.tsx
69
85
 
70
- Uses `framlit_modify_code` with your existing code.
86
+ # Check credits
87
+ framlit credits
71
88
 
72
- ### Manage Projects
89
+ # Discover tool schemas (agent-friendly)
90
+ framlit schema # List all tools
91
+ framlit schema framlit_generate_code # JSON Schema for a specific tool
73
92
 
74
- ```
75
- List my Framlit projects
76
- Create a new project called "Product Demo"
93
+ # Start MCP server from CLI
94
+ framlit mcp
77
95
  ```
78
96
 
79
- ### Render Video
97
+ ### Agent-Friendly Features
80
98
 
81
- ```
82
- Render the project to MP4
99
+ The CLI is designed to work seamlessly with AI agents:
100
+
101
+ - **`--output json`**: Structured JSON output (auto-enabled when piped)
102
+ - **`--json '{"prompt":"..."}'`**: Raw JSON input, bypass arg parsing
103
+ - **`--dry-run`**: Preview mutations without executing
104
+ - **`framlit schema <tool>`**: Runtime schema introspection (Zod → JSON Schema)
105
+ - **`--poll`**: NDJSON streaming for render progress tracking
106
+
107
+ ### Full Render Workflow
108
+
109
+ ```bash
110
+ # 1. Generate code
111
+ framlit generate "Product demo video" --output json > code.json
112
+
113
+ # 2. Create a project
114
+ framlit projects create "Product Demo" --code ./generated.tsx --output json
115
+
116
+ # 3. Start render
117
+ framlit render <projectId> --output json
118
+
119
+ # 4. Poll until complete
120
+ framlit render status <renderId> --poll
83
121
  ```
84
122
 
85
123
  ## Available Tools
@@ -89,27 +127,40 @@ Render the project to MP4
89
127
  | `framlit_generate_code` | Generate Remotion code from text | 1 |
90
128
  | `framlit_modify_code` | Modify existing code | 1 |
91
129
  | `framlit_list_projects` | List your projects | 0 |
92
- | `framlit_get_project` | Get project details | 0 |
130
+ | `framlit_get_project` | Get project details with code | 0 |
93
131
  | `framlit_create_project` | Create a new project | 0 |
94
132
  | `framlit_update_project` | Update a project | 0 |
95
133
  | `framlit_render_video` | Start video rendering | 0 |
96
134
  | `framlit_get_render_status` | Check render progress | 0 |
97
135
  | `framlit_list_templates` | Browse templates | 0 |
98
136
  | `framlit_get_credits` | Check credit balance | 0 |
137
+ | `framlit_preview_code` | Create temporary preview URL | 0 |
99
138
 
100
139
  ## Pricing
101
140
 
102
- MCP uses the same credit system as the Framlit web app:
141
+ MCP and CLI use the same credit system as the Framlit web app:
142
+
143
+ - **Hobby (Free)**: 30 credits/month
144
+ - **Pro**: 500 credits/month ($29/mo)
145
+ - **Team**: 2,000 credits/month ($99/mo)
146
+ - **Credit Packs**: 100 for $6 / 350 for $19 / 700 for $35
103
147
 
104
- - **Free Plan**: 50 credits/month
105
- - **Pro Plan**: 500 credits/month ($29/mo)
106
- - **Credit Packs**: Available for purchase
148
+ ### Credit Costs
107
149
 
108
- Each code generation or modification costs 1 credit.
150
+ | Action | Credits |
151
+ |--------|---------|
152
+ | Text-to-Code generation | 1 |
153
+ | Code modification | 1 |
154
+ | Image analysis | 3 |
155
+ | Narration (voiceover) | 5 |
156
+ | Style variation | 1 |
157
+ | Batch rendering (per video) | 0.2 |
158
+ | MP4 rendering | 0 |
159
+ | Preview | 0 |
109
160
 
110
161
  ### Watermark
111
162
 
112
- - Free/Hobby plans: Videos include a Framlit watermark
163
+ - Hobby plan: Videos include a Framlit watermark
113
164
  - Pro/Team plans: No watermark
114
165
 
115
166
  [View Pricing](https://framlit.app/pricing)
@@ -120,14 +171,20 @@ Each code generation or modification costs 1 credit.
120
171
  # Install dependencies
121
172
  npm install
122
173
 
123
- # Run in development mode
174
+ # Run MCP server in development mode
124
175
  npm run dev
125
176
 
177
+ # Run CLI in development mode
178
+ npm run dev:cli -- generate "test"
179
+
126
180
  # Build
127
181
  npm run build
128
182
 
129
- # Test locally
183
+ # Test MCP server locally
130
184
  FRAMLIT_API_KEY=fml_xxx npm start
185
+
186
+ # Test CLI locally
187
+ FRAMLIT_API_KEY=fml_xxx npm run start:cli -- credits
131
188
  ```
132
189
 
133
190
  ## Environment Variables
@@ -140,8 +197,9 @@ FRAMLIT_API_KEY=fml_xxx npm start
140
197
  ## Resources
141
198
 
142
199
  - [Framlit Website](https://framlit.app)
200
+ - [Developer Guide](https://framlit.app/developers)
143
201
  - [Documentation](https://framlit.app/docs)
144
- - [Pricing](https://framlit.app/pricing)
202
+ - [Pricing](https://framlit.app/docs/pricing)
145
203
  - [API Key Settings](https://framlit.app/settings/api-keys)
146
204
 
147
205
  ## License
@@ -21,7 +21,7 @@ class FramlitClient {
21
21
  headers: {
22
22
  'Authorization': `Bearer ${this.apiKey}`,
23
23
  'Content-Type': 'application/json',
24
- 'User-Agent': 'framlit-mcp/0.1.0',
24
+ 'User-Agent': 'framlit-mcp/0.2.0',
25
25
  ...options.headers,
26
26
  },
27
27
  });
@@ -0,0 +1,26 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Framlit CLI
4
+ *
5
+ * Human-friendly and agent-friendly CLI for Framlit.
6
+ * Shares core logic with the MCP server.
7
+ *
8
+ * Usage:
9
+ * framlit generate <prompt> [--format landscape|portrait|square] [--output json|text] [--dry-run]
10
+ * framlit modify --code <code|file> --instruction <text> [--output json|text] [--dry-run]
11
+ * framlit projects list [--output json|text]
12
+ * framlit projects get <id>
13
+ * framlit projects create <name> --code <code|file> [--format landscape|portrait|square] [--dry-run]
14
+ * framlit projects update <id> [--name <name>] [--code <code|file>] [--dry-run]
15
+ * framlit render <projectId> [--dry-run]
16
+ * framlit render status <renderId> [--poll] [--output json|text]
17
+ * framlit templates [--category <cat>] [--official]
18
+ * framlit preview <code|file>
19
+ * framlit credits [--output json|text]
20
+ * framlit schema [tool-name]
21
+ * framlit mcp
22
+ * framlit version
23
+ * framlit help
24
+ */
25
+ export {};
26
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;GAsBG"}