Skip to content

Comments

Add --root option to user management CLI utilities#81

Merged
lstein merged 2 commits intofeature/multiuserfrom
copilot/add-root-option-user-management
Feb 23, 2026
Merged

Add --root option to user management CLI utilities#81
lstein merged 2 commits intofeature/multiuserfrom
copilot/add-root-option-user-management

Conversation

Copy link

Copilot AI commented Feb 22, 2026

Summary

invoke-useradd, invoke-userdel, invoke-usermod, and invoke-userlist had no way to specify the InvokeAI root directory from the command line, making them difficult to use in multi-root deployments.

  • Adds --root / -r argument to all four entry points in invokeai/app/util/user_management.py
  • When --root is provided, sets os.environ["INVOKEAI_ROOT"] before get_config() is first called (it's @lru_cache-backed), so InvokeAIAppConfig.find_root() picks up the override
  • INVOKEAI_ROOT env var was already respected via find_root() — no change needed there
invoke-userlist --root /path/to/invokeai
invoke-useradd --root /path/to/invokeai --email user@example.com --password secret

Related Issues / Discussions

Closes #[issue]

QA Instructions

Run any user management command with --root /some/invokeai/path and verify it reads/writes users from the database at that root. Also verify INVOKEAI_ROOT=/some/path invoke-userlist continues to work without --root.

Merge Plan

N/A

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>[bug]: User management utilities should accept a —root option.</issue_title>
<issue_description>### Is there an existing issue for this problem?

  • I have searched the existing issues

Install method

Invoke's Launcher

Operating system

Linux

GPU vendor

Nvidia (CUDA)

GPU model

No response

GPU VRAM

No response

Version number

feature/multiuser

Browser

No response

System Information

No response

What happened

The user management commands invoke-useradd, invoke-userdel, invoke-usermod and invoke-userlist should accept a —root argument to select the invokeai root directory. They should also respect the INVOKEAI_ROOT environment variable, which does the same thing.

What you expected to happen

These commands should accept —root and respect INVOKEAI_ROOT.

How to reproduce the problem

No response

Additional context

No response

Discord username

No response</issue_description>

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


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: lstein <111189+lstein@users.noreply.github.com>
Copilot AI changed the title [WIP] Add root option for user management utilities Add --root option to user management CLI utilities Feb 22, 2026
Copilot AI requested a review from lstein February 22, 2026 19:02
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 marked this pull request as ready for review February 23, 2026 02:00
@lstein lstein merged commit eac412d into feature/multiuser Feb 23, 2026
12 checks passed
@lstein lstein deleted the copilot/add-root-option-user-management branch February 23, 2026 02:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants