### Starting Base application server Source: https://github.com/basetechstack/basecmd/blob/main/README.md This command starts the Base application server in its default configuration. It launches the application, making it accessible for development and testing without any special features like hot reloading or documentation generation. ```bash base start ``` -------------------------------- ### Starting Base application with Swagger documentation Source: https://github.com/basetechstack/basecmd/blob/main/README.md This command starts the Base application server and simultaneously generates Swagger documentation. The `-d` or `--docs` option ensures that the API documentation is updated and available, which is useful for API development and consumption. ```bash base start -d ``` -------------------------------- ### Installing Base CLI on Windows via Git Bash Source: https://github.com/basetechstack/basecmd/blob/main/README.md This snippet provides an alternative installation method for the Base CLI tool on Windows, specifically for users utilizing Git Bash. It leverages `curl` to download and execute the `install.sh` script, similar to the macOS/Linux installation. ```bash curl -sSL https://raw.githubusercontent.com/base-go/cmd/main/install.sh | bash ``` -------------------------------- ### Installing Base CLI on Windows via PowerShell Source: https://github.com/basetechstack/basecmd/blob/main/README.md This PowerShell command facilitates the installation of the Base CLI tool on Windows. It bypasses execution policy for the current process, sets the security protocol, and then downloads and executes the `install.ps1` script from the Base GitHub repository, which handles the installation process. ```powershell Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/base-go/cmd/main/install.ps1')) ``` -------------------------------- ### Installing Base CLI on macOS/Linux via curl Source: https://github.com/basetechstack/basecmd/blob/main/README.md This snippet provides the standard installation command for the Base CLI tool on macOS and Linux systems. It downloads and executes the `install.sh` script directly from the GitHub repository, setting up the Base CLI for general use. ```bash curl -sSL https://raw.githubusercontent.com/base-go/cmd/main/install.sh | bash ``` -------------------------------- ### Creating a new Base project Source: https://github.com/basetechstack/basecmd/blob/main/README.md This command initializes a new project using the Base framework. It sets up the basic project structure and necessary files, allowing developers to quickly start a new Base application. The `` parameter specifies the desired name for the new project directory. ```bash base new myapp ``` -------------------------------- ### Starting Base application with hot reloading and Swagger documentation Source: https://github.com/basetechstack/basecmd/blob/main/README.md This command combines hot reloading and Swagger documentation generation when starting the Base application server. Using both `-r` and `-d` options provides a comprehensive development environment, allowing for rapid iteration and up-to-date API documentation. ```bash base start -r -d ``` -------------------------------- ### Installing Base CLI on macOS/Linux to protected directory Source: https://github.com/basetechstack/basecmd/blob/main/README.md This command is used for installing the Base CLI tool in system-protected directories like `/usr/local/bin` on macOS and Linux. It uses `sudo` to grant necessary permissions for the installation script to write to these locations. ```bash curl -sSL https://raw.githubusercontent.com/base-go/cmd/main/install.sh | sudo bash ``` -------------------------------- ### Starting Base application with hot reloading Source: https://github.com/basetechstack/basecmd/blob/main/README.md This command starts the Base application server with hot reloading enabled. The `-r` or `--hot-reload` option integrates `air` to monitor code changes and automatically restart the server, significantly speeding up the development feedback loop. ```bash base start -r ``` -------------------------------- ### Generating a module with basic and image fields Source: https://github.com/basetechstack/basecmd/blob/main/README.md This example demonstrates generating a `post` module with a `title` (string) and a `cover` (image) field. It showcases how to define basic text fields and specialized attachment types like `image` during module generation, which includes built-in validation for image files. ```bash base g post title:string cover:image ``` -------------------------------- ### Generating a module with basic and file attachment fields Source: https://github.com/basetechstack/basecmd/blob/main/README.md This example illustrates generating a `document` module with a `title` (string) and a `file` attachment field. It highlights the use of the `file` type for general document attachments, which also comes with predefined validation rules for file size and extensions. ```bash base g document title:string file:file ``` -------------------------------- ### Displaying Base CLI version information Source: https://github.com/basetechstack/basecmd/blob/main/README.md This command displays the current version information of the Base CLI tool. It is useful for verifying the installed version and for debugging compatibility issues. ```bash base version ``` -------------------------------- ### Generating a Category model for a blog system Source: https://github.com/basetechstack/basecmd/blob/main/README.md This command generates a `Category` model with various fields including `name`, `description`, `image` attachment, a `parent` self-referencing `belongsTo` relationship, and a `posts` `hasMany` relationship to the `Post` model. This defines the structure for organizing blog posts into categories. ```bash base g Category \ name:string \ description:text \ image:attachment \ parent:belongsTo:Category \ posts:hasMany:Post ``` -------------------------------- ### Generating a Post model for a blog system Source: https://github.com/basetechstack/basecmd/blob/main/README.md This command generates a `Post` model with fields like `title`, `content`, `excerpt`, `featured_image`, `gallery` attachments, `published_at` datetime, and `author` and `category` `belongsTo` relationships. It also includes a `comments` `hasMany` relationship, defining the core structure of a blog post. ```bash base g Post \ title:string \ content:text \ excerpt:text \ featured_image:attachment \ gallery:attachment \ published_at:datetime \ author:belongsTo:users.User \ category:belongsTo:Category \ comments:hasMany:Comment ``` -------------------------------- ### Generating a Tag model for a blog system Source: https://github.com/basetechstack/basecmd/blob/main/README.md This command generates a `Tag` model with `name` and `slug` fields. Tags are typically used for categorizing content in a more flexible, many-to-many fashion, allowing posts to be associated with multiple tags. ```bash base g Tag \ name:string \ slug:string ``` -------------------------------- ### Generating a Comment model for a blog system Source: https://github.com/basetechstack/basecmd/blob/main/README.md This command generates a `Comment` model with `content`, `author` (belongs to `users.User`), and `post` (belongs to `Post`) fields. This model defines the structure for user comments associated with specific blog posts. ```bash base g Comment \ content:text \ author:belongsTo:users.User \ post:belongsTo:Post ``` -------------------------------- ### Generating a new Base module Source: https://github.com/basetechstack/basecmd/blob/main/README.md This command is used to generate a new module within a Base project. It supports defining fields with their types and relationships, automating the creation of model files, API endpoints, and other related components. The `` specifies the name of the module, and `[field:type ...]` defines its attributes. ```bash base g [field:type ...] [options] ``` -------------------------------- ### Updating Base framework core components Source: https://github.com/basetechstack/basecmd/blob/main/README.md This command updates the core components of the Base framework within an existing project. It ensures that the project utilizes the latest stable versions of the framework's dependencies and internal modules, keeping the application up-to-date with improvements and bug fixes. ```bash base update ``` -------------------------------- ### Upgrading Base CLI tool Source: https://github.com/basetechstack/basecmd/blob/main/README.md This command upgrades the Base command-line interface (CLI) tool itself to its latest version. It ensures that the CLI tool has access to the newest features, commands, and bug fixes, independent of any specific Base project. ```bash base upgrade ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.