Commit ae5d009
authored
feat(cli): add unified setup wizard consolidating init/install/docker flows (#132)
* feat(cli): add unified setup wizard consolidating init/install/docker flows (#129)
Create `gitlab-mcp setup` command that unifies the three separate wizards
(init, install, docker init) into a single entry point with discovery,
mode selection, tool configuration, and multiple execution flows.
- Add src/cli/setup/ module with types, presets, discovery, wizard, and flows
- Add local-setup, server-setup, configure-existing, and tool-selection flows
- Define 18 tool categories and 6 preset definitions (developer, senior-dev,
devops, code-reviewer, full-access, readonly)
- Add missing preset YAML files: code-reviewer.yaml, full-access.yaml
- Route `init` as alias to `setup --mode=local`
- Route `docker init` as alias to `setup --mode=server`
- Update cli-utils.ts with setup command and --mode flag parsing
- Add 43 unit tests for presets, discovery, and wizard modules
* refactor(setup): align env vars with config and add category application
- Rename USE_ISSUES/USE_WIKI/etc to USE_WORKITEMS/USE_GITLAB_WIKI/etc
- Rename GITLAB_SCOPE_* to GITLAB_PROJECT_ID/GITLAB_ALLOWED_PROJECT_IDS
- Rename GITLAB_MCP_PRESET to GITLAB_PROFILE
- Rename GITLAB_URL to GITLAB_API_URL in local-setup
- Apply toolConfig env to Docker config in server-setup
- Add applyManualCategories() for manual mode category disabling
- Add failure reporting in configure-existing updateClients
- Replace process.exit(0) with null return in wizard cancel path
- Remove unused skipGitlab option from wizard
- Use manage_repository:fork in code-reviewer profile
- Add unit tests for setup flow modules
* refactor(setup): remove commits mapping, rename scope option, persist env to Docker
- Remove "commits" from CATEGORY_ENV_MAP (browse_commits is always-on core)
- Rename "namespace" scope option to "allowlist" with clearer prompt
- Add environment field to DockerConfig type
- Persist tool config env vars into docker-compose via generateDockerCompose
- Make SetupResult.mode optional for cancel-before-selection path
- Add generateDockerCompose environment tests
* fix(discovery): add docker-compose v1 fallback for compose detection
detectDocker now checks both `docker compose version` (v2) and
`docker-compose --version` (v1) for consistency with docker-utils.
* feat(docker): add native Podman support with container runtime detection
Add container-runtime module that detects Docker or Podman automatically.
When Docker is unavailable, falls back to podman/podman-compose for all
container operations. Centralizes runtime detection with process-level
caching, eliminating duplicated logic in discovery.ts.
* fix(setup): use runtime-aware messages and propagate deployment type
- Pass DEPLOYMENT_TYPE to Docker environment config
- Replace hardcoded "Docker" error messages with runtime label
- Add error field to configure-existing container operation failure
* fix(docker): propagate OAuth secrets to compose and throw on missing compose
- Use config.oauthSessionSecret and config.databaseUrl in compose env
- Throw controlled error in tailLogs when no compose tool detected
* fix(setup): implement deployment types, secure secrets, filter ungated categories
- Exit non-zero from main when setup wizard fails
- Add compose-bundle deployment with bundled postgres service
- Store OAuth secret in .env file (0600) instead of plaintext in compose
- Filter always-on categories from manual tool selection UI
- Add deploymentType field to DockerConfig interface
* fix(docker): require OAuth for postgres, use random password, fix exit code
- docker init now exits non-zero on wizard failure (like init/setup)
- compose-bundle only adds postgres service when oauthEnabled is true
- POSTGRES_PASSWORD uses randomBytes(24) instead of weak fixed default
- Add unit tests for setup subcommand parsing in cli-utils
- Add tests for docker init exit codes in main.entry
* fix(presets): correct tool names for webhooks/integrations, add return guard
- Rename list_webhooks → browse_webhooks in webhooks category
- Rename list_integrations → browse_integrations in integrations category
- Add return after process.exit in docker init to prevent fall-through1 parent d1d5487 commit ae5d009
File tree
28 files changed
+4880
-247
lines changed- src
- cli
- docker
- setup
- flows
- profiles/builtin
- tests/unit
- cli
- docker
- setup
- flows
28 files changed
+4880
-247
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
25 | 29 | | |
26 | 30 | | |
27 | 31 | | |
| |||
45 | 49 | | |
46 | 50 | | |
47 | 51 | | |
| 52 | + | |
48 | 53 | | |
49 | 54 | | |
50 | 55 | | |
| |||
55 | 60 | | |
56 | 61 | | |
57 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
58 | 72 | | |
59 | 73 | | |
60 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
0 commit comments