Skip to content

CLI: --list-profiles and a machine-readable --json result #176

Closed

Description

@TMHSDigital

Summary

--profile NAME is the main scripting entry point, but the CLI cannot list profile names, and headless runs end with a free-text line only.

Where

  • autoclicker/cli.py:84, :136-139
  • autoclicker/cli.py:316-329
  • autoclicker/utils/profiles.py:152 (get_preset_names)

Details

A wrong name prints "No profile named 'X'" with no list of valid names. Completed and user-stopped runs both exit 0, and the click count and runtime are only in prose.

Impact

People writing Task Scheduler entries must open the GUI to check exact names, and scripts chaining runs cannot read results reliably.

Suggested fix

Add --list-profiles (one name per line with describe_profile(), exit 0) and include the available names in the not-found error. Add --json printing {"reason", "message", "clicks", "seconds", "exit_code"} to stdout with progress on stderr. The windowed exe shows help in a dialog, so the list needs the same handling there.

Acceptance criteria

  • --list-profiles implemented and documented
  • --json output documented with stable fields

Getting started

  • Relevant files: autoclicker/cli.py, README.md, tests/test_cli.py
  • How to run tests: make check (Git Bash) or tasks.bat lint, tasks.bat typecheck, tasks.bat test (cmd). Single test: python -m pytest tests/test_x.py::TestClass::test_name --no-cov
  • Related docs: CONTRIBUTING.md, docs/ARCHITECTURE.md

Filed by repo-audit/full-audit at 9968dc8. Severity: medium. Effort: S. audit-key: enhancement|autoclicker/cli.py|list profiles

Activity

  1. added
    enhancement
    priority: medium
    on Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementpriority: medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions