diff --git a/README.md b/README.md new file mode 100644 index 0000000..84bf288 --- /dev/null +++ b/README.md @@ -0,0 +1,245 @@ +# ๐ Hive CLI + +
+A powerful CLI tool for managing, running and exposing your applications. +
+ ++ +[](https://github.com/HiveSofts/hive-cli/actions) +[](https://github.com/HiveSofts/hive-cli/releases) + +
+ + +--- + +## ๐ About Hive + +Hive CLI is a developer-focused command line tool designed to simplify local development workflows. + +It helps you initialize projects, manage environments, run services, handle secrets, view logs and expose local applications with a simple command. + +Built with Rust for speed, reliability and cross-platform support. + +--- + +## โจ Features + +- ๐ Project initialization +- โก Fast command execution +- ๐ฅ Environment management +- ๐ Secrets management +- ๐ Logs management +- ๐ Local application runner +- ๐ Public tunnel exposure +- ๐ฆ Project registry +- ๐ฉบ Environment diagnostics +- ๐ฅ Cross-platform support + + +--- + +## ๐ฆ Installation + + +### Linux / macOS + +```bash +curl -fsSL https://raw.githubusercontent.com/HiveSofts/hive-cli/main/install/install.sh | bash +```` + +### Windows + +PowerShell: + +```powershell +irm https://raw.githubusercontent.com/HiveSofts/hive-cli/main/install/install.ps1 | iex +``` + +Verify installation: + +```bash +hive --version +``` + +--- + +## ๐ Usage + +Initialize Hive in your project: + +```bash +hive init +``` + +Run application: + +```bash +hive run +``` + +Run specific script: + +```bash +hive run dev +``` + +Check project status: + +```bash +hive status +``` + +Manage environment: + +```bash +hive env +``` + +Manage secrets: + +```bash +hive secrets +``` + +Expose local service: + +```bash +hive expose +``` + +View logs: + +```bash +hive logs +``` + +--- + +## ๐ Commands + +| Command | Description | +| ------------ | ---------------------------------- | +| `init` | Initialize Hive in current project | +| `run` | Run project scripts | +| `logs` | View application logs | +| `env` | Manage environment variables | +| `secrets` | Manage secrets | +| `expose` | Create public tunnel | +| `status` | Show project information | +| `projects` | Manage registered projects | +| `scripts` | Manage project scripts | +| `doctor` | Check system requirements | +| `completion` | Generate shell completion | + +--- + +## โ๏ธ Project Structure + +After initialization: + +``` +your-project/ + +โโโ .hive/ +โ +โโโ config.yml +โโโ .env +โโโ .secrets +โโโ logs/ +``` + +Hive stores project configuration inside `.hive` and keeps your development environment organized. + +--- + +## ๐ Development + +Clone repository: + +```bash +git clone git@github.com:HiveSofts/hive-cli.git + +cd hive-cli +``` + +Build: + +```bash +cargo build +``` + +Run: + +```bash +cargo run -- --help +``` + +Release build: + +```bash +cargo build --release +``` + +--- + +## ๐งช Supported Platforms + +| Platform | Status | +| -------- | ------ | +| Linux | โ | +| Windows | โ | +| macOS | ๐ง | + +--- + +## ๐ฃ Roadmap + +* [x] Hive Init +* [x] Hive Run +* [x] Hive Env +* [x] Hive Secrets +* [x] Hive Logs +* [x] Hive Expose foundation +* [x] Automatic releases +* [ ] Cloud tunnel service +* [ ] Team collaboration +* [ ] Plugin system +* [ ] Package manager + +--- + +## ๐ค Contributing + +Contributions are welcome. + +Before submitting a pull request: + +```bash +cargo fmt +cargo test +cargo clippy +``` + +--- + +## ๐ License + +MIT License + +--- + +## ๐ HiveSofts + +Built with โค๏ธ and Rust by HiveSofts. + +``` +github.com/HiveSofts/hive-cli +``` + +``` diff --git a/install/install.ps1 b/install/install.ps1 new file mode 100644 index 0000000..485bd81 --- /dev/null +++ b/install/install.ps1 @@ -0,0 +1,101 @@ +$ErrorActionPreference = "Stop" + + +$Repo = "HiveSofts/hive-cli" +$Binary = "hive.exe" + + +Write-Host "" +Write-Host "๐ Hive CLI Installer" +Write-Host "โโโโโโโโโโโโโโโโโโโโ" +Write-Host "" + + +$Release = Invoke-RestMethod ` +"https://api.github.com/repos/$Repo/releases/latest" + + +$Version = $Release.tag_name + + +Write-Host "Version: $Version" +Write-Host "" + + +$Asset = "hive-windows.exe" + + +$DownloadUrl = ` +"https://github.com/$Repo/releases/download/$Version/$Asset" + + + +$temp = Join-Path ` +$env:TEMP ` +$Binary + + + +Write-Host "โฌ๏ธ Downloading Hive..." + +Invoke-WebRequest ` +-Uri $DownloadUrl ` +-OutFile $temp + + + +$InstallDir = "$env:USERPROFILE\.hive\bin" + + +if (!(Test-Path $InstallDir)) { + New-Item ` + -ItemType Directory ` + -Path $InstallDir | Out-Null +} + + + +$Target = Join-Path ` +$InstallDir ` +$Binary + + + +Move-Item ` +-Force ` +$temp ` +$Target + + + +Write-Host "" +Write-Host "โ๏ธ Updating PATH..." + + + +$currentPath = [Environment]::GetEnvironmentVariable( +"Path", +"User" +) + + +if ($currentPath -notlike "*$InstallDir*") { + + [Environment]::SetEnvironmentVariable( + "Path", + "$currentPath;$InstallDir", + "User" + ) + +} + + + +Write-Host "" +Write-Host "โ Hive installed successfully" +Write-Host "" + +Write-Host "Restart terminal then run:" +Write-Host "" + +Write-Host " hive --help" diff --git a/install/install.sh b/install/install.sh new file mode 100644 index 0000000..109e72c --- /dev/null +++ b/install/install.sh @@ -0,0 +1,105 @@ +#!/usr/bin/env bash + +set -e + +REPO="HiveSofts/hive-cli" +BINARY="hive" + +INSTALL_DIR="/usr/local/bin" + +VERSION=$(curl -s https://api.github.com/repos/$REPO/releases/latest \ +| grep '"tag_name":' \ +| sed -E 's/.*"([^"]+)".*/\1/') + +if [ -z "$VERSION" ]; then + echo "โ Failed to detect latest Hive version" + exit 1 +fi + + +echo "" +echo "๐ Hive CLI Installer" +echo "โโโโโโโโโโโโโโโโโโโโ" +echo "Version: $VERSION" +echo "" + + +OS="$(uname -s)" +ARCH="$(uname -m)" + + +case "$OS" in + Linux) + PLATFORM="linux" + ;; + + Darwin) + PLATFORM="macos" + ;; + + *) + echo "โ Unsupported operating system" + exit 1 + ;; +esac + + +case "$ARCH" in + x86_64) + ARCH="x86_64" + ;; + + aarch64|arm64) + ARCH="aarch64" + ;; + + *) + echo "โ Unsupported architecture: $ARCH" + exit 1 + ;; +esac + + +ASSET="hive-$PLATFORM" + + +DOWNLOAD_URL="https://github.com/$REPO/releases/download/$VERSION/$ASSET" + + +echo "โฌ๏ธ Downloading Hive..." +echo "$DOWNLOAD_URL" + + +TMP=$(mktemp) + + +curl -L "$DOWNLOAD_URL" -o "$TMP" + + +chmod +x "$TMP" + + +echo "" +echo "๐ฆ Installing Hive..." + + +if [ -w "$INSTALL_DIR" ]; then + mv "$TMP" "$INSTALL_DIR/$BINARY" +else + sudo mv "$TMP" "$INSTALL_DIR/$BINARY" +fi + + +echo "" +echo "โ Hive installed successfully" +echo "" + +echo "Version:" +hive --version || true + +echo "" + +echo "Run:" +echo " hive --help" + +echo "" \ No newline at end of file