Big-Link-Man/docs/CLI_COMMAND_REFERENCE.md

546 lines
10 KiB
Markdown

# CLI Command Reference
Comprehensive documentation for all CLI commands.
> **Note:** This documentation is auto-generated from the Click command definitions. To regenerate after adding or modifying commands, run:
> ```bash
> uv run python scripts/generate_cli_docs.py
> ```
## Quick Reference
### System Commands
- `config` - Show current configuration
- `health` - Check system health
- `models` - List available AI models
### User Management
- `add-user` - Create a new user (requires admin)
- `delete-user` - Delete a user (requires admin)
- `list-users` - List all users (requires admin)
### Site Management
- `provision-site` - Provision a new site with Storage Zone and Pull Zone
- `attach-domain` - Attach a domain to an existing Storage Zone
- `list-sites` - List all site deployments
- `get-site` - Get detailed information about a site
- `remove-site` - Remove a site deployment record
- `sync-sites` - Sync existing bunny.net sites to database
### Project Management
- `ingest-cora` - Ingest a CORA .xlsx report and create a new project
- `ingest-simple` - Ingest a simple spreadsheet and create a new project
- `list-projects` - List all projects for the authenticated user
### Content Generation
- `generate-batch` - Generate content batch from job file
### Deployment
- `deploy-batch` - Deploy all content in a batch to cloud storage
- `verify-deployment` - Verify deployed URLs return 200 OK status
### Link Export
- `get-links` - Export article URLs with optional link details
## Table of Contents
- [System](#system)
- [User Management](#user-management)
- [Site Management](#site-management)
- [Project Management](#project-management)
- [Content Generation](#content-generation)
- [Deployment](#deployment)
- [Link Export](#link-export)
---
## System
### `config`
Show current configuration
No options required.
**Example:**
```bash
uv run python main.py config
```
---
### `health`
Check system health
No options required.
**Example:**
```bash
uv run python main.py health
```
---
### `models`
List available AI models
No options required.
**Example:**
```bash
uv run python main.py models
```
---
## User Management
### `add-user`
Create a new user (requires admin authentication)
**Options:**
- `--username`
- Type: STRING | Username for the new user
- `--password`
- Type: STRING | Password for the new user
- `--role`
- Type: Choice: `Admin`, `User` | Role for the new user
- `--admin-user`
- Type: STRING | Admin username for authentication
- `--admin-password`
- Type: STRING | Admin password for authentication
**Example:**
```bash
uv run python main.py add-user
```
---
### `delete-user`
Delete a user by username (requires admin authentication)
**Options:**
- `--username`
- Type: STRING | Username to delete
- `--admin-user`
- Type: STRING | Admin username for authentication
- `--admin-password`
- Type: STRING | Admin password for authentication
- `--yes`
- Type: BOOL | Flag (boolean) | Confirm the action without prompting.
**Example:**
```bash
uv run python main.py delete-user
```
---
### `list-users`
List all users (requires admin authentication)
**Options:**
- `--admin-user`
- Type: STRING | Admin username for authentication
- `--admin-password`
- Type: STRING | Admin password for authentication
**Example:**
```bash
uv run python main.py list-users
```
---
## Site Management
### `attach-domain`
Attach a domain to an existing Storage Zone (requires admin)
**Options:**
- `--name`
- Type: STRING | Site name
- `--domain`
- Type: STRING | Custom domain (FQDN, e.g., www.example.com)
- `--storage-name`
- Type: STRING | Existing Storage Zone name
- `--admin-user`
- Type: STRING | Admin username for authentication
- `--admin-password`
- Type: STRING | Admin password for authentication
**Example:**
```bash
uv run python main.py attach-domain
```
---
### `get-site`
Get detailed information about a site deployment (requires admin)
**Options:**
- `--domain`
- Type: STRING | Custom domain to lookup
- `--admin-user`
- Type: STRING | Admin username for authentication
- `--admin-password`
- Type: STRING | Admin password for authentication
**Example:**
```bash
uv run python main.py get-site
```
---
### `list-sites`
List all site deployments (requires admin)
**Options:**
- `--admin-user`
- Type: STRING | Admin username for authentication
- `--admin-password`
- Type: STRING | Admin password for authentication
**Example:**
```bash
uv run python main.py list-sites
```
---
### `provision-site`
Provision a new site with Storage Zone and Pull Zone (requires admin)
**Options:**
- `--name`
- Type: STRING | Site name
- `--domain`
- Type: STRING | Custom domain (FQDN, e.g., www.example.com)
- `--storage-name`
- Type: STRING | Storage Zone name (must be globally unique)
- `--region`
- Type: Choice: `DE`, `NY`, `LA`, `SG`, `SYD` | Storage region
- `--admin-user`
- Type: STRING | Admin username for authentication
- `--admin-password`
- Type: STRING | Admin password for authentication
**Example:**
```bash
uv run python main.py provision-site
```
---
### `remove-site`
Remove a site deployment record (requires admin)
**Options:**
- `--domain`
- Type: STRING | Custom domain to remove
- `--admin-user`
- Type: STRING | Admin username for authentication
- `--admin-password`
- Type: STRING | Admin password for authentication
- `--yes`
- Type: BOOL | Flag (boolean) | Confirm the action without prompting.
**Example:**
```bash
uv run python main.py remove-site
```
---
### `sync-sites`
Sync existing bunny.net sites with custom domains to database (requires admin)
**Options:**
- `--admin-user`
- Type: STRING | Admin username for authentication
- `--admin-password`
- Type: STRING | Admin password for authentication
- `--dry-run`
- Type: BOOL | Flag (boolean) | Show what would be imported without making changes
**Example:**
```bash
uv run python main.py sync-sites
```
---
## Project Management
### `ingest-cora`
Ingest a CORA .xlsx report and create a new project
**Options:**
- `--file`, `-f` **(required)**
- Type: Path (must exist) | Path to CORA .xlsx file
- `--name`, `-n` **(required)**
- Type: STRING | Project name
- `--money-site-url`, `-m`
- Type: STRING | Money site URL (e.g., https://example.com)
- `--custom-anchors`, `-a`
- Type: STRING | Comma-separated list of custom anchor text (optional)
- `--username`, `-u`
- Type: STRING | Username for authentication
- `--password`, `-p`
- Type: STRING | Password for authentication
**Example:**
```bash
uv run python main.py ingest-cora --file path/to/file.xlsx --name "My Project"
```
---
### `ingest-simple`
Ingest a simple spreadsheet and create a new project
Expected spreadsheet format:
- First row: Headers (main_keyword, project_name, related_searches, entities)
- Second row: Data values
Required columns: main_keyword, project_name, related_searches, entities
- main_keyword: Single phrase keyword
- project_name: Name for the project
- related_searches: Comma-delimited list (e.g., "term1, term2, term3")
- entities: Comma-delimited list (e.g., "entity1, entity2, entity3")
Optional columns (with defaults):
- word_count: Default 1500
- term_frequency: Default 3
**Options:**
- `--file`, `-f` **(required)**
- Type: Path (must exist) | Path to simple .xlsx spreadsheet file
- `--name`, `-n`
- Type: STRING | Project name (overrides project_name from spreadsheet if provided)
- `--money-site-url`, `-m`
- Type: STRING | Money site URL (e.g., https://example.com)
- `--username`, `-u`
- Type: STRING | Username for authentication
- `--password`, `-p`
- Type: STRING | Password for authentication
**Example:**
```bash
uv run python main.py ingest-simple --file path/to/file.xlsx
```
---
### `list-projects`
List all projects for the authenticated user
**Options:**
- `--username`, `-u`
- Type: STRING | Username for authentication
- `--password`, `-p`
- Type: STRING | Password for authentication
**Example:**
```bash
uv run python main.py list-projects
```
---
## Content Generation
### `generate-batch`
Generate content batch from job file
**Options:**
- `--job-file`, `-j` **(required)**
- Type: Path (must exist) | Path to job JSON file
- `--username`, `-u`
- Type: STRING | Username for authentication
- `--password`, `-p`
- Type: STRING | Password for authentication
- `--debug`
- Type: BOOL | Flag (boolean) | Save AI responses to debug_output/
- `--continue-on-error`
- Type: BOOL | Flag (boolean) | Continue processing if article generation fails
- `--model`, `-m`
- Type: STRING | Default: `gpt-4o-mini` | AI model to use (gpt-4o-mini, x-ai/grok-4-fast)
**Example:**
```bash
uv run python main.py generate-batch --file path/to/file.xlsx --debug
```
---
## Deployment
### `deploy-batch`
Deploy all content in a batch to cloud storage
**Options:**
- `--batch-id`, `-b` **(required)**
- Type: INT | Project/batch ID to deploy
- `--username`, `-u`
- Type: STRING | Username for authentication
- `--password`, `-p`
- Type: STRING | Password for authentication
- `--continue-on-error`
- Type: BOOL | Flag (boolean) | Continue if file fails (default: True)
- `--dry-run`
- Type: BOOL | Flag (boolean) | Preview what would be deployed
**Example:**
```bash
uv run python main.py deploy-batch --batch-id 1
```
---
### `verify-deployment`
Verify deployed URLs return 200 OK status
**Options:**
- `--batch-id`, `-b` **(required)**
- Type: INT | Project/batch ID to verify
- `--sample`, `-s`
- Type: INT | Number of random URLs to check (default: check all)
- `--timeout`, `-t`
- Type: INT | Default: `10` | Request timeout in seconds (default: 10)
**Example:**
```bash
uv run python main.py verify-deployment --batch-id 1
```
---
## Link Export
### `get-links`
Export article URLs with optional link details for a project and tier
**Options:**
- `--project-id`, `-p` **(required)**
- Type: INT | Project ID to get links for
- `--tier`, `-t` **(required)**
- Type: STRING | Tier to filter (e.g., "1" or "2+" for tier 2 and above)
- `--with-anchor-text`
- Type: BOOL | Flag (boolean) | Include anchor text used for tiered links
- `--with-destination-url`
- Type: BOOL | Flag (boolean) | Include destination URL that the article links to
**Example:**
```bash
uv run python main.py get-links --project-id 1 --tier 1
```
---