cli

command module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 10, 2026 License: MIT Imports: 5 Imported by: 0

README ยถ

๐Ÿ”ฎ MoMorph CLI

Initialize MoMorph projects for AI-driven development

A command-line tool for initializing MoMorph projects during development. MoMorph CLI helps developers set up design-driven AI development environments by connecting UI designs with specifications, tests, and implementation through AI agent collaboration.

Go Version License


Table of Contents

๐Ÿค” What is MoMorph CLI?

MoMorph is an enterprise software development collaboration platform that leverages AI to connect the entire development process, with UI design as the central axis. It seamlessly integrates with AI agents to automate the loop of "Design โ†’ AI โ†’ Specifications โ†’ Tests โ†’ Implementation" in a flexible and continuous manner.

MoMorph CLI is the command-line tool that initializes MoMorph projects during the development phase. It sets up the necessary project structure, configurations, and workflows to enable design-driven AI development, helping teams eliminate information gaps and standardize development processes.

About MoMorph Platform

MoMorph enables:

  • Design-Driven Development: Start from UI designs in Figma and automatically generate specifications, test cases, and code
  • AI-Powered Collaboration: Seamlessly connect with AI coding assistants (GitHub Copilot, Cursor, Claude Code) throughout the development lifecycle
  • Comprehensive Integration: From specification generation to test case creation, code generation, and GitHub integration - all supported by AI
  • Multilingual Support: Suitable for multinational team development environments

Key Benefits of MoMorph CLI

  • Standardized Setup: Initialize projects with MoMorph's design-driven development structure
  • AI-Ready Configuration: Pre-configure prompts, rules, and agent modes for optimal AI collaboration
  • Quick Initialization: Set up complete MoMorph development environments in seconds
  • Multi-Platform: Works on macOS, Linux, and Windows
  • Version Control: Keep configurations synchronized with the latest MoMorph templates

โšก Get Started

1. Install MoMorph CLI

Choose your preferred installation method:

Option 1: Homebrew (macOS/Linux)
brew install momorph/tap/momorph-cli

Then use the tool directly:

# Login with GitHub
momorph login

# Initialize new MoMorph project
momorph init <PROJECT_NAME> --ai copilot

# Or initialize in existing project
momorph init . --ai cursor
Option 2: Chocolatey (Windows)
choco install momorph
Option 3: Shell Script (Linux/macOS)
curl -fsSL https://momorph.ai/cli/stable/install.sh | bash
Option 4: Go Install
go install github.com/momorph/cli@latest

Benefits of package manager installation:

  • Tool stays installed and available in PATH
  • Easy updates with package manager commands
  • Better dependency management
  • Cleaner system configuration
Verify setup

Check your account information and configuration:

# 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:

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:

# Initialize in a new directory
momorph init viblo --ai copilot

# Initialize in current directory
momorph init . --ai cursor

# Initialize without confirmation (force mode)
momorph init . --force --ai claude

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)

4. Environment Configuration (Optional)

By default, MoMorph CLI connects to the production MoMorph API. For development or testing purposes, you can configure the CLI to use different environments:

Using Staging Environment

Staging environment requires Basic Authentication in addition to GitHub token. Set up your environment variables:

# Set environment to staging
export MOMORPH_ENV=staging
# or
export MOMORPH_ENV=stg

# Set Basic Auth credentials (required for staging)
export MOMORPH_BASIC_AUTH_USERNAME=your_username
export MOMORPH_BASIC_AUTH_PASSWORD=your_password

# Now all commands will use staging API with Basic Auth
momorph login
momorph init my-project --ai copilot

For convenience and security, you can use a .env file:

# Copy the example file
cp .env.example .env

# Edit .env with your credentials
nano .env

# Load environment variables (bash/zsh)
source .env

# Or use with direnv (auto-loads when entering directory)
echo "dotenv" > .envrc
direnv allow

Important Security Notes:

  • โœ… .env is already in .gitignore - your credentials won't be committed
  • โœ… Basic Auth credentials are NEVER saved to disk config files
  • โœ… Credentials are only read from environment variables at runtime
  • โš ๏ธ Keep your .env file secure: chmod 600 .env
  • โš ๏ธ Never share or commit your .env file
  • โš ๏ธ Use different credentials for staging and production
