An open API service indexing awesome lists of open source software.

https://github.com/momorph/cli

MoMorph CLI
https://github.com/momorph/cli

ai-driven-development momorph

Last synced: 3 months ago
JSON representation

MoMorph CLI

Awesome Lists containing this project

README

          


MoMorph CLI


Transform Figma designs into production-ready code



Go Version
License

---

## Table of Contents

- [Table of Contents](#table-of-contents)
- [🤔 What is MoMorph CLI?](#-what-is-momorph-cli)
- [⚡ Getting Started](#-getting-started)
- [1. Install MoMorph CLI](#1-install-momorph-cli)
- [2. Authenticate with GitHub](#2-authenticate-with-github)
- [3. Initialize your MoMorph project](#3-initialize-your-momorph-project)
- [🚀 MoMorph Commands](#-momorph-commands)
- [Context Commands](#context-commands)
- [Gen Code Commands](#gen-code-commands)
- [E2E Testing Commands](#e2e-testing-commands)
- [🔧 MoMorph CLI Reference](#-momorph-cli-reference)
- [Upload Commands](#upload-commands)
- [Shell Completion](#shell-completion)
- [📄 License](#-license)

## 🤔 What is MoMorph CLI?

MoMorph CLI is a command-line tool (CLI) used to initialize, manage, and operate projects following an AI-Driven Development approach, where Figma design serves as the starting point of the entire software development lifecycle.

MoMorph helps transform:

> **Design → Specs → Test Cases → Code**

into an automated, consistent, and repeatable workflow, powered by AI.

## ⚡ Getting Started

### 1. Install MoMorph CLI

Choose your preferred installation method:

Option 1: Homebrew (macOS, Linux) (Recommended)

```sh
brew install momorph/tap/momorph-cli
```

Then use the tool directly:

```sh
momorph version
```

**Benefits of package manager installation:**
- Tool stays installed and available in PATH
- Easy updates with package manager commands
- Better dependency management
- Cleaner system configuration

Option 2: Chocolatey (Windows)

```sh
choco install momorph-cli
```

Option 3: PowerShell (Windows)

```powershell
irm https://raw.githubusercontent.com/momorph/cli/refs/heads/main/scripts/install.ps1 | iex
```

Option 4: Shell Script (Linux/macOS)

```sh
curl -fsSL https://raw.githubusercontent.com/momorph/cli/refs/heads/main/scripts/install.sh | bash
```

Option 5: Go Install

```sh
go install github.com/momorph/cli@latest
```

Verify setup

Check your account information and configuration:

```bash
# Display current account info
momorph whoami

# Check CLI version
momorph version
```

### 2. Authenticate with GitHub

Launch MoMorph CLI and authenticate using GitHub OAuth Device Flow:

```bash
momorph login
```

The CLI will display a user code and authentication link. Open the link in your browser and enter the code to complete authentication.

### 3. Initialize your MoMorph project

Use the `momorph init` command to set up a MoMorph project with design-driven AI development workflow:

```bash
momorph init new-directory # Initialize in a new directory
momorph init . # Initialize in current directory

momorph init . --ai copilot # Copilot
momorph init . --ai claude # Claude Code
momorph init . --ai cursor # Cursor
momorph init . --ai windsurf # Windsurf
```

The CLI will:
- Download the latest MoMorph project template from backend
- Extract configuration files (`.claude`, `.github`, prompt files, workflow scripts, etc.)
- Set up the project structure for design-driven AI development
- Configure AI agent integration for the specified assistant (`Copilot`, `Cursor`, or `Claude Code`)

After that, enjoy using MoMorph commands in the next section! 🚀🚀🚀

## 🚀 MoMorph Commands

In addition to the CLI commands, **MoMorph provides a set of AI-agent workflow commands**, designed to guide the AI-Driven Development process from specification to implementation.

> ⚠️ **Note:**
> - These are **workflow commands used within the MoMorph flow with AI agents**, not CLI commands.
> - They operate on templates and prompts generated by `momorph init`.

### Context Commands

/momorph.specs - Generate specifications for a screen

**Purpose:** Generate specifications for a screen based on the Figma design image and associated screen metadata.

**Input:** Figma Design (Figma File Key, Frame ID)

**Output:** File: `.momorph/specs/[screen-name].csv`

**Example Command:**
```
Generate specs based on the following Figma design items:
1. Signin – fileKey: `i09vM3jClQiu8cwXsMo6uy`, frameId: `9276:19531`
```

/momorph.createtestcases - Generate test cases CSV

**Purpose:** Generate a CSV file containing a list of test cases for the specified screen based on the specs imported into MoMorph.

**Input:** Figma Design (Figma File Key, Frame ID)

**Output:** File: `.momorph/testcases/{file_key}/{frame_id}-{frame-name}.csv`

**Example Command:**
```
Generate test cases based on the following Figma design items:
1. Signin – fileKey: `i09vM3jClQiu8cwXsMo6uy`, frameId: `9276:19531`
```

/momorph.updatetestcases - Update existing test cases

**Purpose:** Update existing test cases to match the latest version of the specifications.

**Input:** Figma Design (Figma File Key, Frame ID)

**Output:** File: `.momorph/testcases/{file_key}/{frame_id}-{frame-name}.csv`

**Example Command:**
```
Update test cases based on the following Figma design items:
1. Signin – fileKey: `i09vM3jClQiu8cwXsMo6uy`, frameId: `9276:19531`
```

/momorph.database - Generate database schemas

**Purpose:** Analyze Figma screens to design database schemas, generate SQL schema, ERD (Mermaid), and database analysis documentation.

**Input:** Figma File Key, Frame ID (Optional)

**Output:**
1. `.momorph/contexts/DATABASE_ANALYSIS.md` – Screen analysis
2. `.momorph/contexts/database-schema.sql` – SQL schema
3. `.momorph/contexts/DATABASE_DESIGN.mmd` – ERD diagram

**Example Command:**
```
Generate database schemas for the Figma design items:
1. Signin – fileKey: `i09vM3jClQiu8cwXsMo6uy`
```

/momorph.apispecs - Generate OpenAPI specifications

**Purpose:** Generate OpenAPI specifications (`api-docs.yaml`) and backend test cases from Figma designs — defining endpoints, schemas, and functional tests.

**Input:** Figma File Key, Frame ID

**Output:** Controllers and Routes files generated for all specified APIs. Route handler implementations are left empty.

**Example Command:**
```
Generate API specs for the following Figma design items:
1. Signin – fileKey: `i09vM3jClQiu8cwXsMo6uy`, frameId: `9276:19531`
```

---

### Gen Code Commands

/momorph.constitution - Initialize project constitution

**Purpose:** Initialize or update the project "constitution" (`.momorph/constitution.md`) containing technical standards, coding rules, folder structure, and governance policies.

**Input:** A short description of rules, coding standards, conventions, etc.

**Output:** `.momorph/constitution.md`

**Example Command:**
```
Generate constitution
```

/momorph.specify - Generate feature specifications from Figma

**Purpose:** Generate feature specifications from a Figma frame — produces `spec.md` (user stories, acceptance criteria) and `design-style.md` (tokens, CSS, node IDs) as sources for implementation.

**Input:** Figma File Key, Frame ID

**Output:**
1. Path: `.momorph/specs/{frameid-name}/spec.md`
2. Path: `.momorph/specs/{frameid-name}/design-style.md`

**Example Command:**
```
Build specifications for the project based on the following Figma design items:
1. Signin – fileKey: `i09vM3jClQiu8cwXsMo6uy`, frameId: `9276:19531`
```

/momorph.plan - Generate implementation plan

**Purpose:** Generate a detailed implementation plan from specs (architecture, files to create/modify, dependencies, strategy) and hand off to `momorph.tasks`.

**Input:** Figma File Key, Frame ID

**Output:** Path: `.momorph/specs/{frameid-name}/plan.md`

**Example Command:**
```
Plan for the following Figma design items:
1. Signin – fileKey: `i09vM3jClQiu8cwXsMo6uy`, frameId: `9276:19531`
```

/momorph.tasks - Break down plan into tasks

**Purpose:** Break down the plan into executable tasks (`tasks.md`) by user story, with detailed checklists, dependencies, and parallelization hints.

**Input:** Figma File Key, Frame ID

**Output:** Path: `.momorph/specs/{frameid-name}/tasks.md`

**Example Command:**
```
Break tasks for the following Figma design items:
1. Signin – fileKey: `i09vM3jClQiu8cwXsMo6uy`, frameId: `9276:19531`
```

/momorph.implement - Execute implementation

**Purpose:** "Implementation mode" — execute tasks, write code following the constitution and design-style, run tests, and ensure pixel-perfect UI alignment with Figma.

**Input:** Figma File Key, Frame ID

**Output:**
- Backend source code
- Frontend source code
- Unit test source code

**Example Command:**
```
Execute the implementation plan by processing and executing all tasks defined for the following Figma design items:
1. Signin – fileKey: `i09vM3jClQiu8cwXsMo6uy`, frameId: `9276:19531`
```

/momorph.commit - Create Git commits

**Purpose:** Create Git commits from the current diff following Conventional Commits rules; split commits if needed to match commit types.

**Input:** No input required

**Output:** New commit(s) created

**Example Command:**
```
/momorph.commit
```

or

```
/momorph.commit only staged files
```

---

### E2E Testing Commands

/momorph.setupe2e - Set up E2E testing environment

**Purpose:** Automatically set up and generate an E2E testing environment using Playwright (run once only).

**Input:** Figma File Key, Frame ID

**Output:** A fully initialized E2E test folder

**Example Command:**
```
Set up a Playwright project for me.

```

/momorph.writee2e - Generate Playwright E2E tests

**Purpose:** Automatically generate Playwright E2E tests (after test code review is available).

**Input:**
1. Figma File Key, Frame ID
2. URL of the screen to be tested

**Output:** Complete Playwright E2E test code for the specified screen

**Example Command:**
```
fileKey: `i09vM3jClQiu8cwXsMo6uy`
signup frame_link_id: "9276:19630"

URL: ...
```

/momorph.reviewe2e - Review E2E test code

**Purpose:** Automatically review generated E2E test code.

**Input:** (Optional) Specific screen or test file

**Output:** Review report of the generated E2E tests. May include fixes if bugs or test failures are found.

**Example Command:**
```
Review the E2E test code for me.

```

## 🔧 MoMorph CLI Reference

The `momorph` command supports the following operations:

| Command | Description |
| ------------------ | ----------------------------------------------------------- |
| `login` | Authenticate with GitHub using OAuth Device Flow |
| `init` | Initialize a MoMorph project with AI agent configurations |
| `upload testcases` | Upload test case CSV files to MoMorph server |
| `upload specs` | Upload spec CSV files to MoMorph server |
| `whoami` | Display current account information and subscription status |
| `update` | Update MoMorph CLI to the latest version |
| `version` | Show MoMorph CLI version information |
| `help` | Display help information |

### Upload Commands

Upload specs and test cases from local CSV files to the MoMorph server.

momorph upload testcases - Upload test cases to server

**Purpose:** Upload test case CSV files generated by `/momorph.createtestcases` to the MoMorph server.

**File Path Pattern:**
```
.momorph/testcases/{file_key}/{frame_id}-{frame_name}.csv
```

**Usage:**
```bash
# Upload a single file
momorph upload testcases .momorph/testcases/xxx/yyy.csv

# Upload multiple files
momorph upload testcases file1.csv file2.csv

# Upload all testcases in a directory recursively
momorph upload testcases --dir .momorph/testcases/ -r

# Dry run (preview without uploading)
momorph upload testcases --dry-run .momorph/testcases/**/*.csv
```

**Flags:**
| Flag | Description |
| --------------------- | --------------------------------------------- |
| `-d, --dir` | Directory to search for CSV files |
| `-r, --recursive` | Search directories recursively |
| `--dry-run` | Show what would be uploaded without uploading |
| `--continue-on-error` | Continue uploading if one file fails |

momorph upload specs - Upload specs to server

**Purpose:** Upload spec CSV files generated by `/momorph.specs` to the MoMorph server.

**File Path Pattern:**
```
.momorph/specs/{file_key}/{frame_id}-{frame_name}.csv
```

**Usage:**
```bash
# Upload a single file
momorph upload specs .momorph/specs/xxx/yyy.csv

# Upload multiple files
momorph upload specs file1.csv file2.csv

# Upload all specs in a directory recursively
momorph upload specs --dir .momorph/specs/ -r

# Dry run (preview without uploading)
momorph upload specs --dry-run .momorph/specs/**/*.csv
```

**Flags:**
| Flag | Description |
| --------------------- | --------------------------------------------- |
| `-d, --dir` | Directory to search for CSV files |
| `-r, --recursive` | Search directories recursively |
| `--dry-run` | Show what would be uploaded without uploading |
| `--continue-on-error` | Continue uploading if one file fails |

### Shell Completion

MoMorph CLI supports shell completion for bash, zsh, fish, and powershell.

Bash

```bash
# Load completions in current session
source <(momorph completion bash)

# Load completions permanently (Linux)
momorph completion bash > /etc/bash_completion.d/momorph

# Load completions permanently (macOS with Homebrew)
momorph completion bash > $(brew --prefix)/etc/bash_completion.d/momorph
```

> **Note:** Requires the `bash-completion` package to be installed.

Zsh

```bash
# Enable shell completion (if not already enabled)
echo "autoload -U compinit; compinit" >> ~/.zshrc

# Load completions in current session
source <(momorph completion zsh)

# Load completions permanently (Linux)
momorph completion zsh > "${fpath[1]}/_momorph"

# Load completions permanently (macOS with Homebrew)
momorph completion zsh > $(brew --prefix)/share/zsh/site-functions/_momorph
```

Fish

```fish
# Load completions in current session
momorph completion fish | source

# Load completions permanently
momorph completion fish > ~/.config/fish/completions/momorph.fish
```

PowerShell

```powershell
# Load completions in current session
momorph completion powershell | Out-String | Invoke-Expression

# Load completions permanently
momorph completion powershell > momorph.ps1
# Then add ". momorph.ps1" to your PowerShell profile
```

## 📄 License

This project is licensed under the terms of the MIT open source license. Please refer to the [LICENSE](LICENSE) file for the full terms.

---

Made with ❤️ by the MoMorph Team