moley

command module
v2.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2025 License: MIT Imports: 4 Imported by: 0

README ΒΆ

Moley Logo

Latest Release Go Reference Homebrew License Build Status

Moley

Expose your localhost applications to the internet using Cloudflare Tunnels.

Moley is a powerful CLI tool that simplifies exposing your localhost applications to the internet using Cloudflare Tunnels. With Moley, you can share your local development servers on your own custom domain without complex port forwarding or expensive tunnel services.

πŸ’° Why Cloudflare Tunnels?

Free Professional Infrastructure - While other tunnel services charge $5-20+/month or offer limited free tiers, Cloudflare Tunnels are completely free with full features. Combined with a personal domain (~€10/year), you get professional-grade capabilities that would cost significantly more with alternatives:

Feature Cloudflare Tunnels + Domain
Annual Cost ~€10/year (domain only)
Custom Domains βœ… Your own domain
DDoS Protection βœ… Robust protection included
Reliability βœ… Enterprise-grade uptime
Zero Trust Security βœ… Cloudflare Access
Bandwidth βœ… Unlimited
SSL/TLS βœ… Automatic certificates

Bottom line: For less than €1/month, you get what other services charge €20+/month for. Cloudflare Tunnels combined with Zero Trust features provide enterprise-grade security and performance that would require multiple paid subscriptions elsewhere.

✨ Key Benefits

πŸ’° Cost-Effective

No monthly subscriptions. Just your domain (~€10/year).

πŸ” Zero Trust Security

Built-in access control, authentication, and user management through Cloudflare's platform.

🏒 Enterprise Infrastructure

DDoS protection, automatic SSL certificates, and reliable uptime.

⚑ Simple Setup

One command to expose localhost. No complex configuration or manual DNS management.

πŸ“¦ Installation

brew install --cask stupside/tap/moley
Go Install
go install github.com/stupside/moley@latest
Manual Download

Download the latest binary from the releases page.

πŸš€ Quick Start

  1. Authentication

    # Authenticate cloudflared with your account
    cloudflared tunnel login
    
    # Option 1: Set API token in config file
    moley config set --cloudflare.token="your-api-token"
    
    # Option 2: Use environment variable (recommended for CI/CD)
    export MOLEY_CLOUDFLARE_TOKEN="your-api-token"
    
  2. Initialize your project

    moley tunnel init
    
  3. Configure your apps

    # Option 1: Edit the generated moley.yml file
    # Option 2: Use environment variables (great for containers/CI)
    export MOLEY_TUNNEL_INGRESS_ZONE="yourdomain.com"
    export MOLEY_TUNNEL_INGRESS_APPS_0_TARGET_PORT="8080"
    export MOLEY_TUNNEL_INGRESS_APPS_0_EXPOSE_SUBDOMAIN="api"
    
  4. Start tunneling

    # Foreground mode
    moley tunnel run
    
    # Background mode
    moley tunnel run --detach
    
    # Or run with everything configured via environment variables
    MOLEY_CLOUDFLARE_TOKEN="token" MOLEY_TUNNEL_INGRESS_ZONE="yourdomain.com" moley tunnel run
    

Your app is now accessible at https://api.yourdomain.com! πŸŽ‰

πŸ’‘ Pro tip: Environment variables take precedence over config files and are perfect for CI/CD, Docker containers, and keeping secrets secure.

πŸ“š Documentation

For complete documentation including configuration options, troubleshooting, and advanced usage, visit our documentation site.

πŸ› οΈ Development

Prerequisites
Building from Source
git clone https://github.com/stupside/moley.git
cd moley
go mod download
go build -o moley .
Contributing

We welcome contributions! Please see our Contributing Guide for details.

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

Documentation ΒΆ

The Go Gopher

There is no documentation for this package.

Directories ΒΆ

Path Synopsis
cmd
internal
core/application/tunnel
Package tunnel provides tunnel orchestration functionality.
Package tunnel provides tunnel orchestration functionality.
core/domain
Package domain provides core domain models for Moley.
Package domain provides core domain models for Moley.
core/ports
Package ports declares provider-agnostic interfaces.
Package ports declares provider-agnostic interfaces.
platform/adapters/cloudflare
Package cloudflare provides Cloudflare-specific implementations.
Package cloudflare provides Cloudflare-specific implementations.
platform/framework
Package framework provides resource lifecycle management.
Package framework provides resource lifecycle management.
platform/infrastructure/logger
Package logger provides structured logging for Moley.
Package logger provides structured logging for Moley.
platform/infrastructure/paths
Package paths provides utilities for managing file system paths in Moley.
Package paths provides utilities for managing file system paths in Moley.
shared
Package shared provides common utilities used across Moley.
Package shared provides common utilities used across Moley.
version
Package version provides build-time version information.
Package version provides build-time version information.

Jump to

Keyboard shortcuts

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