title: CLI And Web Share Operations hashtags:
- "#cli"
- "#web-ui"
- "#operations"
- "#reuse"
CLI And Web Share Operations
Intent
Expose operational workflows through both CLI commands and a web UI while keeping the core behavior in shared Go functions.
This avoids drift between automation-friendly commands and browser-driven operator workflows.
When To Use
Use this when the same deployment tool must support local terminal workflows, remote authenticated administration, and less command-line-oriented operational tasks.
Implementation
The CLI entry point in runWithServe dispatches commands such as add, pull, push, generate, launch, backup, restore, service, web, and serve. The web handlers call the same underlying functions where possible:
- Repo add/edit/delete flows read and write
repos.conf. - Pull and push buttons call
pullRepoAtandpushRepoAt. - Generate actions call
generateProjectFilesAtorgenerateServerFilesAt. - Sync preparation calls
prepareRepoEnv. - Launch shells run the same
uppr launch .ordocker composecommand shown to the operator. - Backup and restore routes reuse
backupStateandrestoreStatebehavior.
The local uppr web [path] mode is unauthenticated and bound to 127.0.0.1:9944. The deployment uppr serve [path] mode requires authentication and can bind to a configured or supplied address.
Project Evidence
main.godefinesrunWithServeand the shared CLI operations.web.godefinesserveWeb,serveServer, route handlers, and shared operation calls.auth.gosupplies authentication only whenauthRequiredis true.main_test.goverifies CLI dispatch and serve behavior.
Reuse Notes
Design the web layer as a thin adapter over command functions, not as a separate implementation. Keep local-only web mode and remote authenticated server mode explicit so development convenience does not weaken deployed access controls.