diff --git a/scripts/generate_cli_docs.py b/scripts/generate_cli_docs.py index df46c6f..bfe538b 100644 --- a/scripts/generate_cli_docs.py +++ b/scripts/generate_cli_docs.py @@ -20,6 +20,7 @@ sys.path.insert(0, str(Path(__file__).resolve().parent.parent / "src")) import click +import typer.core import typer.main from social_hook.cli import app @@ -30,6 +31,9 @@ # Commands to exclude from docs (internal hooks) HIDDEN_COMMANDS = {"commit-hook", "git-hook", "narrative-capture"} +_OPTION_TYPES = (click.Option, typer.core.TyperOption) +_ARGUMENT_TYPES = (click.Argument, typer.core.TyperArgument) + def get_click_app() -> click.Group: return typer.main.get_command(app) @@ -76,7 +80,7 @@ def render_params(cmd: click.Command) -> str: skip = {"install_completion", "show_completion", "help", "ctx"} # Arguments - args = [p for p in cmd.params if isinstance(p, click.Argument)] + args = [p for p in cmd.params if isinstance(p, _ARGUMENT_TYPES)] if args: lines.append("**Arguments:**") lines.append("") @@ -93,7 +97,7 @@ def render_params(cmd: click.Command) -> str: lines.append("") # Options - opts = [p for p in cmd.params if isinstance(p, click.Option) and p.name not in skip] + opts = [p for p in cmd.params if isinstance(p, _OPTION_TYPES) and p.name not in skip] if opts: lines.append("**Options:**") lines.append("") diff --git a/site-docs/DOC_STATUS.md b/site-docs/DOC_STATUS.md index 383d019..e0a0b4d 100644 --- a/site-docs/DOC_STATUS.md +++ b/site-docs/DOC_STATUS.md @@ -1,5 +1,5 @@ - - + + # Documentation Status @@ -96,16 +96,17 @@ Tracks coverage of external docs against the codebase. Used by the docs maintena | Check | Last passed | Notes | |-------|-------------|-------| -| CLI docs are fresh (`generate_cli_docs.py` output matches committed) | 2026-04-16 | | -| `mkdocs.yml` nav entries match files in `site-docs/cli/` | 2026-04-16 | | -| OAuth env vars in config.md use OAuth 2.0 names (`X_CLIENT_ID`, not `CONSUMER_KEY`) | 2026-04-16 | | -| `ruff check src/ tests/` passes | 2026-04-16 | | -| `mypy src/social_hook/` has no new errors (only pre-existing library stub issues) | 2026-04-16 | 28 errors, all `import-untyped` or `no-any-return` pre-existing; fixed new `assignment` error in `brief.py` | -| All CLI commands with poor/partial docstrings have been enriched | 2026-04-16 | 16 commands across 6 files enriched | -| `pipeline.md` accurately describes the two-stage evaluation flow and targets path | 2026-04-16 | | -| `narrative-arcs.md` uses `episode_tags` (not `episode_type`) and documents strategy-scoped arcs | 2026-04-16 | | -| All interactive CLI commands (e.g., `credentials add`) have documented non-interactive equivalents for agent/CI use | 2026-04-16 | `credentials add --set`, all destructive commands have `--yes`; `setup` wizard → write config.yaml directly | -| All CLI command groups have enriched group-level help text (not just terse labels) | 2026-04-16 | `project` and `journey` enriched this run; all 24 groups now have descriptive help | +| CLI docs are fresh (`generate_cli_docs.py` output matches committed) | 2026-07-08 | Fixed Typer 0.26 compat — `TyperOption`/`TyperArgument` no longer inherit from Click classes | +| `mkdocs.yml` nav entries match files in `site-docs/cli/` | 2026-07-08 | 24/24 | +| OAuth env vars in config.md use OAuth 2.0 names (`X_CLIENT_ID`, not `CONSUMER_KEY`) | 2026-07-08 | | +| `ruff check src/ tests/` passes | 2026-07-08 | | +| `ruff format --check src/ tests/` passes | 2026-07-08 | | +| `mypy src/social_hook/` has no new errors (only pre-existing library stub issues) | 2026-07-08 | 28 errors, all `import-untyped` or `no-any-return` pre-existing | +| All CLI commands with poor/partial docstrings have been enriched | 2026-07-08 | | +| `pipeline.md` accurately describes the two-stage evaluation flow and targets path | 2026-07-08 | | +| `narrative-arcs.md` uses `episode_tags` (not `episode_type`) and documents strategy-scoped arcs | 2026-07-08 | | +| All interactive CLI commands (e.g., `credentials add`) have documented non-interactive equivalents for agent/CI use | 2026-07-08 | `credentials add --set`, all destructive commands have `--yes`; `setup` wizard → write config.yaml directly | +| All CLI command groups have enriched group-level help text (not just terse labels) | 2026-07-08 | All 24 groups + subgroups have descriptive help; `project intro` enriched this run | ## Backlog (waiting_approval) diff --git a/site-docs/cli/arc.md b/site-docs/cli/arc.md index d6e82cc..504631b 100644 --- a/site-docs/cli/arc.md +++ b/site-docs/cli/arc.md @@ -1,6 +1,6 @@ # social-hook arc -Manage narrative arcs. +Manage narrative arcs. Arcs are multi-post storylines that group related content under a theme, giving your audience a coherent thread to follow across posts. --- diff --git a/site-docs/cli/bot.md b/site-docs/cli/bot.md index de2b1de..e9260a8 100644 --- a/site-docs/cli/bot.md +++ b/site-docs/cli/bot.md @@ -1,6 +1,6 @@ # social-hook bot -Bot daemon management. +Start, stop, and check status of the Telegram/Discord bot daemon. The bot provides an interactive chat interface for reviewing drafts, approving posts, and managing the pipeline. --- diff --git a/site-docs/cli/config.md b/site-docs/cli/config.md index db771a0..65c14c0 100644 --- a/site-docs/cli/config.md +++ b/site-docs/cli/config.md @@ -1,6 +1,6 @@ # social-hook config -View and modify configuration. +View and modify the Social Hook configuration. Read the full config as YAML, get individual values by dotted key path, or set scalar values without editing files directly. --- diff --git a/site-docs/cli/decision.md b/site-docs/cli/decision.md index 9b5141b..75f2fdc 100644 --- a/site-docs/cli/decision.md +++ b/site-docs/cli/decision.md @@ -1,6 +1,6 @@ # social-hook decision -Decision management. +Manage evaluation decisions. Decisions record whether a commit was deemed post-worthy by the LLM evaluator. Use these commands to list, delete, retrigger, rewind, or batch-evaluate decisions. --- diff --git a/site-docs/cli/draft.md b/site-docs/cli/draft.md index 90b62d6..1c7e18c 100644 --- a/site-docs/cli/draft.md +++ b/site-docs/cli/draft.md @@ -1,6 +1,6 @@ # social-hook draft -Draft lifecycle management. +Manage the full draft lifecycle. Approve, reject, schedule, edit, redraft, promote, and post drafts. Also manage media attachments and view draft details and change history. --- diff --git a/site-docs/cli/index.md b/site-docs/cli/index.md index 8e35199..f4f7e2a 100644 --- a/site-docs/cli/index.md +++ b/site-docs/cli/index.md @@ -21,23 +21,23 @@ These options can be placed before any command. |-------|-------------| | [`account`](account.md) | Manage OAuth-authenticated platform accounts (X, LinkedIn). | | [`advisory`](advisory.md) | Manage advisory items — operator action items for manual tasks. | -| [`arc`](arc.md) | Manage narrative arcs. | -| [`bot`](bot.md) | Bot daemon management. | +| [`arc`](arc.md) | Manage narrative arcs. Arcs are multi-post storylines that group related content under a theme, giving your audience a coherent thread to follow across posts. | +| [`bot`](bot.md) | Start, stop, and check status of the Telegram/Discord bot daemon. The bot provides an interactive chat interface for reviewing drafts, approving posts, and managing the pipeline. | | [`brief`](brief.md) | View and edit the project brief used by the evaluator and drafter. | -| [`config`](config.md) | View and modify configuration. | +| [`config`](config.md) | View and modify the Social Hook configuration. Read the full config as YAML, get individual values by dotted key path, or set scalar values without editing files directly. | | [`content`](content.md) | Submit content ideas, combine topics, and trigger hero launch drafts. | | [`credentials`](credentials.md) | Manage API keys and secrets in ~/.social-hook/.env. | | [`cycles`](cycles.md) | Inspect evaluation cycle history and per-strategy outcomes. | -| [`decision`](decision.md) | Decision management. | -| [`draft`](draft.md) | Draft lifecycle management. | -| [`inspect`](inspect.md) | Inspect system state. | +| [`decision`](decision.md) | Manage evaluation decisions. Decisions record whether a commit was deemed post-worthy by the LLM evaluator. Use these commands to list, delete, retrigger, rewind, or batch-evaluate decisions. | +| [`draft`](draft.md) | Manage the full draft lifecycle. Approve, reject, schedule, edit, redraft, promote, and post drafts. Also manage media attachments and view draft details and change history. | +| [`inspect`](inspect.md) | Inspect system state. View the event log, list pending drafts awaiting action, check LLM token usage, and see configured platform connections. | | [`journey`](journey.md) | Control Development Journey capture. When enabled, Claude Code hooks record session narratives that feed into the evaluation pipeline as rich development context. | -| [`logs`](logs.md) | Log queries, tailing, and health. | -| [`manual`](manual.md) | Manual operations. | -| [`media`](media.md) | Media management. | -| [`memory`](memory.md) | Manage voice memories. | +| [`logs`](logs.md) | Query, tail, and manage log entries. View recent errors and warnings, follow live log output, clear old entries, and check overall system health across all pipeline components. | +| [`manual`](manual.md) | Run pipeline steps manually. Evaluate a commit, create drafts from a decision, consolidate multiple decisions into one draft, or post an approved draft — bypassing the automated scheduler. | +| [`media`](media.md) | Manage generated media assets. Run garbage collection to remove orphaned files from the media cache that are no longer referenced by any draft. | +| [`memory`](memory.md) | Manage voice memories. Voice memories are persistent style and tone instructions that the LLM drafter uses when generating content, such as 'avoid jargon' or 'use first person plural'. | | [`project`](project.md) | Register and manage projects. A project links a git repository (or folder) to Social Hook so commits are evaluated, content is drafted, and briefs are maintained. | -| [`snapshot`](snapshot.md) | DB snapshot management. | +| [`snapshot`](snapshot.md) | Save, restore, and manage database snapshots. Snapshots let you bookmark the full system state and roll back if needed. A safety backup is created automatically before any restore or reset. | | [`strategy`](strategy.md) | View and customize content strategies (voice, audience, editorial rules). | | [`target`](target.md) | Configure where content is distributed (account + destination + strategy). | | [`topics`](topics.md) | Manage the prioritised content topic queue per strategy. | @@ -55,7 +55,7 @@ These options can be placed before any command. | [`rate-limits`](root-commands.md#social-hook-rate-limits) | Show current rate limit status (daily cap, gap timer, queue, cost). | | [`scheduler-tick`](root-commands.md#social-hook-scheduler-tick) | Post scheduled drafts whose time has arrived and promote deferred drafts. | | [`setup`](root-commands.md#social-hook-setup) | Configure social-hook. | -| [`test`](root-commands.md#social-hook-test) | Test commit evaluation. | +| [`test`](root-commands.md#social-hook-test) | Dry-run commit evaluation with real LLM calls but no database writes. Tests whether the AI considers commits post-worthy, with options to save results as JSON (--output) and diff against a previous run for regression testing (--compare). | | [`trigger`](root-commands.md#social-hook-trigger) | Run the full evaluation-to-draft pipeline for a single commit. | | [`version`](root-commands.md#social-hook-version) | Show version information. | | [`web`](root-commands.md#social-hook-web) | Start the web dashboard for managing your social-hook workflow visually. | diff --git a/site-docs/cli/inspect.md b/site-docs/cli/inspect.md index 40ff3e8..84b464b 100644 --- a/site-docs/cli/inspect.md +++ b/site-docs/cli/inspect.md @@ -1,6 +1,6 @@ # social-hook inspect -Inspect system state. +Inspect system state. View the event log, list pending drafts awaiting action, check LLM token usage, and see configured platform connections. --- diff --git a/site-docs/cli/logs.md b/site-docs/cli/logs.md index bf4c4e3..3e83b39 100644 --- a/site-docs/cli/logs.md +++ b/site-docs/cli/logs.md @@ -1,6 +1,6 @@ # social-hook logs -Log queries, tailing, and health. +Query, tail, and manage log entries. View recent errors and warnings, follow live log output, clear old entries, and check overall system health across all pipeline components. **Group options:** diff --git a/site-docs/cli/manual.md b/site-docs/cli/manual.md index c77cccb..26d6c6c 100644 --- a/site-docs/cli/manual.md +++ b/site-docs/cli/manual.md @@ -1,6 +1,6 @@ # social-hook manual -Manual operations. +Run pipeline steps manually. Evaluate a commit, create drafts from a decision, consolidate multiple decisions into one draft, or post an approved draft — bypassing the automated scheduler. --- diff --git a/site-docs/cli/media.md b/site-docs/cli/media.md index b0b1bd6..55ac480 100644 --- a/site-docs/cli/media.md +++ b/site-docs/cli/media.md @@ -1,6 +1,6 @@ # social-hook media -Media management. +Manage generated media assets. Run garbage collection to remove orphaned files from the media cache that are no longer referenced by any draft. --- diff --git a/site-docs/cli/memory.md b/site-docs/cli/memory.md index e857b7d..489434c 100644 --- a/site-docs/cli/memory.md +++ b/site-docs/cli/memory.md @@ -1,6 +1,6 @@ # social-hook memory -Manage voice memories. +Manage voice memories. Voice memories are persistent style and tone instructions that the LLM drafter uses when generating content, such as 'avoid jargon' or 'use first person plural'. --- diff --git a/site-docs/cli/project.md b/site-docs/cli/project.md index ad24469..d920c9d 100644 --- a/site-docs/cli/project.md +++ b/site-docs/cli/project.md @@ -73,7 +73,7 @@ Example: social-hook project install-hook /path/to/repo ### `social-hook project intro` -Manage per-platform introduction status. +Manage per-platform introduction status. Tracks whether a project has posted its first 'introduction' on each platform — the intro post establishes context before regular content begins. Use 'status' to see which platforms have been introduced, 'set' to mark a platform as introduced, and 'reset' to clear introduction state. **Options:** diff --git a/site-docs/cli/root-commands.md b/site-docs/cli/root-commands.md index 695e40a..99f41db 100644 --- a/site-docs/cli/root-commands.md +++ b/site-docs/cli/root-commands.md @@ -152,7 +152,7 @@ Configure social-hook. ### `social-hook test` -Test commit evaluation. +Dry-run commit evaluation with real LLM calls but no database writes. Tests whether the AI considers commits post-worthy, with options to save results as JSON (--output) and diff against a previous run for regression testing (--compare). **Options:** diff --git a/site-docs/cli/snapshot.md b/site-docs/cli/snapshot.md index 5ad19e9..56bc022 100644 --- a/site-docs/cli/snapshot.md +++ b/site-docs/cli/snapshot.md @@ -1,6 +1,6 @@ # social-hook snapshot -DB snapshot management. +Save, restore, and manage database snapshots. Snapshots let you bookmark the full system state and roll back if needed. A safety backup is created automatically before any restore or reset. --- diff --git a/src/social_hook/cli/__init__.py b/src/social_hook/cli/__init__.py index 4f40f21..0c4ef7a 100644 --- a/src/social_hook/cli/__init__.py +++ b/src/social_hook/cli/__init__.py @@ -161,6 +161,10 @@ def help_cmd( import json as json_mod import click + import typer.core + + _OPTION_TYPES = (click.Option, typer.core.TyperOption) + _ARGUMENT_TYPES = (click.Argument, typer.core.TyperArgument) click_app = typer.main.get_command(app) # Handle --json appearing after command path (forgiving flag placement) @@ -190,7 +194,7 @@ def _cmd_to_dict(cmd, name=None): args = [] for param in cmd.params: - if isinstance(param, click.Argument): + if isinstance(param, _ARGUMENT_TYPES): args.append( { "name": param.name, @@ -203,7 +207,7 @@ def _cmd_to_dict(cmd, name=None): opts = [] skip_names = {"install_completion", "show_completion", "help", "ctx"} for param in cmd.params: - if isinstance(param, click.Option): + if isinstance(param, _OPTION_TYPES): if param.name in skip_names: continue opt_info = { @@ -260,7 +264,7 @@ def _resolve_command(parts): global_options = [] skip_names = {"install_completion", "show_completion", "help", "ctx"} for param in click_app.params: - if isinstance(param, click.Option) and param.name not in skip_names: + if isinstance(param, _OPTION_TYPES) and param.name not in skip_names: opt_info = { "name": param.opts[0] if param.opts else f"--{param.name}", } @@ -298,8 +302,8 @@ def _resolve_command(parts): typer.echo(f"Error: {e}") raise typer.Exit(1) from None else: - help_ctx = click.Context(click_app, info_name=PROJECT_SLUG) - typer.echo(click_app.get_help(help_ctx)) + help_ctx = click.Context(click_app, info_name=PROJECT_SLUG) # type: ignore[arg-type] + typer.echo(click_app.get_help(help_ctx)) # type: ignore[arg-type] @app.command() @@ -527,7 +531,11 @@ def _kill_port(p: int) -> None: # Bot subcommand group # ============================================================================= -bot_app = typer.Typer(name="bot", help="Bot daemon management.", no_args_is_help=True) +bot_app = typer.Typer( + name="bot", + help="Start, stop, and check status of the Telegram/Discord bot daemon. The bot provides an interactive chat interface for reviewing drafts, approving posts, and managing the pipeline.", + no_args_is_help=True, +) app.add_typer(bot_app, name="bot") @@ -970,16 +978,33 @@ def narrative_capture(): ) # Inspection commands: log, pending, usage -app.add_typer(inspect_app, name="inspect", help="Inspect system state.") +app.add_typer( + inspect_app, + name="inspect", + help="Inspect system state. View the event log, list pending drafts awaiting action, check LLM token usage, and see configured platform connections.", +) # Manual commands: evaluate, draft, post -app.add_typer(manual_app, name="manual", help="Manual operations.") +app.add_typer( + manual_app, + name="manual", + help="Run pipeline steps manually. Evaluate a commit, create drafts from a decision, consolidate multiple decisions into one draft, or post an approved draft — bypassing the automated scheduler.", +) # Setup wizard app.add_typer(setup_app, name="setup", help=f"Configure {PROJECT_SLUG}.") # Test command -app.add_typer(test_app, name="test", help="Test commit evaluation.") +app.add_typer( + test_app, + name="test", + help=( + "Dry-run commit evaluation with real LLM calls but no database writes. " + "Tests whether the AI considers commits post-worthy, with options to save " + "results as JSON (--output) and diff against a previous run for regression " + "testing (--compare)." + ), +) # Journey capture commands: on, off, status app.add_typer( @@ -989,32 +1014,60 @@ def narrative_capture(): ) # Config commands: show, get, set -app.add_typer(config_app, name="config", help="View and modify configuration.") +app.add_typer( + config_app, + name="config", + help="View and modify the Social Hook configuration. Read the full config as YAML, get individual values by dotted key path, or set scalar values without editing files directly.", +) # Memory commands: list, add, delete, clear -app.add_typer(memory_app, name="memory", help="Manage voice memories.") +app.add_typer( + memory_app, + name="memory", + help="Manage voice memories. Voice memories are persistent style and tone instructions that the LLM drafter uses when generating content, such as 'avoid jargon' or 'use first person plural'.", +) # Arc commands: list, create, complete, abandon -app.add_typer(arc_app, name="arc", help="Manage narrative arcs.") +app.add_typer( + arc_app, + name="arc", + help="Manage narrative arcs. Arcs are multi-post storylines that group related content under a theme, giving your audience a coherent thread to follow across posts.", +) from social_hook.cli.decision import app as decision_app from social_hook.cli.draft import app as draft_app -# Decision management: list, delete -app.add_typer(decision_app, name="decision", help="Decision management.") +# Decision management: list, delete, retrigger, rewind, batch-evaluate +app.add_typer( + decision_app, + name="decision", + help="Manage evaluation decisions. Decisions record whether a commit was deemed post-worthy by the LLM evaluator. Use these commands to list, delete, retrigger, rewind, or batch-evaluate decisions.", +) # Draft lifecycle: approve, reject, schedule, cancel, retry, edit, etc. -app.add_typer(draft_app, name="draft", help="Draft lifecycle management.") +app.add_typer( + draft_app, + name="draft", + help="Manage the full draft lifecycle. Approve, reject, schedule, edit, redraft, promote, and post drafts. Also manage media attachments and view draft details and change history.", +) from social_hook.cli.media import app as media_app # Media commands: gc -app.add_typer(media_app, name="media", help="Media management.") +app.add_typer( + media_app, + name="media", + help="Manage generated media assets. Run garbage collection to remove orphaned files from the media cache that are no longer referenced by any draft.", +) from social_hook.cli.snapshot import app as snapshot_app # DB snapshot management: save, restore, reset, list, delete -app.add_typer(snapshot_app, name="snapshot", help="DB snapshot management.") +app.add_typer( + snapshot_app, + name="snapshot", + help="Save, restore, and manage database snapshots. Snapshots let you bookmark the full system state and roll back if needed. A safety backup is created automatically before any restore or reset.", +) from social_hook.cli.account import app as account_app from social_hook.cli.advisory import app as advisory_app @@ -1091,7 +1144,11 @@ def narrative_capture(): ) # Log queries, tailing, and health -app.add_typer(logs_app, name="logs", help="Log queries, tailing, and health.") +app.add_typer( + logs_app, + name="logs", + help="Query, tail, and manage log entries. View recent errors and warnings, follow live log output, clear old entries, and check overall system health across all pipeline components.", +) from social_hook.cli.events import events as events_cmd from social_hook.cli.quickstart import quickstart as quickstart_cmd diff --git a/src/social_hook/cli/arc.py b/src/social_hook/cli/arc.py index 933c49f..0b5284a 100644 --- a/src/social_hook/cli/arc.py +++ b/src/social_hook/cli/arc.py @@ -4,7 +4,10 @@ import typer -app = typer.Typer(no_args_is_help=True) +app = typer.Typer( + no_args_is_help=True, + help="Manage narrative arcs. Arcs are multi-post storylines that group related content under a theme, giving your audience a coherent thread to follow across posts.", +) def _resolve_project(project: str | None = None) -> str: diff --git a/src/social_hook/cli/config.py b/src/social_hook/cli/config.py index a38aacf..6a5748f 100644 --- a/src/social_hook/cli/config.py +++ b/src/social_hook/cli/config.py @@ -5,7 +5,10 @@ import typer import yaml -app = typer.Typer(no_args_is_help=True) +app = typer.Typer( + no_args_is_help=True, + help="View and modify the Social Hook configuration. Read the full config as YAML, get individual values by dotted key path, or set scalar values without editing files directly.", +) def _parse_value(value: str): diff --git a/src/social_hook/cli/decision.py b/src/social_hook/cli/decision.py index b7a8368..5fbcf88 100644 --- a/src/social_hook/cli/decision.py +++ b/src/social_hook/cli/decision.py @@ -7,7 +7,10 @@ import typer -app = typer.Typer(no_args_is_help=True) +app = typer.Typer( + no_args_is_help=True, + help="Manage evaluation decisions. Decisions record whether a commit was deemed post-worthy by the LLM evaluator. Use these commands to list, delete, retrigger, rewind, or batch-evaluate decisions.", +) def _get_conn(): diff --git a/src/social_hook/cli/draft.py b/src/social_hook/cli/draft.py index 62792ab..d7c3c4f 100644 --- a/src/social_hook/cli/draft.py +++ b/src/social_hook/cli/draft.py @@ -9,7 +9,10 @@ from social_hook.models.enums import PENDING_STATUSES, TERMINAL_STATUSES -app = typer.Typer(no_args_is_help=True) +app = typer.Typer( + no_args_is_help=True, + help="Manage the full draft lifecycle. Approve, reject, schedule, edit, redraft, promote, and post drafts. Also manage media attachments and view draft details and change history.", +) def _get_conn(): diff --git a/src/social_hook/cli/inspect.py b/src/social_hook/cli/inspect.py index 267a59d..23d13cc 100644 --- a/src/social_hook/cli/inspect.py +++ b/src/social_hook/cli/inspect.py @@ -2,7 +2,9 @@ import typer -app = typer.Typer() +app = typer.Typer( + help="Inspect system state. View the event log, list pending drafts awaiting action, check LLM token usage, and see configured platform connections." +) @app.command() diff --git a/src/social_hook/cli/logs.py b/src/social_hook/cli/logs.py index 89587ea..84ce775 100644 --- a/src/social_hook/cli/logs.py +++ b/src/social_hook/cli/logs.py @@ -6,7 +6,10 @@ import typer -app = typer.Typer(invoke_without_command=True) +app = typer.Typer( + invoke_without_command=True, + help="Query, tail, and manage log entries. View recent errors and warnings, follow live log output, clear old entries, and check overall system health across all pipeline components.", +) VALID_LOG_COMPONENTS = ( "trigger", diff --git a/src/social_hook/cli/manual.py b/src/social_hook/cli/manual.py index 9e895d2..39288d5 100644 --- a/src/social_hook/cli/manual.py +++ b/src/social_hook/cli/manual.py @@ -4,7 +4,9 @@ from social_hook.models.enums import PENDING_STATUSES -app = typer.Typer() +app = typer.Typer( + help="Run pipeline steps manually. Evaluate a commit, create drafts from a decision, consolidate multiple decisions into one draft, or post an approved draft — bypassing the automated scheduler.", +) @app.command() diff --git a/src/social_hook/cli/media.py b/src/social_hook/cli/media.py index d5d7a3f..77aa7fb 100644 --- a/src/social_hook/cli/media.py +++ b/src/social_hook/cli/media.py @@ -4,7 +4,11 @@ import typer -app = typer.Typer(name="media", help="Media management.", no_args_is_help=True) +app = typer.Typer( + name="media", + help="Manage generated media assets. Run garbage collection to remove orphaned files from the media cache that are no longer referenced by any draft.", + no_args_is_help=True, +) @app.command("gc") diff --git a/src/social_hook/cli/memory.py b/src/social_hook/cli/memory.py index 2e515b9..ff2bc56 100644 --- a/src/social_hook/cli/memory.py +++ b/src/social_hook/cli/memory.py @@ -4,7 +4,10 @@ import typer -app = typer.Typer(no_args_is_help=True) +app = typer.Typer( + no_args_is_help=True, + help="Manage voice memories. Voice memories are persistent style and tone instructions that the LLM drafter uses when generating content, such as 'avoid jargon' or 'use first person plural'.", +) def _resolve_project(project: str | None = None) -> str: diff --git a/src/social_hook/cli/project.py b/src/social_hook/cli/project.py index 4dd0d78..f05f538 100644 --- a/src/social_hook/cli/project.py +++ b/src/social_hook/cli/project.py @@ -9,7 +9,9 @@ app = typer.Typer( help="Register and manage projects. A project links a git repository (or folder) to Social Hook so commits are evaluated, content is drafted, and briefs are maintained." ) -intro_app = typer.Typer(help="Manage per-platform introduction status.") +intro_app = typer.Typer( + help="Manage per-platform introduction status. Tracks whether a project has posted its first 'introduction' on each platform — the intro post establishes context before regular content begins. Use 'status' to see which platforms have been introduced, 'set' to mark a platform as introduced, and 'reset' to clear introduction state." +) app.add_typer(intro_app, name="intro") prompt_docs_app = typer.Typer(help="Manage project prompt documentation files.") app.add_typer(prompt_docs_app, name="prompt-docs") diff --git a/src/social_hook/cli/snapshot.py b/src/social_hook/cli/snapshot.py index d2dd865..d6f6455 100644 --- a/src/social_hook/cli/snapshot.py +++ b/src/social_hook/cli/snapshot.py @@ -8,7 +8,10 @@ import typer -app = typer.Typer(no_args_is_help=True) +app = typer.Typer( + no_args_is_help=True, + help="Save, restore, and manage database snapshots. Snapshots let you bookmark the full system state and roll back if needed. A safety backup is created automatically before any restore or reset.", +) _NAME_RE = re.compile(r"^[a-zA-Z0-9_-]+$") _MAX_NAME_LEN = 64 diff --git a/tests/test_quickstart.py b/tests/test_quickstart.py index 027b276..1520627 100644 --- a/tests/test_quickstart.py +++ b/tests/test_quickstart.py @@ -8,6 +8,7 @@ import click import pytest +import typer from typer.testing import CliRunner from social_hook.cli.quickstart import ( @@ -65,12 +66,12 @@ def mock_project(): class TestErrorExit: def test_error_exit_text(self, capsys): - with pytest.raises(click.exceptions.Exit): + with pytest.raises((click.exceptions.Exit, typer.Exit)): _error_exit("something broke", is_json=False) assert "Error: something broke" in capsys.readouterr().err def test_error_exit_json(self, capsys): - with pytest.raises(click.exceptions.Exit): + with pytest.raises((click.exceptions.Exit, typer.Exit)): _error_exit("something broke", is_json=True) out = capsys.readouterr().out data = json.loads(out) @@ -137,7 +138,7 @@ def test_auto_configure_no_provider_exits(self, temp_dir): "social_hook.setup.wizard.discover_providers", return_value=providers, ), - pytest.raises(click.exceptions.Exit), + pytest.raises((click.exceptions.Exit, typer.Exit)), ): _auto_configure( temp_dir, api_key=None, strategies=["building-public"], is_json=True, verbose=False