@simplysf/simply-gitlab 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -15,10 +15,26 @@ The same capabilities are available to AI agents through
15
15
 
16
16
  ## Install
17
17
 
18
- ```bash
19
- npm install -g @simplysf/simply-gitlab
18
+ `@simplysf/simply-gitlab` is a plugin of the `simply` CLI, not a command of its own. Install the host; this
19
+ plugin installs itself the first time you run one of its commands.
20
+
21
+ ```sh
22
+ npm install -g @simplysf/simply-cli
23
+
24
+ simply gitlab --help
25
+ ```
26
+
27
+ To install it ahead of time — in CI, a container image, or offline:
28
+
29
+ ```sh
30
+ simply plugins install @simplysf/simply-gitlab
20
31
  ```
21
32
 
33
+ > **Upgrading from a standalone install?** This package used to own the `simply` command itself,
34
+ > which meant it could not be installed alongside SimplySF's other CLIs. It is now a plugin.
35
+ > Run `npm uninstall -g @simplysf/simply-gitlab` and install `@simplysf/simply-cli` instead.
36
+ > **Your commands do not change** — `simply gitlab …` is exactly what it was.
37
+
22
38
  ## Issues
23
39
 
24
40
  Please report any issues at https://github.com/SimplySF/simply-gitlab/issues
@@ -118,6 +134,9 @@ exitCode, status?, body?}}` — and nothing to stdout. Exit codes are identical
118
134
  - [`simply gitlab commit diff`](#simply-gitlab-commit-diff)
119
135
  - [`simply gitlab commit list`](#simply-gitlab-commit-list)
120
136
  - [`simply gitlab commit view`](#simply-gitlab-commit-view)
137
+ - [`simply gitlab config apply`](#simply-gitlab-config-apply)
138
+ - [`simply gitlab config export`](#simply-gitlab-config-export)
139
+ - [`simply gitlab config plan`](#simply-gitlab-config-plan)
121
140
  - [`simply gitlab file create`](#simply-gitlab-file-create)
122
141
  - [`simply gitlab file update`](#simply-gitlab-file-update)
123
142
  - [`simply gitlab file view`](#simply-gitlab-file-view)
@@ -172,7 +191,7 @@ FLAG DESCRIPTIONS
172
191
  explicit export, and only GitLab connection variables are read from it. A path that cannot be read is an error.
173
192
  ```
174
193
 
175
- _See code: [lib/commands/gitlab/branch/create.js](https://github.com/SimplySF/simply-gitlab/blob/@simplysf/simply-gitlab@0.1.0/packages/simply-gitlab/lib/commands/gitlab/branch/create.js)_
194
+ _See code: [lib/commands/gitlab/branch/create.js](https://github.com/SimplySF/simply-gitlab/blob/@simplysf/simply-gitlab@0.2.0/packages/simply-gitlab/lib/commands/gitlab/branch/create.js)_
176
195
 
177
196
  ## `simply gitlab branch list`
178
197
 
@@ -215,7 +234,7 @@ FLAG DESCRIPTIONS
215
234
  explicit export, and only GitLab connection variables are read from it. A path that cannot be read is an error.
216
235
  ```
217
236
 
218
- _See code: [lib/commands/gitlab/branch/list.js](https://github.com/SimplySF/simply-gitlab/blob/@simplysf/simply-gitlab@0.1.0/packages/simply-gitlab/lib/commands/gitlab/branch/list.js)_
237
+ _See code: [lib/commands/gitlab/branch/list.js](https://github.com/SimplySF/simply-gitlab/blob/@simplysf/simply-gitlab@0.2.0/packages/simply-gitlab/lib/commands/gitlab/branch/list.js)_
219
238
 
220
239
  ## `simply gitlab ci environment list`
221
240
 
@@ -261,7 +280,7 @@ FLAG DESCRIPTIONS
261
280
  explicit export, and only GitLab connection variables are read from it. A path that cannot be read is an error.
262
281
  ```
263
282
 
264
- _See code: [lib/commands/gitlab/ci/environment/list.js](https://github.com/SimplySF/simply-gitlab/blob/@simplysf/simply-gitlab@0.1.0/packages/simply-gitlab/lib/commands/gitlab/ci/environment/list.js)_
283
+ _See code: [lib/commands/gitlab/ci/environment/list.js](https://github.com/SimplySF/simply-gitlab/blob/@simplysf/simply-gitlab@0.2.0/packages/simply-gitlab/lib/commands/gitlab/ci/environment/list.js)_
265
284
 
266
285
  ## `simply gitlab ci job list`
267
286
 
@@ -305,7 +324,7 @@ FLAG DESCRIPTIONS
305
324
  explicit export, and only GitLab connection variables are read from it. A path that cannot be read is an error.
306
325
  ```
307
326
 
308
- _See code: [lib/commands/gitlab/ci/job/list.js](https://github.com/SimplySF/simply-gitlab/blob/@simplysf/simply-gitlab@0.1.0/packages/simply-gitlab/lib/commands/gitlab/ci/job/list.js)_
327
+ _See code: [lib/commands/gitlab/ci/job/list.js](https://github.com/SimplySF/simply-gitlab/blob/@simplysf/simply-gitlab@0.2.0/packages/simply-gitlab/lib/commands/gitlab/ci/job/list.js)_
309
328
 
310
329
  ## `simply gitlab ci job log`
311
330
 
@@ -350,7 +369,7 @@ FLAG DESCRIPTIONS
350
369
  explicit export, and only GitLab connection variables are read from it. A path that cannot be read is an error.
351
370
  ```
352
371
 
353
- _See code: [lib/commands/gitlab/ci/job/log.js](https://github.com/SimplySF/simply-gitlab/blob/@simplysf/simply-gitlab@0.1.0/packages/simply-gitlab/lib/commands/gitlab/ci/job/log.js)_
372
+ _See code: [lib/commands/gitlab/ci/job/log.js](https://github.com/SimplySF/simply-gitlab/blob/@simplysf/simply-gitlab@0.2.0/packages/simply-gitlab/lib/commands/gitlab/ci/job/log.js)_
354
373
 
355
374
  ## `simply gitlab ci variable list`
356
375
 
@@ -401,7 +420,7 @@ FLAG DESCRIPTIONS
401
420
  where this output is going.
402
421
  ```
403
422
 
404
- _See code: [lib/commands/gitlab/ci/variable/list.js](https://github.com/SimplySF/simply-gitlab/blob/@simplysf/simply-gitlab@0.1.0/packages/simply-gitlab/lib/commands/gitlab/ci/variable/list.js)_
423
+ _See code: [lib/commands/gitlab/ci/variable/list.js](https://github.com/SimplySF/simply-gitlab/blob/@simplysf/simply-gitlab@0.2.0/packages/simply-gitlab/lib/commands/gitlab/ci/variable/list.js)_
405
424
 
406
425
  ## `simply gitlab commit create`
407
426
 
@@ -461,7 +480,7 @@ FLAG DESCRIPTIONS
461
480
  explicit export, and only GitLab connection variables are read from it. A path that cannot be read is an error.
462
481
  ```
463
482
 
464
- _See code: [lib/commands/gitlab/commit/create.js](https://github.com/SimplySF/simply-gitlab/blob/@simplysf/simply-gitlab@0.1.0/packages/simply-gitlab/lib/commands/gitlab/commit/create.js)_
483
+ _See code: [lib/commands/gitlab/commit/create.js](https://github.com/SimplySF/simply-gitlab/blob/@simplysf/simply-gitlab@0.2.0/packages/simply-gitlab/lib/commands/gitlab/commit/create.js)_
465
484
 
466
485
  ## `simply gitlab commit diff`
467
486
 
@@ -503,7 +522,7 @@ FLAG DESCRIPTIONS
503
522
  explicit export, and only GitLab connection variables are read from it. A path that cannot be read is an error.
504
523
  ```
505
524
 
506
- _See code: [lib/commands/gitlab/commit/diff.js](https://github.com/SimplySF/simply-gitlab/blob/@simplysf/simply-gitlab@0.1.0/packages/simply-gitlab/lib/commands/gitlab/commit/diff.js)_
525
+ _See code: [lib/commands/gitlab/commit/diff.js](https://github.com/SimplySF/simply-gitlab/blob/@simplysf/simply-gitlab@0.2.0/packages/simply-gitlab/lib/commands/gitlab/commit/diff.js)_
507
526
 
508
527
  ## `simply gitlab commit list`
509
528
 
@@ -554,7 +573,7 @@ FLAG DESCRIPTIONS
554
573
  explicit export, and only GitLab connection variables are read from it. A path that cannot be read is an error.
555
574
  ```
556
575
 
557
- _See code: [lib/commands/gitlab/commit/list.js](https://github.com/SimplySF/simply-gitlab/blob/@simplysf/simply-gitlab@0.1.0/packages/simply-gitlab/lib/commands/gitlab/commit/list.js)_
576
+ _See code: [lib/commands/gitlab/commit/list.js](https://github.com/SimplySF/simply-gitlab/blob/@simplysf/simply-gitlab@0.2.0/packages/simply-gitlab/lib/commands/gitlab/commit/list.js)_
558
577
 
559
578
  ## `simply gitlab commit view`
560
579
 
@@ -595,7 +614,193 @@ FLAG DESCRIPTIONS
595
614
  explicit export, and only GitLab connection variables are read from it. A path that cannot be read is an error.
596
615
  ```
597
616
 
598
- _See code: [lib/commands/gitlab/commit/view.js](https://github.com/SimplySF/simply-gitlab/blob/@simplysf/simply-gitlab@0.1.0/packages/simply-gitlab/lib/commands/gitlab/commit/view.js)_
617
+ _See code: [lib/commands/gitlab/commit/view.js](https://github.com/SimplySF/simply-gitlab/blob/@simplysf/simply-gitlab@0.2.0/packages/simply-gitlab/lib/commands/gitlab/commit/view.js)_
618
+
619
+ ## `simply gitlab config apply`
620
+
621
+ Bring projects onto a baseline config.
622
+
623
+ ```
624
+ USAGE
625
+ $ simply gitlab config apply -c <value> [--json] [-e <value>] [--gitlab-url <value>] [--gitlab-token <value>] [--target
626
+ <value>...] [--concurrency <value>] [--fail-fast] [--dry-run]
627
+
628
+ FLAGS
629
+ -c, --config=<value> (required) Path to the baseline configuration file.
630
+ --concurrency=<value> [default: 4] How many targets to work on at once.
631
+ --dry-run Print the request that would be sent and exit without sending it.
632
+ --fail-fast Stop at the first target that fails instead of continuing.
633
+ --target=<value>... Limit the run to this project path. Repeatable.
634
+
635
+ CONNECTION FLAGS
636
+ -e, --env-file=<value> Path to a .env file holding connection settings.
637
+ --gitlab-token=<value> [env: GITLAB_TOKEN] Personal, project, or group access token.
638
+ --gitlab-url=<value> [env: GITLAB_URL] Base URL of the GitLab instance. Defaults to https://gitlab.com.
639
+
640
+ GLOBAL FLAGS
641
+ --json Format output as json.
642
+
643
+ DESCRIPTION
644
+ Bring projects onto a baseline config.
645
+
646
+ Computes the same plan as config plan, then executes it. Only what the plan showed is sent, so a preview is a
647
+ guarantee rather than an approximation, and a second run against a converged project sends no requests at all.
648
+
649
+ Sections are applied in a fixed order — settings, protected branches, protected tags, approval settings, approval
650
+ rules, push rules — because an approval rule scoped to a branch needs that branch protected before it can reference
651
+ it.
652
+
653
+ By default the config only adds and corrects what it declares. A section that sets "prune": true also deletes entries
654
+ the config does not mention.
655
+
656
+ One target failing does not abandon the rest; the summary says which ones failed and where they stopped. There is no
657
+ transaction across GitLab endpoints, so a target that failed part-way keeps the sections already applied — run config
658
+ plan afterwards to see what is left.
659
+
660
+ EXAMPLES
661
+ $ simply gitlab config apply --config ./baseline.json --dry-run
662
+
663
+ $ simply gitlab config apply --config ./baseline.json
664
+
665
+ $ simply gitlab config apply --config ./baseline.json --target group/project
666
+
667
+ FLAG DESCRIPTIONS
668
+ -e, --env-file=<value> Path to a .env file holding connection settings.
669
+
670
+ Loaded before anything else. Variables already present in the environment win, so the file never overrides an
671
+ explicit export, and only GitLab connection variables are read from it. A path that cannot be read is an error.
672
+
673
+ --concurrency=<value> How many targets to work on at once.
674
+
675
+ Small by default. The client already retries a rate-limited request with a capped Retry-After, so raising this
676
+ trades a shared instance responsiveness for very little wall-clock time.
677
+
678
+ --target=<value>... Limit the run to this project path. Repeatable.
679
+
680
+ Narrows a run without editing the config, for the loop of fixing one project and checking it again. Naming a project
681
+ the config does not target is an error rather than a silent no-op.
682
+ ```
683
+
684
+ _See code: [lib/commands/gitlab/config/apply.js](https://github.com/SimplySF/simply-gitlab/blob/@simplysf/simply-gitlab@0.2.0/packages/simply-gitlab/lib/commands/gitlab/config/apply.js)_
685
+
686
+ ## `simply gitlab config export`
687
+
688
+ Write a baseline config describing an existing project.
689
+
690
+ ```
691
+ USAGE
692
+ $ simply gitlab config export -p <value> [--json] [-e <value>] [--gitlab-url <value>] [--gitlab-token <value>]
693
+ [--section settings|protectedBranches|protectedTags|approvals|approvalRules|pushRules|variables...]
694
+
695
+ FLAGS
696
+ -p, --project=<value> (required) [env: GITLAB_PROJECT] Project id, or its full path such as
697
+ group/subgroup/project.
698
+ --section=<option>... Comma-separated sections to export. Defaults to all of them.
699
+ <options:
700
+ settings|protectedBranches|protectedTags|approvals|approvalRules|pushRules|variables>
701
+
702
+ CONNECTION FLAGS
703
+ -e, --env-file=<value> Path to a .env file holding connection settings.
704
+ --gitlab-token=<value> [env: GITLAB_TOKEN] Personal, project, or group access token.
705
+ --gitlab-url=<value> [env: GITLAB_URL] Base URL of the GitLab instance. Defaults to https://gitlab.com.
706
+
707
+ GLOBAL FLAGS
708
+ --json Format output as json.
709
+
710
+ DESCRIPTION
711
+ Write a baseline config describing an existing project.
712
+
713
+ Reads one project and prints a configuration file that describes it, ready to be edited and pointed at the rest of
714
+ your projects. Writing a baseline by hand against forty attributes is miserable and the first draft is wrong;
715
+ exporting the project that already looks right and deleting what you do not care about is the way to start.
716
+
717
+ The output is deliberately verbose — every supported key, not a curated subset — because deleting a line is easier
718
+ than discovering that a key exists. Variables are exported as metadata only: keys, scopes, and flags, never values.
719
+
720
+ The exported targets name only the project it came from. Widen that on purpose rather than inheriting a blast radius
721
+ from an export.
722
+
723
+ EXAMPLES
724
+ $ simply gitlab config export --project group/project > baseline.json
725
+
726
+ $ simply gitlab config export --project group/project --section settings,protectedBranches
727
+
728
+ FLAG DESCRIPTIONS
729
+ -e, --env-file=<value> Path to a .env file holding connection settings.
730
+
731
+ Loaded before anything else. Variables already present in the environment win, so the file never overrides an
732
+ explicit export, and only GitLab connection variables are read from it. A path that cannot be read is an error.
733
+ ```
734
+
735
+ _See code: [lib/commands/gitlab/config/export.js](https://github.com/SimplySF/simply-gitlab/blob/@simplysf/simply-gitlab@0.2.0/packages/simply-gitlab/lib/commands/gitlab/config/export.js)_
736
+
737
+ ## `simply gitlab config plan`
738
+
739
+ Report how projects differ from a baseline config.
740
+
741
+ ```
742
+ USAGE
743
+ $ simply gitlab config plan -c <value> [--json] [-e <value>] [--gitlab-url <value>] [--gitlab-token <value>] [--target
744
+ <value>...] [--concurrency <value>] [--fail-fast] [--fail-on-drift]
745
+
746
+ FLAGS
747
+ -c, --config=<value> (required) Path to the baseline configuration file.
748
+ --concurrency=<value> [default: 4] How many targets to work on at once.
749
+ --fail-fast Stop at the first target that fails instead of continuing.
750
+ --fail-on-drift Exit 1 when any target differs from the baseline.
751
+ --target=<value>... Limit the run to this project path. Repeatable.
752
+
753
+ CONNECTION FLAGS
754
+ -e, --env-file=<value> Path to a .env file holding connection settings.
755
+ --gitlab-token=<value> [env: GITLAB_TOKEN] Personal, project, or group access token.
756
+ --gitlab-url=<value> [env: GITLAB_URL] Base URL of the GitLab instance. Defaults to https://gitlab.com.
757
+
758
+ GLOBAL FLAGS
759
+ --json Format output as json.
760
+
761
+ DESCRIPTION
762
+ Report how projects differ from a baseline config.
763
+
764
+ Reads the baseline, expands its targets, and prints what differs on each one. Nothing is sent that changes anything,
765
+ so this is safe to run against every project you have.
766
+
767
+ Only the attributes the config declares are compared. A project with forty settings the config never mentions shows
768
+ nothing for them — that is what makes a baseline safe to point at projects that already exist.
769
+
770
+ Entries that exist on the instance but are not in the config are shown as removals, marked as not pruned unless that
771
+ section opts into pruning. Seeing what you are choosing not to fix is most of the value of running this across fifty
772
+ projects.
773
+
774
+ Use --fail-on-drift in a scheduled job: it exits 1 when anything differs, so CI can tell you that something drifted
775
+ without anyone having to read the output.
776
+
777
+ EXAMPLES
778
+ $ simply gitlab config plan --config ./baseline.json
779
+
780
+ $ simply gitlab config plan --config ./baseline.json --target group/project
781
+
782
+ $ simply gitlab config plan --config ./baseline.json --fail-on-drift
783
+
784
+ $ simply gitlab config plan --config ./baseline.json --json | jq .summary
785
+
786
+ FLAG DESCRIPTIONS
787
+ -e, --env-file=<value> Path to a .env file holding connection settings.
788
+
789
+ Loaded before anything else. Variables already present in the environment win, so the file never overrides an
790
+ explicit export, and only GitLab connection variables are read from it. A path that cannot be read is an error.
791
+
792
+ --concurrency=<value> How many targets to work on at once.
793
+
794
+ Small by default. The client already retries a rate-limited request with a capped Retry-After, so raising this
795
+ trades a shared instance responsiveness for very little wall-clock time.
796
+
797
+ --target=<value>... Limit the run to this project path. Repeatable.
798
+
799
+ Narrows a run without editing the config, for the loop of fixing one project and checking it again. Naming a project
800
+ the config does not target is an error rather than a silent no-op.
801
+ ```
802
+
803
+ _See code: [lib/commands/gitlab/config/plan.js](https://github.com/SimplySF/simply-gitlab/blob/@simplysf/simply-gitlab@0.2.0/packages/simply-gitlab/lib/commands/gitlab/config/plan.js)_
599
804
 
600
805
  ## `simply gitlab file create`
601
806
 
@@ -647,7 +852,7 @@ FLAG DESCRIPTIONS
647
852
  explicit export, and only GitLab connection variables are read from it. A path that cannot be read is an error.
648
853
  ```
649
854
 
650
- _See code: [lib/commands/gitlab/file/create.js](https://github.com/SimplySF/simply-gitlab/blob/@simplysf/simply-gitlab@0.1.0/packages/simply-gitlab/lib/commands/gitlab/file/create.js)_
855
+ _See code: [lib/commands/gitlab/file/create.js](https://github.com/SimplySF/simply-gitlab/blob/@simplysf/simply-gitlab@0.2.0/packages/simply-gitlab/lib/commands/gitlab/file/create.js)_
651
856
 
652
857
  ## `simply gitlab file update`
653
858
 
@@ -700,7 +905,7 @@ FLAG DESCRIPTIONS
700
905
  explicit export, and only GitLab connection variables are read from it. A path that cannot be read is an error.
701
906
  ```
702
907
 
703
- _See code: [lib/commands/gitlab/file/update.js](https://github.com/SimplySF/simply-gitlab/blob/@simplysf/simply-gitlab@0.1.0/packages/simply-gitlab/lib/commands/gitlab/file/update.js)_
908
+ _See code: [lib/commands/gitlab/file/update.js](https://github.com/SimplySF/simply-gitlab/blob/@simplysf/simply-gitlab@0.2.0/packages/simply-gitlab/lib/commands/gitlab/file/update.js)_
704
909
 
705
910
  ## `simply gitlab file view`
706
911
 
@@ -746,7 +951,7 @@ FLAG DESCRIPTIONS
746
951
  explicit export, and only GitLab connection variables are read from it. A path that cannot be read is an error.
747
952
  ```
748
953
 
749
- _See code: [lib/commands/gitlab/file/view.js](https://github.com/SimplySF/simply-gitlab/blob/@simplysf/simply-gitlab@0.1.0/packages/simply-gitlab/lib/commands/gitlab/file/view.js)_
954
+ _See code: [lib/commands/gitlab/file/view.js](https://github.com/SimplySF/simply-gitlab/blob/@simplysf/simply-gitlab@0.2.0/packages/simply-gitlab/lib/commands/gitlab/file/view.js)_
750
955
 
751
956
  ## `simply gitlab mr create`
752
957
 
@@ -807,7 +1012,7 @@ FLAG DESCRIPTIONS
807
1012
  explicit export, and only GitLab connection variables are read from it. A path that cannot be read is an error.
808
1013
  ```
809
1014
 
810
- _See code: [lib/commands/gitlab/mr/create.js](https://github.com/SimplySF/simply-gitlab/blob/@simplysf/simply-gitlab@0.1.0/packages/simply-gitlab/lib/commands/gitlab/mr/create.js)_
1015
+ _See code: [lib/commands/gitlab/mr/create.js](https://github.com/SimplySF/simply-gitlab/blob/@simplysf/simply-gitlab@0.2.0/packages/simply-gitlab/lib/commands/gitlab/mr/create.js)_
811
1016
 
812
1017
  ## `simply gitlab mr list`
813
1018
 
@@ -861,7 +1066,7 @@ FLAG DESCRIPTIONS
861
1066
  explicit export, and only GitLab connection variables are read from it. A path that cannot be read is an error.
862
1067
  ```
863
1068
 
864
- _See code: [lib/commands/gitlab/mr/list.js](https://github.com/SimplySF/simply-gitlab/blob/@simplysf/simply-gitlab@0.1.0/packages/simply-gitlab/lib/commands/gitlab/mr/list.js)_
1069
+ _See code: [lib/commands/gitlab/mr/list.js](https://github.com/SimplySF/simply-gitlab/blob/@simplysf/simply-gitlab@0.2.0/packages/simply-gitlab/lib/commands/gitlab/mr/list.js)_
865
1070
 
866
1071
  ## `simply gitlab mr update`
867
1072
 
@@ -925,7 +1130,7 @@ FLAG DESCRIPTIONS
925
1130
  explicit export, and only GitLab connection variables are read from it. A path that cannot be read is an error.
926
1131
  ```
927
1132
 
928
- _See code: [lib/commands/gitlab/mr/update.js](https://github.com/SimplySF/simply-gitlab/blob/@simplysf/simply-gitlab@0.1.0/packages/simply-gitlab/lib/commands/gitlab/mr/update.js)_
1133
+ _See code: [lib/commands/gitlab/mr/update.js](https://github.com/SimplySF/simply-gitlab/blob/@simplysf/simply-gitlab@0.2.0/packages/simply-gitlab/lib/commands/gitlab/mr/update.js)_
929
1134
 
930
1135
  ## `simply gitlab mr view`
931
1136
 
@@ -966,7 +1171,7 @@ FLAG DESCRIPTIONS
966
1171
  explicit export, and only GitLab connection variables are read from it. A path that cannot be read is an error.
967
1172
  ```
968
1173
 
969
- _See code: [lib/commands/gitlab/mr/view.js](https://github.com/SimplySF/simply-gitlab/blob/@simplysf/simply-gitlab@0.1.0/packages/simply-gitlab/lib/commands/gitlab/mr/view.js)_
1174
+ _See code: [lib/commands/gitlab/mr/view.js](https://github.com/SimplySF/simply-gitlab/blob/@simplysf/simply-gitlab@0.2.0/packages/simply-gitlab/lib/commands/gitlab/mr/view.js)_
970
1175
 
971
1176
  ## `simply gitlab project list`
972
1177
 
@@ -1013,7 +1218,7 @@ FLAG DESCRIPTIONS
1013
1218
  explicit export, and only GitLab connection variables are read from it. A path that cannot be read is an error.
1014
1219
  ```
1015
1220
 
1016
- _See code: [lib/commands/gitlab/project/list.js](https://github.com/SimplySF/simply-gitlab/blob/@simplysf/simply-gitlab@0.1.0/packages/simply-gitlab/lib/commands/gitlab/project/list.js)_
1221
+ _See code: [lib/commands/gitlab/project/list.js](https://github.com/SimplySF/simply-gitlab/blob/@simplysf/simply-gitlab@0.2.0/packages/simply-gitlab/lib/commands/gitlab/project/list.js)_
1017
1222
 
1018
1223
  ## `simply gitlab project view`
1019
1224
 
@@ -1052,7 +1257,7 @@ FLAG DESCRIPTIONS
1052
1257
  explicit export, and only GitLab connection variables are read from it. A path that cannot be read is an error.
1053
1258
  ```
1054
1259
 
1055
- _See code: [lib/commands/gitlab/project/view.js](https://github.com/SimplySF/simply-gitlab/blob/@simplysf/simply-gitlab@0.1.0/packages/simply-gitlab/lib/commands/gitlab/project/view.js)_
1260
+ _See code: [lib/commands/gitlab/project/view.js](https://github.com/SimplySF/simply-gitlab/blob/@simplysf/simply-gitlab@0.2.0/packages/simply-gitlab/lib/commands/gitlab/project/view.js)_
1056
1261
 
1057
1262
  ## `simply gitlab release list`
1058
1263
 
@@ -1093,7 +1298,7 @@ FLAG DESCRIPTIONS
1093
1298
  explicit export, and only GitLab connection variables are read from it. A path that cannot be read is an error.
1094
1299
  ```
1095
1300
 
1096
- _See code: [lib/commands/gitlab/release/list.js](https://github.com/SimplySF/simply-gitlab/blob/@simplysf/simply-gitlab@0.1.0/packages/simply-gitlab/lib/commands/gitlab/release/list.js)_
1301
+ _See code: [lib/commands/gitlab/release/list.js](https://github.com/SimplySF/simply-gitlab/blob/@simplysf/simply-gitlab@0.2.0/packages/simply-gitlab/lib/commands/gitlab/release/list.js)_
1097
1302
 
1098
1303
  ## `simply gitlab search`
1099
1304
 
@@ -1148,7 +1353,7 @@ FLAG DESCRIPTIONS
1148
1353
  explicit export, and only GitLab connection variables are read from it. A path that cannot be read is an error.
1149
1354
  ```
1150
1355
 
1151
- _See code: [lib/commands/gitlab/search.js](https://github.com/SimplySF/simply-gitlab/blob/@simplysf/simply-gitlab@0.1.0/packages/simply-gitlab/lib/commands/gitlab/search.js)_
1356
+ _See code: [lib/commands/gitlab/search.js](https://github.com/SimplySF/simply-gitlab/blob/@simplysf/simply-gitlab@0.2.0/packages/simply-gitlab/lib/commands/gitlab/search.js)_
1152
1357
 
1153
1358
  ## `simply gitlab tag list`
1154
1359
 
@@ -1195,7 +1400,7 @@ FLAG DESCRIPTIONS
1195
1400
  explicit export, and only GitLab connection variables are read from it. A path that cannot be read is an error.
1196
1401
  ```
1197
1402
 
1198
- _See code: [lib/commands/gitlab/tag/list.js](https://github.com/SimplySF/simply-gitlab/blob/@simplysf/simply-gitlab@0.1.0/packages/simply-gitlab/lib/commands/gitlab/tag/list.js)_
1403
+ _See code: [lib/commands/gitlab/tag/list.js](https://github.com/SimplySF/simply-gitlab/blob/@simplysf/simply-gitlab@0.2.0/packages/simply-gitlab/lib/commands/gitlab/tag/list.js)_
1199
1404
  <!-- commandsstop -->
1200
1405
 
1201
1406
  ## License
@@ -0,0 +1,15 @@
1
+ import { GitLabCommand } from '../../../shared/base-command.js';
2
+ export default class GitlabConfigApply extends GitLabCommand<typeof GitlabConfigApply> {
3
+ static isWrite: boolean;
4
+ static readonly summary = "Bring projects onto a baseline config.";
5
+ static readonly description: string;
6
+ static readonly examples: string[];
7
+ static readonly flags: {
8
+ 'dry-run': import("@oclif/core/interfaces").BooleanFlag<boolean>;
9
+ config: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
10
+ target: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ concurrency: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
12
+ 'fail-fast': import("@oclif/core/interfaces").BooleanFlag<boolean>;
13
+ };
14
+ run(): Promise<unknown>;
15
+ }
@@ -0,0 +1,78 @@
1
+ /*
2
+ * Copyright (c) 2026, SimplySF.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { applyFailures, applyPlan, CliError, hasChanges, loadBaselineConfig, planRun, planToJson, renderApply, renderPlan, } from '@simplysf/simply-gitlab-core';
17
+ import { GitLabCommand, writeFlags } from '../../../shared/base-command.js';
18
+ import { baselineFlags } from '../../../shared/baseline-flags.js';
19
+ export default class GitlabConfigApply extends GitLabCommand {
20
+ static isWrite = true;
21
+ static summary = 'Bring projects onto a baseline config.';
22
+ static description = 'Computes the same plan as config plan, then executes it. Only what the plan showed is sent, ' +
23
+ 'so a preview is a guarantee rather than an approximation, and a second run against a ' +
24
+ 'converged project sends no requests at all.\n\n' +
25
+ 'Sections are applied in a fixed order — settings, protected branches, protected tags, ' +
26
+ 'approval settings, approval rules, push rules — because an approval rule scoped to a branch ' +
27
+ 'needs that branch protected before it can reference it.\n\n' +
28
+ 'By default the config only adds and corrects what it declares. A section that sets ' +
29
+ '"prune": true also deletes entries the config does not mention.\n\n' +
30
+ 'One target failing does not abandon the rest; the summary says which ones failed and where ' +
31
+ 'they stopped. There is no transaction across GitLab endpoints, so a target that failed ' +
32
+ 'part-way keeps the sections already applied — run config plan afterwards to see what is left.';
33
+ static examples = [
34
+ '<%= config.bin %> <%= command.id %> --config ./baseline.json --dry-run',
35
+ '<%= config.bin %> <%= command.id %> --config ./baseline.json',
36
+ '<%= config.bin %> <%= command.id %> --config ./baseline.json --target group/project',
37
+ ];
38
+ static flags = {
39
+ ...baselineFlags,
40
+ ...writeFlags,
41
+ };
42
+ async run() {
43
+ const config = loadBaselineConfig(this.flags.config);
44
+ const options = {
45
+ concurrency: this.flags.concurrency,
46
+ failFast: this.flags['fail-fast'],
47
+ only: this.flags.target,
48
+ };
49
+ const { targets, plan } = await planRun(this.gitlab(), config, options);
50
+ if (!this.jsonEnabled()) {
51
+ this.log(`Targets: ${targets.projects.length} project(s), ${targets.groups.length} group(s).`);
52
+ if (targets.excluded.length > 0)
53
+ this.logSafe(`Excluded: ${targets.excluded.join(', ')}`);
54
+ this.log('');
55
+ this.logSafe(renderPlan(plan));
56
+ this.log('');
57
+ }
58
+ if (this.flags['dry-run']) {
59
+ if (!this.jsonEnabled())
60
+ this.log('Dry run — nothing sent.');
61
+ return planToJson(plan);
62
+ }
63
+ if (!hasChanges(plan)) {
64
+ if (!this.jsonEnabled())
65
+ this.log('Nothing to apply.');
66
+ return { ...planToJson(plan), applied: [] };
67
+ }
68
+ const result = await applyPlan(this.gitlab(), plan, options);
69
+ if (!this.jsonEnabled())
70
+ this.logSafe(renderApply(result));
71
+ const failed = applyFailures(result);
72
+ if (failed.length > 0) {
73
+ throw new CliError(`${failed.length} of ${result.targets.length} target(s) failed. See the output above.`);
74
+ }
75
+ return { ...planToJson(plan), applied: result.targets };
76
+ }
77
+ }
78
+ //# sourceMappingURL=apply.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apply.js","sourceRoot":"","sources":["../../../../src/commands/gitlab/config/apply.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,aAAa,EACb,SAAS,EACT,QAAQ,EACR,UAAU,EACV,kBAAkB,EAClB,OAAO,EACP,UAAU,EACV,WAAW,EACX,UAAU,GACX,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAElE,MAAM,CAAC,O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from '../../../shared/base-command.js';
2
+ export default class GitlabConfigExport extends GitLabCommand<typeof GitlabConfigExport> {
3
+ static readonly summary = "Write a baseline config describing an existing project.";
4
+ static readonly description: string;
5
+ static readonly examples: string[];
6
+ static readonly flags: {
7
+ section: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
+ project: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
9
+ };
10
+ run(): Promise<unknown>;
11
+ }
@@ -0,0 +1,56 @@
1
+ /*
2
+ * Copyright (c) 2026, SimplySF.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { Flags } from '@oclif/core';
17
+ import { EXPORTABLE_SECTIONS, exportConfig } from '@simplysf/simply-gitlab-core';
18
+ import { GitLabCommand, projectFlag } from '../../../shared/base-command.js';
19
+ export default class GitlabConfigExport extends GitLabCommand {
20
+ static summary = 'Write a baseline config describing an existing project.';
21
+ static description = 'Reads one project and prints a configuration file that describes it, ready to be edited and ' +
22
+ 'pointed at the rest of your projects. Writing a baseline by hand against forty attributes is ' +
23
+ 'miserable and the first draft is wrong; exporting the project that already looks right and ' +
24
+ 'deleting what you do not care about is the way to start.\n\n' +
25
+ 'The output is deliberately verbose — every supported key, not a curated subset — because ' +
26
+ 'deleting a line is easier than discovering that a key exists. Variables are exported as ' +
27
+ 'metadata only: keys, scopes, and flags, never values.\n\n' +
28
+ 'The exported targets name only the project it came from. Widen that on purpose rather than ' +
29
+ 'inheriting a blast radius from an export.';
30
+ static examples = [
31
+ '<%= config.bin %> <%= command.id %> --project group/project > baseline.json',
32
+ '<%= config.bin %> <%= command.id %> --project group/project --section settings,protectedBranches',
33
+ ];
34
+ static flags = {
35
+ ...projectFlag,
36
+ section: Flags.string({
37
+ summary: 'Comma-separated sections to export. Defaults to all of them.',
38
+ options: [...EXPORTABLE_SECTIONS],
39
+ multiple: true,
40
+ delimiter: ',',
41
+ multipleNonGreedy: true,
42
+ }),
43
+ };
44
+ async run() {
45
+ const sections = this.flags.section;
46
+ const config = await exportConfig(this.gitlab(), this.flags.project, {
47
+ sections: sections === undefined || sections.length === 0 ? undefined : sections,
48
+ });
49
+ // Straight to stdout, formatted, because the point of this command is to be redirected to a
50
+ // file. Under --json oclif prints the same object itself.
51
+ if (!this.jsonEnabled())
52
+ this.logSafe(JSON.stringify(config, null, 2));
53
+ return config;
54
+ }
55
+ }
56
+ //# sourceMappingURL=export.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"export.js","sourceRoot":"","sources":["../../../../src/commands/gitlab/config/export.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAA0B,MAAM,8BAA8B,CAAC;AACzG,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAE7E,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,aAAwC;IAC/E,MAAM,CAAmB,OAAO,GAAG,yDAAyD,CAAC;IAC7F,MAAM,CAAmB,WAAW,GACzC,8FAA8F;QAC9F,+FAA+F;QAC/F,6FAA6F;QAC7F,8DAA8D;QAC9D,2FAA2F;QAC3F,0FAA0F;QAC1F,2DAA2D;QAC3D,6FAA6F;QAC7F,2CAA2C,CAAC;IAEvC,MAAM,CAAmB,QAAQ,GAAG;QACzC,6EAA6E;QAC7E,kGAAkG;KACnG,CAAC;IAEK,MAAM,CAAmB,KAAK,GAAG;QACtC,GAAG,WAAW;QACd,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC;YACpB,OAAO,EAAE,8DAA8D;YACvE,OAAO,EAAE,CAAC,GAAG,mBAAmB,CAAC;YACjC,QAAQ,EAAE,IAAI;YACd,SAAS,EAAE,GAAG;YACd,iBAAiB,EAAE,IAAI;SACxB,CAAC;KACH,CAAC;IAEK,KAAK,CAAC,GAAG;QACd,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,OAA0C,CAAC;QACvE,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE;YACnE,QAAQ,EAAE,QAAQ,KAAK,SAAS,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ;SACjF,CAAC,CAAC;QAEH,4FAA4F;QAC5F,0DAA0D;QAC1D,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;YAAE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QACvE,OAAO,MAAM,CAAC;IAChB,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { GitLabCommand } from '../../../shared/base-command.js';
2
+ export default class GitlabConfigPlan extends GitLabCommand<typeof GitlabConfigPlan> {
3
+ static readonly summary = "Report how projects differ from a baseline config.";
4
+ static readonly description: string;
5
+ static readonly examples: string[];
6
+ static readonly flags: {
7
+ 'fail-on-drift': import("@oclif/core/interfaces").BooleanFlag<boolean>;
8
+ config: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
9
+ target: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
+ concurrency: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
11
+ 'fail-fast': import("@oclif/core/interfaces").BooleanFlag<boolean>;
12
+ };
13
+ run(): Promise<unknown>;
14
+ }