{"id":"697c6cc9090375fa10a22bfc","title":"2026 01 30 Ngx Ramblers Cli Reference","path":"how-to/technical-articles/2026-01-30-ngx-ramblers-cli-reference","contentMarkdown":"# 30-Jan-2026 — NGX Ramblers CLI Reference Guide\n\nThe NGX Ramblers CLI provides a unified command-line interface for managing environments, deployments, and local development. This guide covers all available commands with examples and comparisons to the Admin UI where applicable.\n\n## Prerequisites\n\nBefore using the CLI, ensure you have:\n\n- Node.js v22.19.0 or later\n- Access to the NGX-Ramblers repository\n- Secrets files in `non-vcs/secrets/` directory (contain AWS credentials, fly.io tokens, MongoDB URIs, etc.)\n- AWS admin credentials in environment variables (only needed for `aws create-resources` command)\n\n## Running the CLI\n\nFrom the project root directory:\n\n```bash\nnpm run cli -- <command> [options]\n```\n\nThe CLI will automatically install dependencies if needed (when `package-lock.json` changes).\n\n### Global Installation (Optional)\n\nTo use `ngx-cli` from any directory, run once in the project root:\n\n```bash\nnpm link\n```\n\nThen you can use:\n\n```bash\nngx-cli <command> [options]\n```\n\n---\n\n## Command Overview\n\n```\nUsage: ngx-cli [options] [command]\n\nNGX-Ramblers environment management CLI\n\nCommands:\n  environment|env               Environment management commands\n  fly|f                         fly.io deployment commands\n  database|db                   Database management commands\n  aws|a                         AWS resource management commands\n  validate|val                  Validation commands for credentials and connections\n  destroy|des <name>            Destroy an environment completely\n  local|l                       Run the app locally in dev or production mode\n  backup|bak                    Backup and restore commands\n```\n\n### Command Aliases\n\nAll commands support short aliases for faster typing:\n\n| Full Command | Alias | Example |\n|--------------|-------|---------|\n| `environment` | `env` | `ngx-cli env list` |\n| `database` | `db` | `ngx-cli db seed dev-group` |\n| `validate` | `val` | `ngx-cli val aws-admin` |\n| `destroy` | `des` | `ngx-cli des test-env` |\n| `local` | `l` | `ngx-cli l dev my-group` |\n| `fly` | `f` | `ngx-cli f deploy new-group` |\n| `aws` | `a` | `ngx-cli a create-resources new-group` |\n| `backup` | `bak` | `ngx-cli bak create my-group` |\n\n---\n\n## Interactive Mode\n\nWhen you run commands without specifying required arguments, the CLI enters interactive mode with a clear screen and selection menu.\n\n### Keyboard Navigation\n\n| Key | Action |\n|-----|--------|\n| `Arrow keys` | Navigate options |\n| `Enter` | Select option |\n| `ESC` | Go back to previous step |\n| `q` | Quit immediately |\n| `Ctrl+C` | Quit immediately |\n\nNavigation hints are displayed at the bottom of selection menus:\n\n```\n? Select an environment: (Use arrow keys)\n> my-group (ngx-ramblers-my-group)\n  dev-group (ngx-ramblers)\n  another-group (ngx-ramblers-another-group)\n  ──────────────\n  [q/Ctrl+C: quit]\n```\n\n---\n\n## Local Development Commands\n\nThe `local` (or `l`) command replaces shell scripts for running the application locally.\n\n### List Available Environments\n\n```bash\nngx-cli l list\n```\n\n**Output:**\n\n```\nAvailable environments:\n\n  my-group - ngx-ramblers-my-group (ready)\n  dev-group - ngx-ramblers (ready)\n  another-group - ngx-ramblers-another-group (ready)\n  third-group - ngx-ramblers-third-group (ready)\n  new-group - ngx-ramblers-new-group (ready)\n```\n\nThe status shows:\n- **ready**: Secrets file exists and environment is configured\n- **missing secrets**: No secrets file found for this environment\n\n### Development Mode (Hot Reload)\n\nStart the application with hot module reloading for both frontend and backend:\n\n```bash\nngx-cli l dev [environment] [options]\n```\n\n**Options:**\n\n| Option | Description | Default |\n|--------|-------------|---------|\n| `-p, --port <port>` | Backend port | 5001 |\n\n**Examples:**\n\n```bash\n# Direct - specify environment\nngx-cli l dev my-group\n\n# With custom port\nngx-cli l dev my-group -p 3000\n\n# Interactive - select from menu\nngx-cli l dev\n```\n\n**Output:**\n\n```\n========================================\nStarting in DEVELOPMENT mode\n========================================\nEnvironment: my-group\nApp Name: ngx-ramblers-my-group\nPort: 5001\nFrontend: http://localhost:4200\nBackend: http://localhost:5001\n========================================\n\nStarting Backend (tsx watch)...\nStarting Frontend (ng serve)...\n```\n\nThis runs:\n- **Frontend**: `ng serve` with hot reload on http://localhost:4200\n- **Backend**: `tsx watch` with hot reload on http://localhost:5001\n\n**Port Checking:** The CLI checks if ports are available before starting and will display an error if they're in use.\n\n### Production Mode\n\nBuild and run a production build locally:\n\n```bash\nngx-cli l prod [environment] [options]\n```\n\n**Options:**\n\n| Option | Description | Default |\n|--------|-------------|---------|\n| `-p, --port <port>` | Server port | 5001 |\n\n**Examples:**\n\n```bash\nngx-cli l prod dev-group\nngx-cli l prod dev-group -p 8080\n```\n\nThis:\n1. Builds the Angular frontend with production optimisations\n2. Starts the Express server serving the bundled application\n\n---\n\n## Environment Management Commands\n\n### List Configured Environments\n\n```bash\nngx-cli env list\n```\n\n**Output:**\n\n```\nConfigured environments:\n\n  my-group\n    App: ngx-ramblers-my-group\n    Memory: 1gb\n    Scale: 1\n    Organisation: personal\n    API Key: Yes\n\n  new-group\n    App: ngx-ramblers-new-group\n    Memory: 1024mb\n    Scale: 1\n    Organisation: personal\n    API Key: Yes\n```\n\n**Admin UI Equivalent:** Navigate to *Admin > Backup & Restore > Settings* to view configured environments.\n\n### Show Environment Details\n\n```bash\nngx-cli env show <name>\n```\n\n**Example:**\n\n```bash\nngx-cli env show my-group\n```\n\n### Resume Environment Setup\n\nResume a partially completed environment setup:\n\n```bash\nngx-cli env resume <name> [options]\n```\n\n**Options:**\n\n| Option | Description |\n|--------|-------------|\n| `--db-init` | Run database initialisation |\n| `--fly-deploy` | Run fly.io deployment |\n\n**Examples:**\n\n```bash\n# Resume and deploy to fly.io\nngx-cli env resume new-group --fly-deploy\n\n# Resume and reinitialise database\nngx-cli env resume new-group --db-init\n\n# Both\nngx-cli env resume new-group --db-init --fly-deploy\n```\n\n**Admin UI Equivalent:** Navigate to *Admin > Environment Setup*, select \"Manage Existing Environment\", choose your environment, and click \"Resume Setup\".\n\n### Update Ramblers Info\n\nUpdate the Ramblers API information in an environment's secrets file:\n\n```bash\nngx-cli env update-ramblers <name> --api-key <key> --area-code <code> --area-name <name> --group-code <code> --group-name <name>\n```\n\n---\n\n## fly.io Deployment Commands\n\n### Deploy to fly.io\n\nDeploy an environment to fly.io:\n\n```bash\nngx-cli f deploy <name> [options]\n```\n\n**Options:**\n\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--app-name <appName>` | fly.io app name | ngx-ramblers-{name} |\n| `--memory <memory>` | Memory allocation | 512mb |\n| `--scale <count>` | Number of instances | 1 |\n| `--org <organization>` | fly.io organization | personal |\n\n**Examples:**\n\n```bash\nngx-cli f deploy new-group\nngx-cli f deploy new-group --memory 1024mb --scale 1\n```\n\n**Admin UI Equivalent:** In *Admin > Environment Setup*, complete the wizard and click \"Create Environment\" or use \"Resume Setup\" with the \"Deploy to fly.io\" option checked.\n\n### Scale fly.io App\n\nAdjust resources for a running fly.io app:\n\n```bash\nngx-cli f scale <appName> [options]\n```\n\n**Options:**\n\n| Option | Description |\n|--------|-------------|\n| `--count <count>` | Number of instances |\n| `--memory <memory>` | Memory allocation (e.g., 512mb, 1gb) |\n\n**Examples:**\n\n```bash\nngx-cli f scale ngx-ramblers-example --memory 1gb\nngx-cli f scale ngx-ramblers-example --count 2\n```\n\n### Generate Deploy Token\n\nGenerate a deploy token for an app:\n\n```bash\nngx-cli f token <appName>\n```\n\n**Example:**\n\n```bash\nngx-cli f token ngx-ramblers-new-group\n```\n\n---\n\n## AWS Resource Commands\n\n### Create AWS Resources\n\nCreate S3 bucket and IAM user for a new environment:\n\n```bash\nngx-cli a create-resources <name> [options]\n```\n\n**Options:**\n\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--region <region>` | AWS region | eu-west-1 |\n\n**Examples:**\n\n```bash\nngx-cli a create-resources new-group\nngx-cli a create-resources new-group --region eu-west-2\n```\n\nThis creates:\n- S3 bucket: `ngx-ramblers-new-group`\n- IAM user: `ngx-ramblers-new-group-user`\n- IAM policy with S3 permissions\n- Access key credentials (saved to secrets file)\n\n**Admin UI Equivalent:** This is performed automatically during environment creation in *Admin > Environment Setup*.\n\n### Copy Standard Assets\n\nCopy standard assets (logos, images) to an environment's S3 bucket:\n\n```bash\nngx-cli a copy-assets <bucket>\n```\n\n**Example:**\n\n```bash\nngx-cli a copy-assets ngx-ramblers-new-group\n```\n\n---\n\n## Database Commands\n\n### Seed Database\n\nPopulate a database with sample data and run migrations:\n\n```bash\nngx-cli db seed <name> [options]\n```\n\n**Or using connection details directly:**\n\n```bash\nngx-cli db seed --uri \"mongodb+srv://cluster.mongodb.net\" --database \"ngx-ramblers-new-group\" --group-name \"My Walking Group\"\n```\n\n**Options:**\n\n| Option | Description |\n|--------|-------------|\n| `--uri <uri>` | MongoDB connection URI (alternative to name) |\n| `--database <database>` | Database name (required with --uri) |\n| `--group-name <groupName>` | Group name for sample data (required with --uri) |\n| `--fresh` | Clear changelog and page content before seeding (runs all migrations fresh) |\n| `--sync` | Run full data sync from Ramblers API after seeding |\n\n**Examples:**\n\n```bash\n# Basic seed - creates sample pages and runs pending migrations\nngx-cli db seed dev-group\n\n# Fresh seed - clears existing data and runs all migrations from scratch\nngx-cli db seed new-group --fresh\n\n# Seed with data sync - also pulls walks from Ramblers API\nngx-cli db seed new-group --sync\n\n# Full fresh setup with data sync\nngx-cli db seed new-group --fresh --sync\n```\n\n**What happens during seeding:**\n1. Sample page content is created (home, walks, about-us, contact-us, admin)\n2. All pending database migrations run automatically\n3. Admin menu items are populated via migrations\n4. (With `--sync`) Walks are fetched from the Ramblers API\n\n**Admin UI Equivalent:** Database seeding happens automatically during environment creation. For existing environments, use the backup/restore functionality in *Admin > Backup & Restore*.\n\n### Run Database Migrations\n\nRun pending database migrations without seeding:\n\n```bash\nngx-cli db migrate <name>\n```\n\n**Example:**\n\n```bash\nngx-cli db migrate dev-group\n```\n\n**Output:**\n\n```\nRunning pending migrations...\nStatus: 18 applied, 2 pending, 0 failed\n✓ Applied 2 migration(s)\n  - 20260129000000-add-environment-setup-menu-item.js\n  - 20260130000000-add-venue-settings-menu-item.js\n```\n\n### Validate Database Connection\n\nTest MongoDB connectivity:\n\n```bash\nngx-cli db validate <name>\n```\n\n**Example:**\n\n```bash\nngx-cli db validate dev-group\n```\n\n---\n\n## Backup and Restore Commands\n\nThe `backup` (or `bak`) command provides database backup and restore functionality.\n\n### List Backup Environments\n\n```bash\nngx-cli bak list\n```\n\n**Output:**\n\n```\nConfigured backup environments:\n\n  my-group\n    Database: ngx-ramblers-my-group\n    S3 Bucket: ngx-ramblers-my-group\n\n  dev-group\n    Database: ngx-ramblers\n    S3 Bucket: ngx-ramblers\n```\n\n### Create a Backup\n\nCreate a backup of an environment's database:\n\n```bash\nngx-cli bak create [environment] [options]\n```\n\n**Options:**\n\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--no-upload` | Don't upload to S3 (local only) | Upload enabled |\n| `--collections <collections>` | Comma-separated list of collections | All collections |\n\n**Examples:**\n\n```bash\n# Backup with S3 upload (default)\nngx-cli bak create my-group\n\n# Backup without S3 upload (local only)\nngx-cli bak create my-group --no-upload\n\n# Backup specific collections only\nngx-cli bak create my-group --collections walks,members,pageContent\n\n# Interactive - select from menu\nngx-cli bak create\n```\n\n**What happens during backup:**\n1. Connects to the environment's MongoDB database\n2. Runs `mongodump` to export collections\n3. Uploads the dump to S3 (unless `--no-upload`)\n4. Records the backup session in the database\n\n**Admin UI Equivalent:** Navigate to *Admin > Backup & Restore*, select your environment, and click \"Backup\".\n\n### Restore a Backup\n\nRestore a backup to an environment:\n\n```bash\nngx-cli bak restore [environment] [path] [options]\n```\n\n**Options:**\n\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--no-drop` | Don't drop existing collections before restore | Drop enabled |\n| `--dry-run` | Preview restore without making changes | Disabled |\n| `--collections <collections>` | Comma-separated list of collections | All collections |\n\n**Examples:**\n\n```bash\n# Restore from S3\nngx-cli bak restore my-group s3://ngx-ramblers-my-group/backups/2026-01-30-backup\n\n# Restore from local directory\nngx-cli bak restore my-group 2026-01-30-backup\n\n# Restore specific collections\nngx-cli bak restore my-group s3://bucket/backup --collections walks,members\n\n# Dry run (preview only)\nngx-cli bak restore my-group s3://bucket/backup --dry-run\n\n# Interactive - select environment and enter path\nngx-cli bak restore\n```\n\n**Warning:** Restore operations will overwrite existing data. Use `--dry-run` first to preview changes.\n\n**Admin UI Equivalent:** Navigate to *Admin > Backup & Restore*, select your environment, choose a backup from the list, and click \"Restore\".\n\n---\n\n## Validation Commands\n\n### Validate MongoDB Connection\n\n```bash\nngx-cli val mongodb --cluster <cluster> --username <username> --password <password> --database <database>\n```\n\n**Example:**\n\n```bash\nngx-cli val mongodb --cluster cluster0.abc123 --username admin --password secret123 --database ngx-ramblers-dev-group\n```\n\n**Admin UI Equivalent:** In *Admin > Environment Setup > Services*, click \"Test Connection\" next to the MongoDB configuration.\n\n### Validate AWS Admin Credentials\n\nValidate AWS credentials from environment variables:\n\n```bash\nngx-cli val aws-admin\n```\n\nThis checks `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` from your environment.\n\n### Validate Ramblers API Key\n\n```bash\nngx-cli val ramblers-api --api-key <key>\n```\n\n**Admin UI Equivalent:** In *Admin > Environment Setup > Group Selection*, enter your API key and click \"Validate API Key\".\n\n---\n\n## Destroy Command\n\n**Warning:** This command permanently destroys an environment and all its resources.\n\n```bash\nngx-cli des <name> [options]\n```\n\n**Options:**\n\n| Option | Description |\n|--------|-------------|\n| `--skip-fly` | Skip fly.io app deletion |\n| `--skip-s3` | Skip S3 bucket and IAM user deletion |\n| `--skip-database` | Skip database collection clearing |\n| `--skip-configs` | Skip configs.json and secrets file deletion |\n| `--yes` | Skip confirmation prompt |\n\n**Examples:**\n\n```bash\n# Full destruction with confirmation\nngx-cli des test-env\n\n# Full destruction without confirmation\nngx-cli des test-env --yes\n\n# Keep database, destroy infrastructure\nngx-cli des test-env --skip-database\n```\n\n**What gets destroyed:**\n1. fly.io app\n2. S3 bucket and all objects\n3. IAM user and access keys\n4. Database collections (data cleared, not dropped)\n5. Entry in configs.json\n6. Secrets file\n\n**Admin UI Equivalent:** Navigate to *Admin > Environment Setup*, select \"Manage Existing Environment\", choose your environment, select \"Destroy\", and confirm.\n\n---\n\n## Configuration Files\n\n### configs.json\n\nLocated at `non-vcs/configs.json`, this file contains environment configurations:\n\n```json\n{\n  \"environments\": [\n    {\n      \"name\": \"my-group\",\n      \"appName\": \"ngx-ramblers-my-group\",\n      \"memory\": \"1gb\",\n      \"scaleCount\": 1,\n      \"organisation\": \"personal\"\n    }\n  ]\n}\n```\n\n### Secrets Files\n\nLocated at `non-vcs/secrets/secrets.<appName>.env`:\n\n```\nMONGO_URI=mongodb+srv://...\nAWS_ACCESS_KEY_ID=AKIA...\nAWS_SECRET_ACCESS_KEY=...\nBREVO_API_KEY=...\n```\n\n---\n\n## CLI vs Admin UI Comparison\n\n| Task | CLI Command | Admin UI Location |\n|------|-------------|-------------------|\n| List environments | `env list` | Backup & Restore > Settings |\n| Create environment | `f deploy` + `db seed` | Environment Setup wizard |\n| Resume setup | `env resume` | Environment Setup > Manage > Resume |\n| Destroy environment | `des` | Environment Setup > Manage > Destroy |\n| Run locally (dev) | `l dev` | N/A (development only) |\n| Run locally (prod) | `l prod` | N/A (development only) |\n| Validate MongoDB | `val mongodb` | Environment Setup > Test Connection |\n| Validate API key | `val ramblers-api` | Environment Setup > Validate API Key |\n| Create AWS resources | `a create-resources` | Automatic during Environment Setup |\n| Scale fly.io app | `f scale` | N/A (use fly.io dashboard) |\n| Create backup | `bak create` | Backup & Restore > Backup |\n| Restore backup | `bak restore` | Backup & Restore > Restore |\n\n---\n\n## Quick Reference\n\n### Most Common Commands\n\n```bash\n# Start local development\nngx-cli l dev my-group\n\n# List environments\nngx-cli l list\n\n# Deploy to fly.io\nngx-cli f deploy new-group\n\n# Resume with deployment\nngx-cli env resume new-group --fly-deploy\n\n# Seed database\nngx-cli db seed dev-group\n\n# Destroy environment\nngx-cli des test-env --yes\n\n# Backup an environment\nngx-cli bak create my-group\n\n# Restore a backup\nngx-cli bak restore my-group s3://bucket/backup\n```\n\n### Help\n\nGet help on any command:\n\n```bash\nngx-cli --help\nngx-cli l --help\nngx-cli l dev --help\nngx-cli l dev -h\nngx-cli l dev --h\n```\n\n---\n\n## Tips and Best Practices\n\n1. **Use short aliases**: `l dev my-group` instead of `local dev my-group` for faster typing.\n\n2. **Use interactive mode for safety**: Omit the environment argument to see available options before selecting.\n\n3. **Check secrets before deployment**: Run `l list` to verify secrets files exist.\n\n4. **Use --skip flags with destroy**: When troubleshooting, selectively destroy components.\n\n5. **Environment variables for CI/CD**: Use environment variables instead of interactive prompts:\n   ```bash\n   export FLY_API_TOKEN=...\n   export AWS_ACCESS_KEY_ID=...\n   export AWS_SECRET_ACCESS_KEY=...\n   ```\n\n---\n\n## Troubleshooting\n\n### \"No secrets file found\"\n\nEnsure the secrets file exists at `non-vcs/secrets/secrets.<appName>.env`\n\n### \"Environment not found in configs.json\"\n\nCheck that the environment is configured in `non-vcs/configs.json`\n\n### \"Port already in use\"\n\nThe CLI checks ports before starting. Stop the process using the port or specify a different port with `-p`.\n\n### AWS permission errors\n\nVerify your AWS credentials have sufficient permissions for S3 and IAM operations.\n\n### fly.io authentication errors\n\nEnsure `FLY_API_TOKEN` is set or you're logged in via `fly auth login`.\n","contentHtml":"<h1>30-Jan-2026 — NGX Ramblers CLI Reference Guide</h1>\n<p>The NGX Ramblers CLI provides a unified command-line interface for managing environments, deployments, and local development. This guide covers all available commands with examples and comparisons to the Admin UI where applicable.</p>\n<h2>Prerequisites</h2>\n<p>Before using the CLI, ensure you have:</p>\n<ul>\n<li>Node.js v22.19.0 or later</li>\n<li>Access to the NGX-Ramblers repository</li>\n<li>Secrets files in <code>non-vcs/secrets/</code> directory (contain AWS credentials, fly.io tokens, MongoDB URIs, etc.)</li>\n<li>AWS admin credentials in environment variables (only needed for <code>aws create-resources</code> command)</li>\n</ul>\n<h2>Running the CLI</h2>\n<p>From the project root directory:</p>\n<pre><code class=\"language-bash\">npm run cli -- &lt;command&gt; [options]\n</code></pre>\n<p>The CLI will automatically install dependencies if needed (when <code>package-lock.json</code> changes).</p>\n<h3>Global Installation (Optional)</h3>\n<p>To use <code>ngx-cli</code> from any directory, run once in the project root:</p>\n<pre><code class=\"language-bash\">npm link\n</code></pre>\n<p>Then you can use:</p>\n<pre><code class=\"language-bash\">ngx-cli &lt;command&gt; [options]\n</code></pre>\n<hr>\n<h2>Command Overview</h2>\n<pre><code>Usage: ngx-cli [options] [command]\n\nNGX-Ramblers environment management CLI\n\nCommands:\n  environment|env               Environment management commands\n  fly|f                         fly.io deployment commands\n  database|db                   Database management commands\n  aws|a                         AWS resource management commands\n  validate|val                  Validation commands for credentials and connections\n  destroy|des &lt;name&gt;            Destroy an environment completely\n  local|l                       Run the app locally in dev or production mode\n  backup|bak                    Backup and restore commands\n</code></pre>\n<h3>Command Aliases</h3>\n<p>All commands support short aliases for faster typing:</p>\n<table>\n<thead>\n<tr>\n<th>Full Command</th>\n<th>Alias</th>\n<th>Example</th>\n</tr>\n</thead>\n<tbody><tr>\n<td><code>environment</code></td>\n<td><code>env</code></td>\n<td><code>ngx-cli env list</code></td>\n</tr>\n<tr>\n<td><code>database</code></td>\n<td><code>db</code></td>\n<td><code>ngx-cli db seed dev-group</code></td>\n</tr>\n<tr>\n<td><code>validate</code></td>\n<td><code>val</code></td>\n<td><code>ngx-cli val aws-admin</code></td>\n</tr>\n<tr>\n<td><code>destroy</code></td>\n<td><code>des</code></td>\n<td><code>ngx-cli des test-env</code></td>\n</tr>\n<tr>\n<td><code>local</code></td>\n<td><code>l</code></td>\n<td><code>ngx-cli l dev my-group</code></td>\n</tr>\n<tr>\n<td><code>fly</code></td>\n<td><code>f</code></td>\n<td><code>ngx-cli f deploy new-group</code></td>\n</tr>\n<tr>\n<td><code>aws</code></td>\n<td><code>a</code></td>\n<td><code>ngx-cli a create-resources new-group</code></td>\n</tr>\n<tr>\n<td><code>backup</code></td>\n<td><code>bak</code></td>\n<td><code>ngx-cli bak create my-group</code></td>\n</tr>\n</tbody></table>\n<hr>\n<h2>Interactive Mode</h2>\n<p>When you run commands without specifying required arguments, the CLI enters interactive mode with a clear screen and selection menu.</p>\n<h3>Keyboard Navigation</h3>\n<table>\n<thead>\n<tr>\n<th>Key</th>\n<th>Action</th>\n</tr>\n</thead>\n<tbody><tr>\n<td><code>Arrow keys</code></td>\n<td>Navigate options</td>\n</tr>\n<tr>\n<td><code>Enter</code></td>\n<td>Select option</td>\n</tr>\n<tr>\n<td><code>ESC</code></td>\n<td>Go back to previous step</td>\n</tr>\n<tr>\n<td><code>q</code></td>\n<td>Quit immediately</td>\n</tr>\n<tr>\n<td><code>Ctrl+C</code></td>\n<td>Quit immediately</td>\n</tr>\n</tbody></table>\n<p>Navigation hints are displayed at the bottom of selection menus:</p>\n<pre><code>? Select an environment: (Use arrow keys)\n&gt; my-group (ngx-ramblers-my-group)\n  dev-group (ngx-ramblers)\n  another-group (ngx-ramblers-another-group)\n  ──────────────\n  [q/Ctrl+C: quit]\n</code></pre>\n<hr>\n<h2>Local Development Commands</h2>\n<p>The <code>local</code> (or <code>l</code>) command replaces shell scripts for running the application locally.</p>\n<h3>List Available Environments</h3>\n<pre><code class=\"language-bash\">ngx-cli l list\n</code></pre>\n<p><strong>Output:</strong></p>\n<pre><code>Available environments:\n\n  my-group - ngx-ramblers-my-group (ready)\n  dev-group - ngx-ramblers (ready)\n  another-group - ngx-ramblers-another-group (ready)\n  third-group - ngx-ramblers-third-group (ready)\n  new-group - ngx-ramblers-new-group (ready)\n</code></pre>\n<p>The status shows:</p>\n<ul>\n<li><strong>ready</strong>: Secrets file exists and environment is configured</li>\n<li><strong>missing secrets</strong>: No secrets file found for this environment</li>\n</ul>\n<h3>Development Mode (Hot Reload)</h3>\n<p>Start the application with hot module reloading for both frontend and backend:</p>\n<pre><code class=\"language-bash\">ngx-cli l dev [environment] [options]\n</code></pre>\n<p><strong>Options:</strong></p>\n<table>\n<thead>\n<tr>\n<th>Option</th>\n<th>Description</th>\n<th>Default</th>\n</tr>\n</thead>\n<tbody><tr>\n<td><code>-p, --port &lt;port&gt;</code></td>\n<td>Backend port</td>\n<td>5001</td>\n</tr>\n</tbody></table>\n<p><strong>Examples:</strong></p>\n<pre><code class=\"language-bash\"># Direct - specify environment\nngx-cli l dev my-group\n\n# With custom port\nngx-cli l dev my-group -p 3000\n\n# Interactive - select from menu\nngx-cli l dev\n</code></pre>\n<p><strong>Output:</strong></p>\n<pre><code>========================================\nStarting in DEVELOPMENT mode\n========================================\nEnvironment: my-group\nApp Name: ngx-ramblers-my-group\nPort: 5001\nFrontend: http://localhost:4200\nBackend: http://localhost:5001\n========================================\n\nStarting Backend (tsx watch)...\nStarting Frontend (ng serve)...\n</code></pre>\n<p>This runs:</p>\n<ul>\n<li><strong>Frontend</strong>: <code>ng serve</code> with hot reload on <a href=\"http://localhost:4200\">http://localhost:4200</a></li>\n<li><strong>Backend</strong>: <code>tsx watch</code> with hot reload on <a href=\"http://localhost:5001\">http://localhost:5001</a></li>\n</ul>\n<p><strong>Port Checking:</strong> The CLI checks if ports are available before starting and will display an error if they&#39;re in use.</p>\n<h3>Production Mode</h3>\n<p>Build and run a production build locally:</p>\n<pre><code class=\"language-bash\">ngx-cli l prod [environment] [options]\n</code></pre>\n<p><strong>Options:</strong></p>\n<table>\n<thead>\n<tr>\n<th>Option</th>\n<th>Description</th>\n<th>Default</th>\n</tr>\n</thead>\n<tbody><tr>\n<td><code>-p, --port &lt;port&gt;</code></td>\n<td>Server port</td>\n<td>5001</td>\n</tr>\n</tbody></table>\n<p><strong>Examples:</strong></p>\n<pre><code class=\"language-bash\">ngx-cli l prod dev-group\nngx-cli l prod dev-group -p 8080\n</code></pre>\n<p>This:</p>\n<ol>\n<li>Builds the Angular frontend with production optimisations</li>\n<li>Starts the Express server serving the bundled application</li>\n</ol>\n<hr>\n<h2>Environment Management Commands</h2>\n<h3>List Configured Environments</h3>\n<pre><code class=\"language-bash\">ngx-cli env list\n</code></pre>\n<p><strong>Output:</strong></p>\n<pre><code>Configured environments:\n\n  my-group\n    App: ngx-ramblers-my-group\n    Memory: 1gb\n    Scale: 1\n    Organisation: personal\n    API Key: Yes\n\n  new-group\n    App: ngx-ramblers-new-group\n    Memory: 1024mb\n    Scale: 1\n    Organisation: personal\n    API Key: Yes\n</code></pre>\n<p><strong>Admin UI Equivalent:</strong> Navigate to <em>Admin &gt; Backup &amp; Restore &gt; Settings</em> to view configured environments.</p>\n<h3>Show Environment Details</h3>\n<pre><code class=\"language-bash\">ngx-cli env show &lt;name&gt;\n</code></pre>\n<p><strong>Example:</strong></p>\n<pre><code class=\"language-bash\">ngx-cli env show my-group\n</code></pre>\n<h3>Resume Environment Setup</h3>\n<p>Resume a partially completed environment setup:</p>\n<pre><code class=\"language-bash\">ngx-cli env resume &lt;name&gt; [options]\n</code></pre>\n<p><strong>Options:</strong></p>\n<table>\n<thead>\n<tr>\n<th>Option</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody><tr>\n<td><code>--db-init</code></td>\n<td>Run database initialisation</td>\n</tr>\n<tr>\n<td><code>--fly-deploy</code></td>\n<td>Run fly.io deployment</td>\n</tr>\n</tbody></table>\n<p><strong>Examples:</strong></p>\n<pre><code class=\"language-bash\"># Resume and deploy to fly.io\nngx-cli env resume new-group --fly-deploy\n\n# Resume and reinitialise database\nngx-cli env resume new-group --db-init\n\n# Both\nngx-cli env resume new-group --db-init --fly-deploy\n</code></pre>\n<p><strong>Admin UI Equivalent:</strong> Navigate to <em>Admin &gt; Environment Setup</em>, select &quot;Manage Existing Environment&quot;, choose your environment, and click &quot;Resume Setup&quot;.</p>\n<h3>Update Ramblers Info</h3>\n<p>Update the Ramblers API information in an environment&#39;s secrets file:</p>\n<pre><code class=\"language-bash\">ngx-cli env update-ramblers &lt;name&gt; --api-key &lt;key&gt; --area-code &lt;code&gt; --area-name &lt;name&gt; --group-code &lt;code&gt; --group-name &lt;name&gt;\n</code></pre>\n<hr>\n<h2>fly.io Deployment Commands</h2>\n<h3>Deploy to fly.io</h3>\n<p>Deploy an environment to fly.io:</p>\n<pre><code class=\"language-bash\">ngx-cli f deploy &lt;name&gt; [options]\n</code></pre>\n<p><strong>Options:</strong></p>\n<table>\n<thead>\n<tr>\n<th>Option</th>\n<th>Description</th>\n<th>Default</th>\n</tr>\n</thead>\n<tbody><tr>\n<td><code>--app-name &lt;appName&gt;</code></td>\n<td>fly.io app name</td>\n<td>ngx-ramblers-{name}</td>\n</tr>\n<tr>\n<td><code>--memory &lt;memory&gt;</code></td>\n<td>Memory allocation</td>\n<td>512mb</td>\n</tr>\n<tr>\n<td><code>--scale &lt;count&gt;</code></td>\n<td>Number of instances</td>\n<td>1</td>\n</tr>\n<tr>\n<td><code>--org &lt;organization&gt;</code></td>\n<td>fly.io organization</td>\n<td>personal</td>\n</tr>\n</tbody></table>\n<p><strong>Examples:</strong></p>\n<pre><code class=\"language-bash\">ngx-cli f deploy new-group\nngx-cli f deploy new-group --memory 1024mb --scale 1\n</code></pre>\n<p><strong>Admin UI Equivalent:</strong> In <em>Admin &gt; Environment Setup</em>, complete the wizard and click &quot;Create Environment&quot; or use &quot;Resume Setup&quot; with the &quot;Deploy to fly.io&quot; option checked.</p>\n<h3>Scale fly.io App</h3>\n<p>Adjust resources for a running fly.io app:</p>\n<pre><code class=\"language-bash\">ngx-cli f scale &lt;appName&gt; [options]\n</code></pre>\n<p><strong>Options:</strong></p>\n<table>\n<thead>\n<tr>\n<th>Option</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody><tr>\n<td><code>--count &lt;count&gt;</code></td>\n<td>Number of instances</td>\n</tr>\n<tr>\n<td><code>--memory &lt;memory&gt;</code></td>\n<td>Memory allocation (e.g., 512mb, 1gb)</td>\n</tr>\n</tbody></table>\n<p><strong>Examples:</strong></p>\n<pre><code class=\"language-bash\">ngx-cli f scale ngx-ramblers-example --memory 1gb\nngx-cli f scale ngx-ramblers-example --count 2\n</code></pre>\n<h3>Generate Deploy Token</h3>\n<p>Generate a deploy token for an app:</p>\n<pre><code class=\"language-bash\">ngx-cli f token &lt;appName&gt;\n</code></pre>\n<p><strong>Example:</strong></p>\n<pre><code class=\"language-bash\">ngx-cli f token ngx-ramblers-new-group\n</code></pre>\n<hr>\n<h2>AWS Resource Commands</h2>\n<h3>Create AWS Resources</h3>\n<p>Create S3 bucket and IAM user for a new environment:</p>\n<pre><code class=\"language-bash\">ngx-cli a create-resources &lt;name&gt; [options]\n</code></pre>\n<p><strong>Options:</strong></p>\n<table>\n<thead>\n<tr>\n<th>Option</th>\n<th>Description</th>\n<th>Default</th>\n</tr>\n</thead>\n<tbody><tr>\n<td><code>--region &lt;region&gt;</code></td>\n<td>AWS region</td>\n<td>eu-west-1</td>\n</tr>\n</tbody></table>\n<p><strong>Examples:</strong></p>\n<pre><code class=\"language-bash\">ngx-cli a create-resources new-group\nngx-cli a create-resources new-group --region eu-west-2\n</code></pre>\n<p>This creates:</p>\n<ul>\n<li>S3 bucket: <code>ngx-ramblers-new-group</code></li>\n<li>IAM user: <code>ngx-ramblers-new-group-user</code></li>\n<li>IAM policy with S3 permissions</li>\n<li>Access key credentials (saved to secrets file)</li>\n</ul>\n<p><strong>Admin UI Equivalent:</strong> This is performed automatically during environment creation in <em>Admin &gt; Environment Setup</em>.</p>\n<h3>Copy Standard Assets</h3>\n<p>Copy standard assets (logos, images) to an environment&#39;s S3 bucket:</p>\n<pre><code class=\"language-bash\">ngx-cli a copy-assets &lt;bucket&gt;\n</code></pre>\n<p><strong>Example:</strong></p>\n<pre><code class=\"language-bash\">ngx-cli a copy-assets ngx-ramblers-new-group\n</code></pre>\n<hr>\n<h2>Database Commands</h2>\n<h3>Seed Database</h3>\n<p>Populate a database with sample data and run migrations:</p>\n<pre><code class=\"language-bash\">ngx-cli db seed &lt;name&gt; [options]\n</code></pre>\n<p><strong>Or using connection details directly:</strong></p>\n<pre><code class=\"language-bash\">ngx-cli db seed --uri &quot;mongodb+srv://cluster.mongodb.net&quot; --database &quot;ngx-ramblers-new-group&quot; --group-name &quot;My Walking Group&quot;\n</code></pre>\n<p><strong>Options:</strong></p>\n<table>\n<thead>\n<tr>\n<th>Option</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody><tr>\n<td><code>--uri &lt;uri&gt;</code></td>\n<td>MongoDB connection URI (alternative to name)</td>\n</tr>\n<tr>\n<td><code>--database &lt;database&gt;</code></td>\n<td>Database name (required with --uri)</td>\n</tr>\n<tr>\n<td><code>--group-name &lt;groupName&gt;</code></td>\n<td>Group name for sample data (required with --uri)</td>\n</tr>\n<tr>\n<td><code>--fresh</code></td>\n<td>Clear changelog and page content before seeding (runs all migrations fresh)</td>\n</tr>\n<tr>\n<td><code>--sync</code></td>\n<td>Run full data sync from Ramblers API after seeding</td>\n</tr>\n</tbody></table>\n<p><strong>Examples:</strong></p>\n<pre><code class=\"language-bash\"># Basic seed - creates sample pages and runs pending migrations\nngx-cli db seed dev-group\n\n# Fresh seed - clears existing data and runs all migrations from scratch\nngx-cli db seed new-group --fresh\n\n# Seed with data sync - also pulls walks from Ramblers API\nngx-cli db seed new-group --sync\n\n# Full fresh setup with data sync\nngx-cli db seed new-group --fresh --sync\n</code></pre>\n<p><strong>What happens during seeding:</strong></p>\n<ol>\n<li>Sample page content is created (home, walks, about-us, contact-us, admin)</li>\n<li>All pending database migrations run automatically</li>\n<li>Admin menu items are populated via migrations</li>\n<li>(With <code>--sync</code>) Walks are fetched from the Ramblers API</li>\n</ol>\n<p><strong>Admin UI Equivalent:</strong> Database seeding happens automatically during environment creation. For existing environments, use the backup/restore functionality in <em>Admin &gt; Backup &amp; Restore</em>.</p>\n<h3>Run Database Migrations</h3>\n<p>Run pending database migrations without seeding:</p>\n<pre><code class=\"language-bash\">ngx-cli db migrate &lt;name&gt;\n</code></pre>\n<p><strong>Example:</strong></p>\n<pre><code class=\"language-bash\">ngx-cli db migrate dev-group\n</code></pre>\n<p><strong>Output:</strong></p>\n<pre><code>Running pending migrations...\nStatus: 18 applied, 2 pending, 0 failed\n✓ Applied 2 migration(s)\n  - 20260129000000-add-environment-setup-menu-item.js\n  - 20260130000000-add-venue-settings-menu-item.js\n</code></pre>\n<h3>Validate Database Connection</h3>\n<p>Test MongoDB connectivity:</p>\n<pre><code class=\"language-bash\">ngx-cli db validate &lt;name&gt;\n</code></pre>\n<p><strong>Example:</strong></p>\n<pre><code class=\"language-bash\">ngx-cli db validate dev-group\n</code></pre>\n<hr>\n<h2>Backup and Restore Commands</h2>\n<p>The <code>backup</code> (or <code>bak</code>) command provides database backup and restore functionality.</p>\n<h3>List Backup Environments</h3>\n<pre><code class=\"language-bash\">ngx-cli bak list\n</code></pre>\n<p><strong>Output:</strong></p>\n<pre><code>Configured backup environments:\n\n  my-group\n    Database: ngx-ramblers-my-group\n    S3 Bucket: ngx-ramblers-my-group\n\n  dev-group\n    Database: ngx-ramblers\n    S3 Bucket: ngx-ramblers\n</code></pre>\n<h3>Create a Backup</h3>\n<p>Create a backup of an environment&#39;s database:</p>\n<pre><code class=\"language-bash\">ngx-cli bak create [environment] [options]\n</code></pre>\n<p><strong>Options:</strong></p>\n<table>\n<thead>\n<tr>\n<th>Option</th>\n<th>Description</th>\n<th>Default</th>\n</tr>\n</thead>\n<tbody><tr>\n<td><code>--no-upload</code></td>\n<td>Don&#39;t upload to S3 (local only)</td>\n<td>Upload enabled</td>\n</tr>\n<tr>\n<td><code>--collections &lt;collections&gt;</code></td>\n<td>Comma-separated list of collections</td>\n<td>All collections</td>\n</tr>\n</tbody></table>\n<p><strong>Examples:</strong></p>\n<pre><code class=\"language-bash\"># Backup with S3 upload (default)\nngx-cli bak create my-group\n\n# Backup without S3 upload (local only)\nngx-cli bak create my-group --no-upload\n\n# Backup specific collections only\nngx-cli bak create my-group --collections walks,members,pageContent\n\n# Interactive - select from menu\nngx-cli bak create\n</code></pre>\n<p><strong>What happens during backup:</strong></p>\n<ol>\n<li>Connects to the environment&#39;s MongoDB database</li>\n<li>Runs <code>mongodump</code> to export collections</li>\n<li>Uploads the dump to S3 (unless <code>--no-upload</code>)</li>\n<li>Records the backup session in the database</li>\n</ol>\n<p><strong>Admin UI Equivalent:</strong> Navigate to <em>Admin &gt; Backup &amp; Restore</em>, select your environment, and click &quot;Backup&quot;.</p>\n<h3>Restore a Backup</h3>\n<p>Restore a backup to an environment:</p>\n<pre><code class=\"language-bash\">ngx-cli bak restore [environment] [path] [options]\n</code></pre>\n<p><strong>Options:</strong></p>\n<table>\n<thead>\n<tr>\n<th>Option</th>\n<th>Description</th>\n<th>Default</th>\n</tr>\n</thead>\n<tbody><tr>\n<td><code>--no-drop</code></td>\n<td>Don&#39;t drop existing collections before restore</td>\n<td>Drop enabled</td>\n</tr>\n<tr>\n<td><code>--dry-run</code></td>\n<td>Preview restore without making changes</td>\n<td>Disabled</td>\n</tr>\n<tr>\n<td><code>--collections &lt;collections&gt;</code></td>\n<td>Comma-separated list of collections</td>\n<td>All collections</td>\n</tr>\n</tbody></table>\n<p><strong>Examples:</strong></p>\n<pre><code class=\"language-bash\"># Restore from S3\nngx-cli bak restore my-group s3://ngx-ramblers-my-group/backups/2026-01-30-backup\n\n# Restore from local directory\nngx-cli bak restore my-group 2026-01-30-backup\n\n# Restore specific collections\nngx-cli bak restore my-group s3://bucket/backup --collections walks,members\n\n# Dry run (preview only)\nngx-cli bak restore my-group s3://bucket/backup --dry-run\n\n# Interactive - select environment and enter path\nngx-cli bak restore\n</code></pre>\n<p><strong>Warning:</strong> Restore operations will overwrite existing data. Use <code>--dry-run</code> first to preview changes.</p>\n<p><strong>Admin UI Equivalent:</strong> Navigate to <em>Admin &gt; Backup &amp; Restore</em>, select your environment, choose a backup from the list, and click &quot;Restore&quot;.</p>\n<hr>\n<h2>Validation Commands</h2>\n<h3>Validate MongoDB Connection</h3>\n<pre><code class=\"language-bash\">ngx-cli val mongodb --cluster &lt;cluster&gt; --username &lt;username&gt; --password &lt;password&gt; --database &lt;database&gt;\n</code></pre>\n<p><strong>Example:</strong></p>\n<pre><code class=\"language-bash\">ngx-cli val mongodb --cluster cluster0.abc123 --username admin --password secret123 --database ngx-ramblers-dev-group\n</code></pre>\n<p><strong>Admin UI Equivalent:</strong> In <em>Admin &gt; Environment Setup &gt; Services</em>, click &quot;Test Connection&quot; next to the MongoDB configuration.</p>\n<h3>Validate AWS Admin Credentials</h3>\n<p>Validate AWS credentials from environment variables:</p>\n<pre><code class=\"language-bash\">ngx-cli val aws-admin\n</code></pre>\n<p>This checks <code>AWS_ACCESS_KEY_ID</code> and <code>AWS_SECRET_ACCESS_KEY</code> from your environment.</p>\n<h3>Validate Ramblers API Key</h3>\n<pre><code class=\"language-bash\">ngx-cli val ramblers-api --api-key &lt;key&gt;\n</code></pre>\n<p><strong>Admin UI Equivalent:</strong> In <em>Admin &gt; Environment Setup &gt; Group Selection</em>, enter your API key and click &quot;Validate API Key&quot;.</p>\n<hr>\n<h2>Destroy Command</h2>\n<p><strong>Warning:</strong> This command permanently destroys an environment and all its resources.</p>\n<pre><code class=\"language-bash\">ngx-cli des &lt;name&gt; [options]\n</code></pre>\n<p><strong>Options:</strong></p>\n<table>\n<thead>\n<tr>\n<th>Option</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody><tr>\n<td><code>--skip-fly</code></td>\n<td>Skip fly.io app deletion</td>\n</tr>\n<tr>\n<td><code>--skip-s3</code></td>\n<td>Skip S3 bucket and IAM user deletion</td>\n</tr>\n<tr>\n<td><code>--skip-database</code></td>\n<td>Skip database collection clearing</td>\n</tr>\n<tr>\n<td><code>--skip-configs</code></td>\n<td>Skip configs.json and secrets file deletion</td>\n</tr>\n<tr>\n<td><code>--yes</code></td>\n<td>Skip confirmation prompt</td>\n</tr>\n</tbody></table>\n<p><strong>Examples:</strong></p>\n<pre><code class=\"language-bash\"># Full destruction with confirmation\nngx-cli des test-env\n\n# Full destruction without confirmation\nngx-cli des test-env --yes\n\n# Keep database, destroy infrastructure\nngx-cli des test-env --skip-database\n</code></pre>\n<p><strong>What gets destroyed:</strong></p>\n<ol>\n<li>fly.io app</li>\n<li>S3 bucket and all objects</li>\n<li>IAM user and access keys</li>\n<li>Database collections (data cleared, not dropped)</li>\n<li>Entry in configs.json</li>\n<li>Secrets file</li>\n</ol>\n<p><strong>Admin UI Equivalent:</strong> Navigate to <em>Admin &gt; Environment Setup</em>, select &quot;Manage Existing Environment&quot;, choose your environment, select &quot;Destroy&quot;, and confirm.</p>\n<hr>\n<h2>Configuration Files</h2>\n<h3>configs.json</h3>\n<p>Located at <code>non-vcs/configs.json</code>, this file contains environment configurations:</p>\n<pre><code class=\"language-json\">{\n  &quot;environments&quot;: [\n    {\n      &quot;name&quot;: &quot;my-group&quot;,\n      &quot;appName&quot;: &quot;ngx-ramblers-my-group&quot;,\n      &quot;memory&quot;: &quot;1gb&quot;,\n      &quot;scaleCount&quot;: 1,\n      &quot;organisation&quot;: &quot;personal&quot;\n    }\n  ]\n}\n</code></pre>\n<h3>Secrets Files</h3>\n<p>Located at <code>non-vcs/secrets/secrets.&lt;appName&gt;.env</code>:</p>\n<pre><code>MONGO_URI=mongodb+srv://...\nAWS_ACCESS_KEY_ID=AKIA...\nAWS_SECRET_ACCESS_KEY=...\nBREVO_API_KEY=...\n</code></pre>\n<hr>\n<h2>CLI vs Admin UI Comparison</h2>\n<table>\n<thead>\n<tr>\n<th>Task</th>\n<th>CLI Command</th>\n<th>Admin UI Location</th>\n</tr>\n</thead>\n<tbody><tr>\n<td>List environments</td>\n<td><code>env list</code></td>\n<td>Backup &amp; Restore &gt; Settings</td>\n</tr>\n<tr>\n<td>Create environment</td>\n<td><code>f deploy</code> + <code>db seed</code></td>\n<td>Environment Setup wizard</td>\n</tr>\n<tr>\n<td>Resume setup</td>\n<td><code>env resume</code></td>\n<td>Environment Setup &gt; Manage &gt; Resume</td>\n</tr>\n<tr>\n<td>Destroy environment</td>\n<td><code>des</code></td>\n<td>Environment Setup &gt; Manage &gt; Destroy</td>\n</tr>\n<tr>\n<td>Run locally (dev)</td>\n<td><code>l dev</code></td>\n<td>N/A (development only)</td>\n</tr>\n<tr>\n<td>Run locally (prod)</td>\n<td><code>l prod</code></td>\n<td>N/A (development only)</td>\n</tr>\n<tr>\n<td>Validate MongoDB</td>\n<td><code>val mongodb</code></td>\n<td>Environment Setup &gt; Test Connection</td>\n</tr>\n<tr>\n<td>Validate API key</td>\n<td><code>val ramblers-api</code></td>\n<td>Environment Setup &gt; Validate API Key</td>\n</tr>\n<tr>\n<td>Create AWS resources</td>\n<td><code>a create-resources</code></td>\n<td>Automatic during Environment Setup</td>\n</tr>\n<tr>\n<td>Scale fly.io app</td>\n<td><code>f scale</code></td>\n<td>N/A (use fly.io dashboard)</td>\n</tr>\n<tr>\n<td>Create backup</td>\n<td><code>bak create</code></td>\n<td>Backup &amp; Restore &gt; Backup</td>\n</tr>\n<tr>\n<td>Restore backup</td>\n<td><code>bak restore</code></td>\n<td>Backup &amp; Restore &gt; Restore</td>\n</tr>\n</tbody></table>\n<hr>\n<h2>Quick Reference</h2>\n<h3>Most Common Commands</h3>\n<pre><code class=\"language-bash\"># Start local development\nngx-cli l dev my-group\n\n# List environments\nngx-cli l list\n\n# Deploy to fly.io\nngx-cli f deploy new-group\n\n# Resume with deployment\nngx-cli env resume new-group --fly-deploy\n\n# Seed database\nngx-cli db seed dev-group\n\n# Destroy environment\nngx-cli des test-env --yes\n\n# Backup an environment\nngx-cli bak create my-group\n\n# Restore a backup\nngx-cli bak restore my-group s3://bucket/backup\n</code></pre>\n<h3>Help</h3>\n<p>Get help on any command:</p>\n<pre><code class=\"language-bash\">ngx-cli --help\nngx-cli l --help\nngx-cli l dev --help\nngx-cli l dev -h\nngx-cli l dev --h\n</code></pre>\n<hr>\n<h2>Tips and Best Practices</h2>\n<ol>\n<li><p><strong>Use short aliases</strong>: <code>l dev my-group</code> instead of <code>local dev my-group</code> for faster typing.</p>\n</li>\n<li><p><strong>Use interactive mode for safety</strong>: Omit the environment argument to see available options before selecting.</p>\n</li>\n<li><p><strong>Check secrets before deployment</strong>: Run <code>l list</code> to verify secrets files exist.</p>\n</li>\n<li><p><strong>Use --skip flags with destroy</strong>: When troubleshooting, selectively destroy components.</p>\n</li>\n<li><p><strong>Environment variables for CI/CD</strong>: Use environment variables instead of interactive prompts:</p>\n<pre><code class=\"language-bash\">export FLY_API_TOKEN=...\nexport AWS_ACCESS_KEY_ID=...\nexport AWS_SECRET_ACCESS_KEY=...\n</code></pre>\n</li>\n</ol>\n<hr>\n<h2>Troubleshooting</h2>\n<h3>&quot;No secrets file found&quot;</h3>\n<p>Ensure the secrets file exists at <code>non-vcs/secrets/secrets.&lt;appName&gt;.env</code></p>\n<h3>&quot;Environment not found in configs.json&quot;</h3>\n<p>Check that the environment is configured in <code>non-vcs/configs.json</code></p>\n<h3>&quot;Port already in use&quot;</h3>\n<p>The CLI checks ports before starting. Stop the process using the port or specify a different port with <code>-p</code>.</p>\n<h3>AWS permission errors</h3>\n<p>Verify your AWS credentials have sufficient permissions for S3 and IAM operations.</p>\n<h3>fly.io authentication errors</h3>\n<p>Ensure <code>FLY_API_TOKEN</code> is set or you&#39;re logged in via <code>fly auth login</code>.</p>\n"}