Skip to content

Comments

Move user management scripts to installable module with CLI entry points#69

Merged
lstein merged 3 commits intofeature/multiuserfrom
copilot/move-user-management-scripts
Feb 20, 2026
Merged

Move user management scripts to installable module with CLI entry points#69
lstein merged 3 commits intofeature/multiuserfrom
copilot/move-user-management-scripts

Conversation

Copy link

Copilot AI commented Feb 20, 2026

User management scripts (useradd.py, userdel.py, userlist.py, usermod.py) were only accessible from the source tree, making them unavailable to users who install via PyPI or the launcher.

Changes

  • New module invokeai/app/util/user_management.py — consolidates all four scripts into a single module with public entry-point functions (useradd, userdel, userlist, usermod). Removes the sys.path.insert hack that was only needed for standalone script execution.
  • pyproject.toml — registers four new console scripts:
    "invoke-useradd" = "invokeai.app.util.user_management:useradd"
    "invoke-userdel" = "invokeai.app.util.user_management:userdel"
    "invoke-userlist" = "invokeai.app.util.user_management:userlist"
    "invoke-usermod"  = "invokeai.app.util.user_management:usermod"
  • Bug fixuserlist table output now handles None display_name without raising AttributeError (pre-existing issue in the original script).

QA Instructions

After pip install -e ., verify the four commands are available and functional:

invoke-userlist
invoke-useradd --email test@example.com --password Test1234! --name "Test User"
invoke-usermod --email test@example.com --name "Updated Name"
invoke-userdel --email test@example.com --force

Also verify interactive mode (run each command with no arguments).

Merge Plan

The original scripts in scripts/ are left in place for backwards compatibility. They can be removed in a follow-up if desired.

Checklist

  • The PR has a short but descriptive title, suitable for a changelog
  • Tests added / updated (if applicable)
  • ❗Changes to a redux slice have a corresponding migration
  • Documentation added / updated (if applicable)
  • Updated What's New copy (if doing a release after this PR)
Original prompt

This section details on the original issue you should resolve

<issue_title>[enhancement]: Move user management scripts to modules</issue_title>
<issue_description>### Is there an existing issue for this?

  • I have searched the existing issues

Contact Details

No response

What should this feature add?

Currently the user management scripts (useradd.py, userdel.py, usermod.py, and userlist.py) are scripts located in the scripts/ directory of the repo root. However, when a user installs Invoke from pypi or using the launcher, they won’t have access to the source code repository, so they won’t be able to use the scripts.

The desired enhancement is to covert these scripts into a module that creates a series of command entry points referenced in pyproject.toml’s [project.scripts] section. I think the entry points to the scripts should be in a module located in invokeai/app/util/user_management.py. To avoid clashing with other shell scripts, the commands should be named invoke-useradd, invoke-userdel, invoke-userlist and invoke-usermod.

Alternatives

No response

Additional Content

No response</issue_description>

Comments on the Issue (you are @copilot in this section)


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

…od entry points

Co-authored-by: lstein <111189+lstein@users.noreply.github.com>
Copilot AI changed the title [WIP] Enhance user management by moving scripts to modules Move user management scripts to installable module with CLI entry points Feb 20, 2026
Copilot AI requested a review from lstein February 20, 2026 05:47
@lstein lstein marked this pull request as ready for review February 20, 2026 12:35
Copy link
Owner

@lstein lstein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works as advertised.

@lstein lstein merged commit a2b46dc into feature/multiuser Feb 20, 2026
13 checks passed
@lstein lstein deleted the copilot/move-user-management-scripts branch February 20, 2026 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants