@animaapp/cli 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 +134 -0
- package/dist/index.js +1167 -0
- package/dist/index.js.map +1 -0
- package/package.json +55 -0
package/README.md
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# @animaapp/cli
|
|
2
|
+
|
|
3
|
+
CLI for generating production-ready apps from prompts, URLs, or Figma designs.
|
|
4
|
+
|
|
5
|
+
Works with any AI coding tool that can run shell commands — no MCP setup, no plugins, just `npx`.
|
|
6
|
+
|
|
7
|
+
## Quick Start
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# One-time: save your tokens
|
|
11
|
+
npx @animaapp/cli auth --token <anima-token>
|
|
12
|
+
npx @animaapp/cli auth --figma-token <figma-token>
|
|
13
|
+
|
|
14
|
+
# Create an app from a prompt
|
|
15
|
+
npx @animaapp/cli create -t p2c -p "SaaS dashboard with sidebar and analytics"
|
|
16
|
+
|
|
17
|
+
# Clone a website
|
|
18
|
+
npx @animaapp/cli create -t l2c -u https://stripe.com
|
|
19
|
+
|
|
20
|
+
# Convert Figma to code
|
|
21
|
+
npx @animaapp/cli codegen --file-key <figma-url> -o ./components
|
|
22
|
+
|
|
23
|
+
# Publish to a live URL
|
|
24
|
+
npx @animaapp/cli publish <sessionId>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Authentication
|
|
28
|
+
|
|
29
|
+
Get your Anima API token at [dev.animaapp.com](https://dev.animaapp.com) > Settings > API Keys.
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
# Store tokens (persisted to ~/.config/anima/credentials.json)
|
|
33
|
+
npx @animaapp/cli auth --token <anima-token>
|
|
34
|
+
npx @animaapp/cli auth --figma-token <figma-token>
|
|
35
|
+
|
|
36
|
+
# Or use environment variables
|
|
37
|
+
export ANIMA_API_TOKEN=<token>
|
|
38
|
+
export FIGMA_TOKEN=<token>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Priority: env var > stored credentials file.
|
|
42
|
+
|
|
43
|
+
## Commands
|
|
44
|
+
|
|
45
|
+
### `create` — Generate a playground (3-7 min)
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
# Prompt to Code
|
|
49
|
+
npx @animaapp/cli create -t p2c -p "E-commerce product page with cart"
|
|
50
|
+
|
|
51
|
+
# Link to Code (clone a website)
|
|
52
|
+
npx @animaapp/cli create -t l2c -u https://linear.app
|
|
53
|
+
|
|
54
|
+
# Figma to Code
|
|
55
|
+
npx @animaapp/cli create -t f2c --file-key <key> --nodes 42:15
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Options: `--framework` (react|html), `--styling` (tailwind|css|inline_styles), `--language` (typescript|javascript), `--ui-library` (shadcn|mui|antd|clean_react)
|
|
59
|
+
|
|
60
|
+
### `publish` — Deploy to live URL (1-3 min)
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
npx @animaapp/cli publish <sessionId>
|
|
64
|
+
npx @animaapp/cli publish <sessionId> --mode designSystem --package-name my-ds
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### `codegen` — Figma to local files
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
npx @animaapp/cli codegen --file-key <key-or-url> --nodes 42:15 -o ./components
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Requires a Figma personal access token (stored via `auth --figma-token` or `FIGMA_TOKEN` env var).
|
|
74
|
+
|
|
75
|
+
### `download` — Download playground project
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
npx @animaapp/cli download https://dev.animaapp.com/chat/<sessionId> -o ./my-project
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### `auth` — Manage credentials
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
npx @animaapp/cli auth --token <T> # Save Anima token
|
|
85
|
+
npx @animaapp/cli auth --figma-token <T> # Save Figma token
|
|
86
|
+
npx @animaapp/cli auth --status # Check what's configured
|
|
87
|
+
npx @animaapp/cli auth --logout # Clear all credentials
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Output Modes
|
|
91
|
+
|
|
92
|
+
- **Terminal (TTY):** Colored text with spinner and progress
|
|
93
|
+
- **Piped (AI tools):** Single JSON object to stdout
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
# AI tool usage — parse JSON output
|
|
97
|
+
npx @animaapp/cli create -t p2c -p "dashboard" --json 2>/dev/null | jq .playgroundUrl
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Progress is streamed to stderr with `--verbose`.
|
|
101
|
+
|
|
102
|
+
## Timing
|
|
103
|
+
|
|
104
|
+
| Command | Duration |
|
|
105
|
+
|---------|----------|
|
|
106
|
+
| `create` | 3-7 minutes |
|
|
107
|
+
| `publish` | 1-3 minutes |
|
|
108
|
+
| `codegen` | 2-5 minutes |
|
|
109
|
+
| `download` | seconds |
|
|
110
|
+
|
|
111
|
+
The `--timeout` default is 600,000ms (10 min). Do not reduce it.
|
|
112
|
+
|
|
113
|
+
## Exit Codes
|
|
114
|
+
|
|
115
|
+
| Code | Meaning |
|
|
116
|
+
|------|---------|
|
|
117
|
+
| 0 | Success |
|
|
118
|
+
| 1 | API error |
|
|
119
|
+
| 2 | Auth error |
|
|
120
|
+
| 3 | Validation error |
|
|
121
|
+
| 4 | Timeout |
|
|
122
|
+
|
|
123
|
+
## Development
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
npm install
|
|
127
|
+
npm run build # tsup → dist/index.js
|
|
128
|
+
npm test # vitest (35 tests)
|
|
129
|
+
npm run typecheck # tsc --noEmit
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## License
|
|
133
|
+
|
|
134
|
+
MIT
|