nexlayer-cli

command module
v0.1.0-alpha.9 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2025 License: MIT Imports: 1 Imported by: 0

README ΒΆ

Nexlayer Logo

Nexlayer CLI

Deploy Full-Stack Applications in Seconds ⚑️

Go Report Card GoDoc License

πŸš€ Quick Start

# Install Nexlayer CLI
go install github.com/Nexlayer/nexlayer-cli@latest

Setting up your PATH

When you run go install, it places the Nexlayer CLI executable in a directory called ~/go/bin. However, your computer needs to know where to find this executable when you type nexlayer in the terminal. Here's how to set it up:

  1. First, add this line to your shell configuration file:

    export PATH=$PATH:~/go/bin
    
  2. The configuration file location depends on your shell:

    • For Bash: ~/.bashrc or ~/.bash_profile
    • For Zsh: ~/.zshrc
  3. After adding the line, either:

    • Restart your terminal, or
    • Run source ~/.bashrc (or source ~/.zshrc for Zsh)

Now you can run Nexlayer commands from any directory!

# Create a new project with intelligent stack detection
nexlayer init my-app

# Deploy your app with automatic validation
nexlayer deploy

That's it! Your app is live. Watch the demo β†’

Intelligent Project Configuration

Nexlayer uses advanced analysis to:

  • Detect your tech stack and dependencies
  • Configure appropriate container images
  • Set up health checks and environment variables
  • Validate your configuration against best practices

Development Mode

During development, you can use the watch command to automatically redeploy when files change:

# Start watching for changes
nexlayer watch

The watch command will monitor your project files and automatically trigger a redeployment whenever changes are detected.

✨ Features

  • πŸ€– AI-Powered Detection - Automatically analyze and configure your project
  • 🎯 Smart Templates - Production-ready templates for any stack
  • βœ… Built-in Validation - Ensure configurations meet best practices
  • πŸ”„ Live Sync - Keep configuration in sync with project changes
  • πŸš€ One-Command Deploy - Deploy full-stack apps instantly
  • πŸ“Š Real-Time Monitoring - Live logs and deployment status
  • πŸ‘€ Live Watch Mode - Auto-redeploy on file changes during development
  • πŸ”Œ Plugin System - Extend functionality with custom plugins

πŸ“ Templates

# Create a new project with an interactive template selector
nexlayer init my-app

AI/LLM Templates

  • langchain-nextjs - LangChain.js + Next.js
  • openai-node - OpenAI + Express + React
  • llama-py - Llama.cpp + FastAPI
  • More at nexlayer.dev/templates

Full-Stack Templates

  • mern - MongoDB + Express + React + Node.js
  • pern - PostgreSQL + Express + React + Node.js
  • mean - MongoDB + Express + Angular + Node.js

πŸ’» Commands

# Initialize a new or existing project
nexlayer init [name]

# Deploy your application
nexlayer deploy

# View status and logs
nexlayer status
nexlayer logs -f [pod]

# Validate configuration
nexlayer validate [file]        # Validate config file
nexlayer validate --strict      # Enable strict validation

# Keep config in sync
nexlayer sync

Full documentation at nexlayer.dev/docs

πŸ‘· Development

# Clone the repository
git clone https://github.com/Nexlayer/nexlayer-cli.git
cd nexlayer-cli

# Install dependencies
make setup

# Run tests and validation
make test

# Run specific test suites
go test ./pkg/validation -v  # Run validation tests
go test ./pkg/compose -v     # Run compose tests

Code Organization

  • pkg/validation/ - YAML schema validation and component type checking
  • pkg/compose/ - Docker compose generation and component detection
  • pkg/core/ - Core functionality and API types
  • pkg/commands/ - CLI command implementations

## πŸ’ͺ Contributing

We love contributions! See our [Contributing Guide](CONTRIBUTING.md) for details.

## πŸ“œ License

Nexlayer CLI is [MIT licensed](LICENSE).

Documentation ΒΆ

Overview ΒΆ

Package main is the entry point for the Nexlayer CLI application. It initializes and executes the root command, which sets up all subcommands and their respective functionality.

Jump to

Keyboard shortcuts

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