Custom API Endpoint
# Use a custom API endpoint
export MOMORPH_API_ENDPOINT=https://custom.momorph.com

# Commands will now use the custom endpoint
momorph login
momorph init my-project --ai copilot
Available Environment Variables
Environment Variable Description Required Example Value
MOMORPH_ENV Predefined environment No staging, stg
MOMORPH_API_ENDPOINT Custom API endpoint URL No https://stg.momorph.com
MOMORPH_BASIC_AUTH_USERNAME Basic Auth username (staging only) For staging your_username
MOMORPH_BASIC_AUTH_PASSWORD Basic Auth password (staging only) For staging your_password

Environment Priority:

  1. MOMORPH_API_ENDPOINT (highest priority)
  2. MOMORPH_ENV
  3. Default production URL (lowest priority)

Authentication by Environment:

  • Production: GitHub OAuth โ†’ MoMorph Bearer Token
  • Staging: GitHub OAuth + Basic Auth (username/password)

Note: Basic Auth is only used in staging environment. Production uses standard Bearer token authentication.

  • The MOMORPH_API_ENDPOINT variable takes precedence over MOMORPH_ENV if both are set.
  • The MOMORPH_BASIC_AUTH variable is used for staging environments that require Basic Authentication instead of Bearer tokens.

๐Ÿค– Supported AI Agents

Agent Support Notes
GitHub Copilot โœ… Full support with custom prompts
Cursor ๐Ÿ”œ Coming soon
Claude Code ๐Ÿ”œ Coming soon

Currently, only GitHub Copilot is fully supported. Support for Cursor and Claude Code is coming soon. If you encounter issues, please open an issue.

๐Ÿ”ง MoMorph CLI Reference

The mm command supports the following operations:

Commands

Command Description
login Authenticate with GitHub using OAuth Device Flow
init Initialize a MoMorph project with AI agent configurations
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

Examples

# Basic project initialization
momorph init my-project

# Initialize with specific AI assistant
momorph init my-project --ai copilot
momorph init my-project --ai cursor
momorph init my-project --ai claude

# Initialize in current directory
momorph init . --ai copilot

# Force initialization without confirmation
momorph init . --force --ai cursor

# Check account information
momorph whoami

# Update CLI
momorph update

# Check version
momorph version

๐Ÿ’ป Development

Setup

# Clone repository
git clone https://github.com/momorph/cli.git
cd momorph-cli

# Install dependencies
go mod download

# Build
go run main.go -- <command>

Project Structure

momorph-cli/
โ”œโ”€โ”€ cmd/                 # CLI commands
โ”‚   โ”œโ”€โ”€ login.go
โ”‚   โ”œโ”€โ”€ init.go
โ”‚   โ”œโ”€โ”€ whoami.go
โ”‚   โ”œโ”€โ”€ update.go
โ”‚   โ”œโ”€โ”€ version.go
โ”‚   โ””โ”€โ”€ root.go
โ”œโ”€โ”€ internal/            # Internal packages
โ”‚   โ”œโ”€โ”€ auth/           # Authentication logic
โ”‚   โ”œโ”€โ”€ api/            # API client
โ”‚   โ”œโ”€โ”€ config/         # Configuration management
โ”‚   โ”œโ”€โ”€ template/       # Template management
โ”‚   โ””โ”€โ”€ ui/             # UI components
โ”œโ”€โ”€ pkg/                # Public packages
โ”œโ”€โ”€ go.mod
โ”œโ”€โ”€ go.sum
โ”œโ”€โ”€ main.go
โ””โ”€โ”€ README.md

Running Tests

go test ./...

# With coverage
go test -cover ./...

# Verbose output
go test -v ./...

Building for Release

# Create snapshot release
goreleaser release --snapshot --clean

# Build for all platforms
goreleaser build --snapshot --clean

๐Ÿ“„ License

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


Made with โค๏ธ by the MoMorph Team

Documentation ยถ

Overview ยถ

Copyright ยฉ 2025 Sun Asterisk Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Directories ยถ

Path Synopsis
internal
api
telemetry
Package telemetry provides opt-in analytics and telemetry collection.
Package telemetry provides opt-in analytics and telemetry collection.
ui

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL