### Install Dependencies and Start Full Flavor Server Source: https://github.com/happier-dev/happier/blob/dev/apps/server/README.md Installs project dependencies, starts Dockerized database and S3 services, applies migrations, and then starts the development server. Use this for the full local development environment. ```bash yarn install # Start dependencies yarn db yarn redis yarn s3 yarn s3:init # Apply migrations (uses ".env.dev") yarn migrate # Start the server (loads ".env.dev") PORT=3005 yarn dev ``` -------------------------------- ### Setup Happier from Source (Guided) Source: https://github.com/happier-dev/happier/blob/dev/apps/stack/README.md Use this command to start the guided setup process for developing Happier from its source code. It helps configure your workspace and bootstrap the project. ```bash npx --yes -p @happier-dev/stack hstack setup-from-source --profile=dev ``` -------------------------------- ### Quickstart Remote Daemon Setup Source: https://github.com/happier-dev/happier/blob/dev/apps/docs/content/docs/hstack/remote-daemon.mdx Use this command to install Happier CLI and set up the remote daemon on a host via SSH. Assumes Happier is already authenticated locally. ```bash hstack remote daemon setup --ssh user@host ``` -------------------------------- ### Install Dependencies and Start Light Flavor Server Source: https://github.com/happier-dev/happier/blob/dev/apps/server/README.md Installs dependencies and starts the development server using the light flavor, which defaults to SQLite and local files, avoiding Docker. It runs light migrations before starting. ```bash yarn install # Runs light migrations for the selected provider before starting (SQLite by default) PORT=3005 yarn dev:light ``` -------------------------------- ### Install direnv and Setup Project Source: https://github.com/happier-dev/happier/blob/dev/apps/cli/CONTRIBUTING.md Instructions for installing the direnv utility and configuring it for automatic environment switching within the project directory. ```bash # macOS brew install direnv # Add to your shell (bash/zsh) eval "$(direnv hook bash)" # or zsh ``` ```bash cp .envrc.example .envrc direnv allow ``` -------------------------------- ### Quickstart Remote Server Setup Source: https://github.com/happier-dev/happier/blob/dev/apps/docs/content/docs/hstack/remote-server.mdx Use this command for a quick setup of the Happier Self-Host Server on a remote host via SSH. It defaults to the stable channel, user mode, and standard environment settings. ```bash hstack remote server setup --ssh user@host ``` -------------------------------- ### Maintainer Quickstart: Install and Run PR Stack Source: https://github.com/happier-dev/happier/blob/dev/apps/stack/README.md Maintainer-friendly entrypoint to install and run a PR stack. It is safe to re-run and keeps the PR stack wiring intact. ```bash npx --yes -p @happier-dev/stack hstack tools setup-pr \ --repo=https://github.com/happier-dev/happier/pull/123 \ --dev ``` -------------------------------- ### Start interactive monorepo port guide Source: https://github.com/happier-dev/happier/blob/dev/apps/docs/content/docs/hstack/monorepo-port.mdx Initiates an interactive guide for porting commits. This method is recommended for most users as it requires a TTY and provides step-by-step assistance. ```bash hstack monorepo port guide ``` -------------------------------- ### Run hstack Dev Setup Wizard Source: https://github.com/happier-dev/happier/blob/dev/apps/docs/content/docs/hstack/isolated-linux-vm.mdx Sets up a development workspace from source, cloning repositories and installing dependencies. Use `--bind=loopback` for local development. ```bash npx --yes -p @happier-dev/stack@latest hstack setup-from-source --profile=dev --bind=loopback ``` -------------------------------- ### Maintainer Quickstart: Enable Expo Dev-Client Source: https://github.com/happier-dev/happier/blob/dev/apps/stack/README.md Optional: enables Expo dev-client for mobile reviewers when using setup-pr. Works with both default --dev and --start. ```bash npx --yes -p @happier-dev/stack hstack tools setup-pr --repo=123 --dev --mobile ``` -------------------------------- ### Global Happier CLI Setup Source: https://github.com/happier-dev/happier/blob/dev/apps/docs/content/docs/hstack/stacks.mdx Recommended command to set up from source, which installs shims/runtime and bootstraps the monorepo. A deprecated alias `hstack setup` also exists. ```bash hstack setup-from-source ``` -------------------------------- ### Install and Enable OS Service for Autostart Source: https://github.com/happier-dev/happier/blob/dev/apps/docs/content/docs/deployment/repo-local.mdx Installs and enables an OS service to automatically run `hstack start` in the background. This ensures the Happier stack is running even after a system reboot. ```bash yarn service:install yarn service:enable ``` -------------------------------- ### Start Local Server Source: https://github.com/happier-dev/happier/blob/dev/apps/docs/content/docs/hstack/tauri.mdx Starts the local server required before launching the built Tauri app. Alternatively, install the service if needed. ```bash hstack start ``` -------------------------------- ### Run Worker and API Replicas with Redis Adapter Source: https://github.com/happier-dev/happier/blob/dev/apps/server/README.md Example demonstrating how to start a worker process and multiple API replicas for a production-like test environment. Requires Redis to be running. ```bash # Worker (no HTTP server; publishes events via Redis adapter; runs background loops) SERVER_ROLE=worker HAPPIER_SOCKET_ADAPTER=redis-streams REDIS_URL=redis://127.0.0.1:6379 METRICS_PORT=0 yarn start # API replicas (different PORTs on the same host; put a load balancer in front in real deployments) SERVER_ROLE=api HAPPIER_SOCKET_ADAPTER=redis-streams REDIS_URL=redis://127.0.0.1:6379 PORT=3005 METRICS_PORT=0 yarn start SERVER_ROLE=api HAPPIER_SOCKET_ADAPTER=redis-streams REDIS_URL=redis://127.0.0.1:6379 PORT=3006 METRICS_PORT=0 yarn start ``` -------------------------------- ### Copy Example Local Env File Source: https://github.com/happier-dev/happier/blob/dev/apps/docs/content/docs/development/app-env.mdx Copy the example local environment file to start customizing local settings. Ensure you restart the dev server after editing. ```bash cd apps/ui cp .env.local.example .env.local ``` -------------------------------- ### Setup with Preview Release Channel Source: https://github.com/happier-dev/happier/blob/dev/apps/docs/content/docs/hstack/remote-server.mdx Installs the Happier Self-Host Server using the preview release channel. Use this if you want to test newer public binaries before they are marked stable. ```bash hstack remote server setup --ssh user@host --channel preview ``` -------------------------------- ### Setup Remote Daemon with Preview Channel Source: https://github.com/happier-dev/happier/blob/dev/apps/docs/content/docs/hstack/remote-daemon.mdx Installs the Happier CLI and sets up the remote daemon using the preview release channel. ```bash hstack remote daemon setup --ssh user@host --channel preview ``` -------------------------------- ### Initiate Android Build Source: https://github.com/happier-dev/happier/blob/dev/apps/docs/content/docs/hstack/mobile-ios.mdx Starts an Android build process. Use `--non-interactive` for automated builds after initial setup. ```bash hstack stack eas happier android --profile production --no-wait --non-interactive ``` -------------------------------- ### Legacy Setup Alias Source: https://github.com/happier-dev/happier/blob/dev/apps/docs/content/docs/hstack/setup.mdx This is a deprecated alias for setting up the self-host profile. Use `setup-from-source` or `self-host install` instead. ```bash hstack setup --profile=selfhost ``` ```bash hstack setup-from-source --profile=selfhost ``` -------------------------------- ### Start Qwen with Happier Source: https://github.com/happier-dev/happier/blob/dev/apps/docs/content/docs/providers/qwen.mdx Launch Qwen models within the Happier environment using the command line interface. Ensure Qwen is installed and configured correctly. ```bash happier qwen ``` -------------------------------- ### Install Kimi using hstack Source: https://github.com/happier-dev/happier/blob/dev/apps/docs/content/docs/providers/kimi.mdx Use the hstack providers installer to install Kimi. Verify the installation by checking the Kimi version. ```bash hstack providers install kimi kimi --version ``` -------------------------------- ### Initiate iOS Build Source: https://github.com/happier-dev/happier/blob/dev/apps/docs/content/docs/hstack/mobile-ios.mdx Starts an iOS build process. Use `--interactive` for initial credential setup, and `--non-interactive` for subsequent builds. ```bash hstack stack eas happier ios --profile production --interactive ``` ```bash hstack stack eas happier ios --profile production --no-wait --non-interactive ``` -------------------------------- ### Setup with Development Release Channel Source: https://github.com/happier-dev/happier/blob/dev/apps/docs/content/docs/hstack/remote-server.mdx Installs the Happier Self-Host Server using the development release channel. This is for the latest, potentially unstable, development builds. ```bash hstack remote server setup --ssh user@host --channel dev ``` -------------------------------- ### Install Qwen with hstack Source: https://github.com/happier-dev/happier/blob/dev/apps/docs/content/docs/providers/qwen.mdx Use the hstack providers installer to install Qwen. Verify the installation by checking the Qwen version. ```bash hstack providers install qwen qwen --version ``` -------------------------------- ### Developer Quickstart: Create PR Stack Source: https://github.com/happier-dev/happier/blob/dev/apps/stack/README.md Creates or reuses a named stack for a PR, checks out the monorepo PR worktree, optionally seeds auth, and starts the stack. Re-run with --reuse to update existing worktrees when the PR changes. ```bash hstack stack pr pr123 \ --repo=https://github.com/happier-dev/happier/pull/123 \ --seed-auth --copy-auth-from=dev-auth --link-auth \ --dev ``` -------------------------------- ### Setup Remote Daemon with Preview Channel (Shortcut) Source: https://github.com/happier-dev/happier/blob/dev/apps/docs/content/docs/hstack/remote-daemon.mdx A shortcut command to install Happier CLI and set up the remote daemon using the preview release channel. ```bash hstack remote daemon setup --ssh user@host --preview ``` -------------------------------- ### Setup with System Service Mode Source: https://github.com/happier-dev/happier/blob/dev/apps/docs/content/docs/hstack/remote-server.mdx Installs the Happier Self-Host Server as a system-managed service using `sudo`. This mode may require a password and is suitable for system-wide service requirements. ```bash hstack remote server setup --ssh user@host --mode system ``` -------------------------------- ### Install Kilo CLI using npm Source: https://github.com/happier-dev/happier/blob/dev/apps/docs/content/docs/providers/kilo.mdx Install the Kilo CLI globally using npm. Ensure you restart Happier after installation. Verify the installation by checking the version. ```bash npm install -g @kilocode/cli@latest kilo --version ``` -------------------------------- ### Install OpenCode on Windows using npm Source: https://github.com/happier-dev/happier/blob/dev/apps/docs/content/docs/providers/opencode.mdx Install OpenCode on Windows using npm and verify the installation. ```bash npm install -g opencode-ai opencode --version ``` -------------------------------- ### Install GitHub Copilot CLI with hstack Source: https://github.com/happier-dev/happier/blob/dev/apps/docs/content/docs/providers/copilot.mdx Use the hstack providers installer to install the Copilot CLI. Verify the installation by checking the version. ```bash hstack providers install copilot copilot --version ``` -------------------------------- ### Setup with Release Channel Shortcuts Source: https://github.com/happier-dev/happier/blob/dev/apps/docs/content/docs/hstack/remote-server.mdx Provides alternative, shorter flags for specifying the release channel during remote server setup. Use `--preview` for the preview channel and `--dev` for the development channel. ```bash hstack remote server setup --ssh user@host --preview ``` ```bash hstack remote server setup --ssh user@host --dev ``` ```bash hstack remote server setup --ssh user@host --stable ``` -------------------------------- ### Skip Daemon Service Installation Source: https://github.com/happier-dev/happier/blob/dev/apps/docs/content/docs/hstack/remote-daemon.mdx Installs only the Happier CLI and authenticates the remote host without installing or starting the daemon service. ```bash hstack remote daemon setup --ssh user@host --service none ``` -------------------------------- ### Setup from source (deprecated) Source: https://github.com/happier-dev/happier/blob/dev/apps/docs/content/docs/hstack/cli-reference.mdx This command is a deprecated alias for setting up the project from source. Use the newer, more specific commands where possible. ```bash hstack setup-from-source --profile=dev|selfhost ``` -------------------------------- ### Install Happier CLI (Node-free) Source: https://github.com/happier-dev/happier/blob/dev/apps/docs/content/docs/getting-started/onboarding.mdx Installs the Happier CLI binary using the official installer script. This is the recommended Node-free method for CLI setup. ```bash curl -fsSL https://happier.dev/install | bash happier auth login ``` -------------------------------- ### Add and Use a New Server Source: https://github.com/happier-dev/happier/blob/dev/apps/cli/README.md Add a new server configuration with specified URLs and then log in to that server. Use this for multi-server quickstarts. ```bash happier server add --name company --server-url https://api.company.example --webapp-url https://app.company.example --use happier --server company auth login ``` -------------------------------- ### Install Happier CLI Source: https://github.com/happier-dev/happier/blob/dev/apps/cli/README.md Install the Happier CLI globally using npm. This command is used for initial setup. ```bash npm install -g @happier-dev/cli ``` -------------------------------- ### Install MCP Daemon as User Service Source: https://github.com/happier-dev/happier/blob/dev/apps/docs/content/docs/clients/mcp.mdx Recommended for an always-on setup, this command installs the MCP daemon as a user service. ```bash happier daemon install ``` -------------------------------- ### Install Dependencies with Yarn Source: https://github.com/happier-dev/happier/blob/dev/apps/docs/content/docs/getting-started/local-development.mdx Run this command to install project dependencies using Yarn. This is part of the legacy manual setup. ```bash yarn install ``` -------------------------------- ### Install shared dev-client (iOS) Source: https://github.com/happier-dev/happier/blob/dev/apps/docs/content/docs/advanced/custom-mobile-build.mdx Installs the shared development client on iOS using hstack helpers. This is a one-time setup. ```bash hstack mobile-dev-client --install ``` -------------------------------- ### Restart Happier Server (From-Source Installs) Source: https://github.com/happier-dev/happier/blob/dev/apps/docs/content/docs/deployment/proxmox.mdx Commands to restart the Happier server for from-source installations, with options for system mode or manual start. ```bash su - happier -c "/home/happier/.happier-stack/bin/hstack service restart --mode=system" ``` ```bash su - happier -c "/home/happier/.happier-stack/bin/hstack start --restart" ``` -------------------------------- ### Set Up Dev Stack Using Canonical 'dev/' Checkout Source: https://github.com/happier-dev/happier/blob/dev/apps/docs/content/docs/hstack/development.mdx Create a new stack named 'dev' and pin it to the canonical 'dev/' worktree. Then, launch the development server using the TUI, with an option to include the mobile dev-client. ```bash hstack stack new dev hstack stack wt dev -- use dev hstack tui stack dev dev # (optional) mobile dev-client + QR: hstack tui stack dev dev --mobile ``` -------------------------------- ### Start Local Development Server Source: https://github.com/happier-dev/happier/blob/dev/docs/deployment.md Run the local development server. Load local settings using .env or .env.dev files. Ensure these files are correctly configured for your environment. ```bash yarn workspace @happier-dev/server dev ``` -------------------------------- ### Build and Install iOS App (with device) Source: https://github.com/happier-dev/happier/blob/dev/apps/stack/docs/mobile-ios.md Builds and installs the iOS app on a specified device, without starting the Metro bundler. This is useful for testing release configurations. ```bash hstack mobile --prebuild --run-ios --device="Your iPhone" ``` -------------------------------- ### Install and Open Menu Bar App Source: https://github.com/happier-dev/happier/blob/dev/apps/stack/README.md Installs the SwiftBar menu bar application and opens it. ```bash hstack menubar install hstack menubar open ``` -------------------------------- ### Install Happier Relay Server as a System Service Source: https://github.com/happier-dev/happier/blob/dev/README.md Installs the Happier relay server as a system service on your computer. Use this for a self-hosted setup accessible via Tailscale Serve. ```bash happier relay host install --mode system ``` -------------------------------- ### Install Dev-Client with Device and Clean Options Source: https://github.com/happier-dev/happier/blob/dev/apps/docs/content/docs/hstack/mobile-ios.mdx Optional flags for installing the dev-client, allowing you to specify a device name or perform a clean installation. ```bash hstack mobile-dev-client --install --device="Your iPhone" ``` ```bash hstack mobile-dev-client --install --clean ``` -------------------------------- ### Install and Build Happier from Source Source: https://github.com/happier-dev/happier/blob/dev/README.md Follow these steps to clone the repository, install dependencies, build the project, and activate the CLI for local execution. ```bash npm i -g yarn git clone https://github.com/happier-dev/happier.git cd happier yarn yarn build yarn cli:activate yarn tui ``` -------------------------------- ### Dry Run Daemon Service Installation Source: https://github.com/happier-dev/happier/blob/dev/apps/docs/content/docs/clients/daemon.mdx Perform a dry run of the Happier daemon service installation. This allows you to preview the setup process without making actual changes. ```bash happier daemon service install --dry-run ``` -------------------------------- ### Maintainer Quickstart: Run in Sandbox Source: https://github.com/happier-dev/happier/blob/dev/apps/stack/README.md Optional: runs the PR stack in a sandbox folder. Uses a persistent sandbox workspace cache by default, which can be customized or disabled. ```bash SANDBOX="$(mktemp -d /tmp/hstack-review-pr.XXXXXX)" npx --yes -p @happier-dev/stack hstack tools review-pr --repo=123 --dev --sandbox-dir "$SANDBOX" rm -rf "$SANDBOX" ``` -------------------------------- ### Quick Start Development Source: https://github.com/happier-dev/happier/blob/dev/apps/docs/content/docs/deployment/repo-local.mdx Navigate to the Happier monorepo and run the development server. This is the primary command for starting a local development environment. ```bash cd /path/to/happier yarn dev ``` -------------------------------- ### Manage Service Installation Source: https://github.com/happier-dev/happier/blob/dev/apps/docs/content/docs/deployment/repo-local.mdx Install the service unit/plist after building the UI. Use `--mode=user` for explicit user-mode or `--mode=system` for Linux system-mode. ```bash yarn service:install ``` ```bash yarn service:install --mode=user ``` ```bash yarn service:install --mode=system ``` -------------------------------- ### Tauri Manual QA Automation (MCP) Commands Source: https://github.com/happier-dev/happier/blob/dev/apps/ui/CONTRIBUTING.md Commands for running the Tauri app with the MCP server for manual QA. Includes starting the app and server together, starting a driver session, and installing the MCP server into Codex. ```bash # Starts the Tauri app and the MCP server together for manual QA. yarn tauri:qa # Starts a driver session against the default plugin port (9223) yarn tauri:mcp:session:start # Installs the MCP server into Codex’ MCP config npx -y install-mcp @hypothesi/tauri-mcp-server --client codex ``` -------------------------------- ### Example Docker Run with Env File Source: https://github.com/happier-dev/happier/blob/dev/apps/docs/content/docs/deployment/docker.mdx This example demonstrates how to run the Happier server using an environment file for configuration, which is a cleaner approach than listing many -e flags. ```bash cp apps/server/.env.example .env docker run --env-file .env -p 3005:3005 happier-server ``` -------------------------------- ### Set SwiftBar Refresh Interval at Install Source: https://github.com/happier-dev/happier/blob/dev/apps/docs/content/docs/hstack/menubar.mdx Configure the default refresh interval for the SwiftBar menu bar plugin during installation by setting the HAPPIER_STACK_SWIFTBAR_INTERVAL environment variable. For example, setting it to '15m' will make the menu refresh every 15 minutes. ```bash HAPPIER_STACK_SWIFTBAR_INTERVAL=15m hstack menubar install ``` -------------------------------- ### Launch Stack with Runtime or Source Source: https://github.com/happier-dev/happier/blob/dev/apps/docs/content/docs/hstack/running.mdx Commands to start a stack, specifying whether to use the runtime or source. ```bash hstack stack start exp1 --runtime ``` ```bash hstack stack start exp1 --source ``` -------------------------------- ### Run Redis in Docker Source: https://github.com/happier-dev/happier/blob/dev/docs/deployment.md Use this command to start a Redis instance in Docker for local development. Ensure you have Docker installed and running. ```bash yarn workspace @happier-dev/server redis ``` -------------------------------- ### Start Happier Services Source: https://github.com/happier-dev/happier/blob/dev/apps/stack/README.md Starts the local server, CLI daemon, and serves the pre-built UI. ```bash hstack start ``` -------------------------------- ### Run Postgres in Docker Source: https://github.com/happier-dev/happier/blob/dev/docs/deployment.md Use this command to start a Postgres instance in Docker for local development. Ensure you have Docker installed and running. ```bash yarn workspace @happier-dev/server db ``` -------------------------------- ### Install, Status, Restart, and Logs for Stack Services Source: https://github.com/happier-dev/happier/blob/dev/apps/stack/docs/stacks.md Manage autostart services for individual stacks. These commands are used to install, check the status of, restart, and view logs for a stack's service. ```bash hstack stack service exp1 install ``` ```bash hstack stack service exp1 status ``` ```bash hstack stack service exp1 restart ``` ```bash hstack stack service exp1 logs ``` -------------------------------- ### Setup with User Service Mode Source: https://github.com/happier-dev/happier/blob/dev/apps/docs/content/docs/hstack/remote-server.mdx Installs the Happier Self-Host Server as a user-managed service. This is the recommended default mode for most use cases. ```bash hstack remote server setup --ssh user@host --mode user ``` -------------------------------- ### Run Release Assets E2E Tests (Quick Start) Source: https://github.com/happier-dev/happier/blob/dev/scripts/release/release-assets-e2e/README.md Execute the main script for release asset end-to-end validation from the repository root. This is the quickest way to start the tests. ```bash ./scripts/release/release-assets-e2e/run.sh ``` -------------------------------- ### Setup Remote Daemon with Development Channel Source: https://github.com/happier-dev/happier/blob/dev/apps/docs/content/docs/hstack/remote-daemon.mdx Installs the Happier CLI and sets up the remote daemon using the development release channel. ```bash hstack remote daemon setup --ssh user@host --channel dev ``` -------------------------------- ### Copy .env.example to .env Source: https://github.com/happier-dev/happier/blob/dev/apps/docs/content/docs/deployment/env.mdx Use this command to create a local environment file from the canonical template. Load values from this file for local development. ```bash cp apps/server/.env.example apps/server/.env ``` -------------------------------- ### Run Happier Dev Stack in Sandbox Mode Source: https://github.com/happier-dev/happier/blob/dev/apps/docs/content/docs/hstack/paths-and-env.mdx Use this command to test the full install and setup flows without affecting your real installation. In sandbox mode, hstack redirects home, workspace, and runtime storage under the specified sandbox directory. ```bash npx @happier-dev/stack@latest --sandbox-dir /tmp/hstack-sandbox where ``` -------------------------------- ### Build and Install iOS App Source: https://github.com/happier-dev/happier/blob/dev/apps/docs/content/docs/hstack/mobile-ios.mdx Builds and installs the app on iOS without starting Metro. Use '--configuration=Release' for a release build and '--no-metro' to explicitly disable Metro. If '--device' is omitted, it attempts to auto-pick a connected iPhone over USB. ```bash hstack mobile --prebuild --run-ios --device="Your iPhone" ``` ```bash hstack mobile --prebuild --run-ios --configuration=Release --no-metro ```