-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev-setup.py
More file actions
1116 lines (999 loc) · 49.3 KB
/
dev-setup.py
File metadata and controls
1116 lines (999 loc) · 49.3 KB
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/env python3
"""
Developer Environment Setup Automation Tool
Supports Windows, macOS, and Linux
Organized by categories for easy selection
"""
import os
import sys
import platform
import subprocess
import json
from pathlib import Path
class DevSetup:
def __init__(self):
self.os_type = platform.system().lower()
self.config_file = Path.home() / '.dev-setup-config.json'
self.selected_tools = []
# Define categories
self.categories = {
'editors': {
'name': '💻 Code Editors / IDEs',
'description': 'Development environments and text editors',
'icon': '💻'
},
'version_control': {
'name': '📁 Version Control',
'description': 'Git and repository management tools',
'icon': '📁'
},
'browsers': {
'name': '🌐 Browsers',
'description': 'Web browsers for testing and daily work',
'icon': '🌐'
},
'languages': {
'name': '📦 Languages & Runtimes',
'description': 'Programming languages, package managers, and build tools',
'icon': '📦'
},
'databases': {
'name': '🗄️ Databases',
'description': 'Database servers for local development',
'icon': '🗄️'
},
'devops': {
'name': '🐳 DevOps / Containers',
'description': 'Docker, Kubernetes, and infrastructure tools',
'icon': '🐳'
},
'testing': {
'name': '🧪 Testing & API Tools',
'description': 'API testing and automation tools',
'icon': '🧪'
},
'collaboration': {
'name': '🤝 Team & Productivity',
'description': 'Communication and project management',
'icon': '🤝'
},
'power_tools': {
'name': '⭐ Power-User Extras',
'description': 'Optional but awesome productivity tools',
'icon': '⭐'
}
}
# Define available tools organized by category
self.tools = {
# ==================== CODE EDITORS / IDEs ====================
'vscode': {
'name': 'Visual Studio Code',
'description': 'Popular code editor by Microsoft',
'category': 'editors',
'windows': {'type': 'winget', 'id': 'Microsoft.VisualStudioCode', 'env_paths': [r'C:\Users\{username}\AppData\Local\Programs\Microsoft VS Code\bin']},
'darwin': {'type': 'brew', 'package': 'visual-studio-code', 'cask': True},
'linux': {'type': 'snap', 'package': 'code', 'classic': True}
},
'intellij': {
'name': 'IntelliJ IDEA Community',
'description': 'Java IDE by JetBrains',
'category': 'editors',
'windows': {'type': 'winget', 'id': 'JetBrains.IntelliJIDEA.Community'},
'darwin': {'type': 'brew', 'package': 'intellij-idea-ce', 'cask': True},
'linux': {'type': 'snap', 'package': 'intellij-idea-community', 'classic': True}
},
'pycharm': {
'name': 'PyCharm Community',
'description': 'Python IDE by JetBrains',
'category': 'editors',
'windows': {'type': 'winget', 'id': 'JetBrains.PyCharm.Community'},
'darwin': {'type': 'brew', 'package': 'pycharm-ce', 'cask': True},
'linux': {'type': 'snap', 'package': 'pycharm-community', 'classic': True}
},
'webstorm': {
'name': 'WebStorm',
'description': 'JavaScript IDE by JetBrains',
'category': 'editors',
'windows': {'type': 'winget', 'id': 'JetBrains.WebStorm'},
'darwin': {'type': 'brew', 'package': 'webstorm', 'cask': True},
'linux': {'type': 'snap', 'package': 'webstorm', 'classic': True}
},
'sublime': {
'name': 'Sublime Text',
'description': 'Fast and lightweight text editor',
'category': 'editors',
'windows': {'type': 'winget', 'id': 'SublimeHQ.SublimeText.4'},
'darwin': {'type': 'brew', 'package': 'sublime-text', 'cask': True},
'linux': {'type': 'snap', 'package': 'sublime-text', 'classic': True}
},
'jetbrains-toolbox': {
'name': 'JetBrains Toolbox',
'description': 'Manage all JetBrains IDEs',
'category': 'editors',
'windows': {'type': 'winget', 'id': 'JetBrains.Toolbox'},
'darwin': {'type': 'brew', 'package': 'jetbrains-toolbox', 'cask': True},
'linux': {'type': 'script', 'commands': [
'wget -O jetbrains-toolbox.tar.gz "https://data.services.jetbrains.com/products/download?platform=linux&code=TBA"',
'tar -xzf jetbrains-toolbox.tar.gz',
'./jetbrains-toolbox-*/jetbrains-toolbox'
]}
},
# ==================== VERSION CONTROL ====================
'git': {
'name': 'Git',
'description': 'Version control system (essential)',
'category': 'version_control',
'windows': {'type': 'winget', 'id': 'Git.Git', 'env_paths': [r'C:\Program Files\Git\cmd']},
'darwin': {'type': 'brew', 'package': 'git'},
'linux': {'type': 'apt', 'package': 'git'}
},
'github-desktop': {
'name': 'GitHub Desktop',
'description': 'GUI for GitHub repositories',
'category': 'version_control',
'windows': {'type': 'winget', 'id': 'GitHub.GitHubDesktop'},
'darwin': {'type': 'brew', 'package': 'github', 'cask': True},
'linux': {'type': 'script', 'commands': [
'wget -qO - https://apt.packages.shiftkey.dev/gpg.key | gpg --dearmor | sudo tee /usr/share/keyrings/shiftkey-packages.gpg > /dev/null',
'sudo sh -c \'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/shiftkey-packages.gpg] https://apt.packages.shiftkey.dev/ubuntu/ any main" > /etc/apt/sources.list.d/shiftkey-packages.list\'',
'sudo apt update && sudo apt install github-desktop -y'
]}
},
# ==================== BROWSERS ====================
'chrome': {
'name': 'Google Chrome',
'description': 'Popular web browser',
'category': 'browsers',
'windows': {'type': 'winget', 'id': 'Google.Chrome'},
'darwin': {'type': 'brew', 'package': 'google-chrome', 'cask': True},
'linux': {'type': 'script', 'commands': [
'wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb',
'sudo dpkg -i google-chrome-stable_current_amd64.deb',
'sudo apt-get install -f -y'
]}
},
'firefox': {
'name': 'Mozilla Firefox',
'description': 'Privacy-focused browser',
'category': 'browsers',
'windows': {'type': 'winget', 'id': 'Mozilla.Firefox'},
'darwin': {'type': 'brew', 'package': 'firefox', 'cask': True},
'linux': {'type': 'apt', 'package': 'firefox'}
},
'edge': {
'name': 'Microsoft Edge',
'description': 'Chromium-based browser',
'category': 'browsers',
'windows': {'type': 'winget', 'id': 'Microsoft.Edge'},
'darwin': {'type': 'brew', 'package': 'microsoft-edge', 'cask': True},
'linux': {'type': 'script', 'commands': [
'curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg',
'sudo install -o root -g root -m 644 microsoft.gpg /etc/apt/trusted.gpg.d/',
'sudo sh -c \'echo "deb [arch=amd64] https://packages.microsoft.com/repos/edge stable main" > /etc/apt/sources.list.d/microsoft-edge.list\'',
'sudo apt update && sudo apt install microsoft-edge-stable -y'
]}
},
'brave': {
'name': 'Brave Browser',
'description': 'Privacy-focused Chromium browser',
'category': 'browsers',
'windows': {'type': 'winget', 'id': 'Brave.Brave'},
'darwin': {'type': 'brew', 'package': 'brave-browser', 'cask': True},
'linux': {'type': 'script', 'commands': [
'sudo curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg',
'echo "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg] https://brave-browser-apt-release.s3.brave.com/ stable main"|sudo tee /etc/apt/sources.list.d/brave-browser-release.list',
'sudo apt update && sudo apt install brave-browser -y'
]}
},
# ==================== LANGUAGES & RUNTIMES ====================
'node': {
'name': 'Node.js (LTS)',
'description': 'JavaScript runtime (includes npm)',
'category': 'languages',
'windows': {'type': 'winget', 'id': 'OpenJS.NodeJS.LTS', 'env_paths': [r'C:\Program Files\nodejs']},
'darwin': {'type': 'brew', 'package': 'node'},
'linux': {'type': 'script', 'commands': [
'curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -',
'sudo apt-get install -y nodejs'
]}
},
'yarn': {
'name': 'Yarn',
'description': 'Fast, reliable package manager',
'category': 'languages',
'windows': {'type': 'winget', 'id': 'Yarn.Yarn'},
'darwin': {'type': 'brew', 'package': 'yarn'},
'linux': {'type': 'script', 'commands': [
'curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -',
'echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list',
'sudo apt update && sudo apt install yarn -y'
]}
},
'python': {
'name': 'Python 3.12',
'description': 'Python programming language (includes pip)',
'category': 'languages',
'windows': {'type': 'winget', 'id': 'Python.Python.3.12', 'env_paths': [
r'C:\Users\{username}\AppData\Local\Programs\Python\Python312',
r'C:\Users\{username}\AppData\Local\Programs\Python\Python312\Scripts'
]},
'darwin': {'type': 'brew', 'package': 'python@3.12'},
'linux': {'type': 'apt', 'package': 'python3 python3-pip python3-venv'}
},
'openjdk': {
'name': 'OpenJDK 21',
'description': 'Open-source Java Development Kit',
'category': 'languages',
'windows': {'type': 'winget', 'id': 'EclipseAdoptium.Temurin.21.JDK'},
'darwin': {'type': 'brew', 'package': 'openjdk@21'},
'linux': {'type': 'apt', 'package': 'openjdk-21-jdk'}
},
'maven': {
'name': 'Apache Maven',
'description': 'Java build automation tool',
'category': 'languages',
'windows': {'type': 'winget', 'id': 'Apache.Maven'},
'darwin': {'type': 'brew', 'package': 'maven'},
'linux': {'type': 'apt', 'package': 'maven'}
},
'gradle': {
'name': 'Gradle',
'description': 'Build automation for JVM projects',
'category': 'languages',
'windows': {'type': 'winget', 'id': 'Gradle.Gradle'},
'darwin': {'type': 'brew', 'package': 'gradle'},
'linux': {'type': 'script', 'commands': [
'sudo apt install -y zip unzip',
'curl -s "https://get.sdkman.io" | bash',
'source "$HOME/.sdkman/bin/sdkman-init.sh" && sdk install gradle'
]}
},
'go': {
'name': 'Go (Golang)',
'description': 'Go programming language',
'category': 'languages',
'windows': {'type': 'winget', 'id': 'GoLang.Go'},
'darwin': {'type': 'brew', 'package': 'go'},
'linux': {'type': 'script', 'commands': [
'sudo rm -rf /usr/local/go',
'wget https://go.dev/dl/go1.22.0.linux-amd64.tar.gz',
'sudo tar -C /usr/local -xzf go1.22.0.linux-amd64.tar.gz',
'echo "export PATH=$PATH:/usr/local/go/bin" >> ~/.bashrc'
]}
},
'rust': {
'name': 'Rust',
'description': 'Rust programming language',
'category': 'languages',
'windows': {'type': 'winget', 'id': 'Rustlang.Rustup'},
'darwin': {'type': 'script', 'commands': ['curl --proto \'=https\' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y']},
'linux': {'type': 'script', 'commands': ['curl --proto \'=https\' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y']}
},
'ruby': {
'name': 'Ruby',
'description': 'Ruby programming language',
'category': 'languages',
'windows': {'type': 'winget', 'id': 'RubyInstallerTeam.Ruby.3.2'},
'darwin': {'type': 'brew', 'package': 'ruby'},
'linux': {'type': 'apt', 'package': 'ruby-full build-essential'}
},
'php': {
'name': 'PHP',
'description': 'PHP programming language',
'category': 'languages',
'windows': {'type': 'winget', 'id': 'XAMPP.XAMPP.8.2'},
'darwin': {'type': 'brew', 'package': 'php'},
'linux': {'type': 'apt', 'package': 'php php-cli php-common php-curl php-mbstring php-xml'}
},
'dotnet': {
'name': '.NET SDK',
'description': '.NET development platform (C#, F#)',
'category': 'languages',
'windows': {'type': 'winget', 'id': 'Microsoft.DotNet.SDK.8'},
'darwin': {'type': 'brew', 'package': 'dotnet', 'cask': True},
'linux': {'type': 'script', 'commands': [
'wget https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb',
'sudo dpkg -i packages-microsoft-prod.deb',
'sudo apt-get update && sudo apt-get install -y dotnet-sdk-8.0'
]}
},
'deno': {
'name': 'Deno',
'description': 'Secure TypeScript/JavaScript runtime',
'category': 'languages',
'windows': {'type': 'winget', 'id': 'DenoLand.Deno'},
'darwin': {'type': 'brew', 'package': 'deno'},
'linux': {'type': 'script', 'commands': ['curl -fsSL https://deno.land/install.sh | sh']}
},
'bun': {
'name': 'Bun',
'description': 'Fast all-in-one JavaScript runtime',
'category': 'languages',
'windows': {'type': 'script', 'commands': ['powershell -c "irm bun.sh/install.ps1|iex"']},
'darwin': {'type': 'brew', 'package': 'bun'},
'linux': {'type': 'script', 'commands': ['curl -fsSL https://bun.sh/install | bash']}
},
# ==================== DATABASES ====================
'postgresql': {
'name': 'PostgreSQL',
'description': 'Advanced open-source database',
'category': 'databases',
'windows': {'type': 'winget', 'id': 'PostgreSQL.PostgreSQL.16', 'fallback_ids': ['PostgreSQL.PostgreSQL.15'], 'env_paths': [r'C:\Program Files\PostgreSQL\16\bin', r'C:\Program Files\PostgreSQL\15\bin']},
'darwin': {'type': 'brew', 'package': 'postgresql@16'},
'linux': {'type': 'apt', 'package': 'postgresql postgresql-contrib'}
},
'mysql': {
'name': 'MySQL',
'description': 'Popular relational database',
'category': 'databases',
'windows': {'type': 'winget', 'id': 'Oracle.MySQL', 'env_paths': [r'C:\Program Files\MySQL\MySQL Server 8.0\bin']},
'darwin': {'type': 'brew', 'package': 'mysql'},
'linux': {'type': 'apt', 'package': 'mysql-server'}
},
'mongodb': {
'name': 'MongoDB',
'description': 'NoSQL document database',
'category': 'databases',
'windows': {'type': 'winget', 'id': 'MongoDB.Server'},
'darwin': {'type': 'brew', 'package': 'mongodb-community', 'tap': 'mongodb/brew'},
'linux': {'type': 'script', 'commands': [
'curl -fsSL https://www.mongodb.org/static/pgp/server-7.0.asc | sudo gpg -o /usr/share/keyrings/mongodb-server-7.0.gpg --dearmor',
'echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list',
'sudo apt-get update && sudo apt-get install -y mongodb-org'
]}
},
'redis': {
'name': 'Redis',
'description': 'In-memory data store',
'category': 'databases',
'windows': {'type': 'winget', 'id': 'Redis.Redis'},
'darwin': {'type': 'brew', 'package': 'redis'},
'linux': {'type': 'apt', 'package': 'redis-server'}
},
'dbeaver': {
'name': 'DBeaver',
'description': 'Universal database GUI tool',
'category': 'databases',
'windows': {'type': 'winget', 'id': 'dbeaver.dbeaver'},
'darwin': {'type': 'brew', 'package': 'dbeaver-community', 'cask': True},
'linux': {'type': 'snap', 'package': 'dbeaver-ce'}
},
# ==================== DEVOPS / CONTAINERS ====================
'docker': {
'name': 'Docker Desktop',
'description': 'Container platform',
'category': 'devops',
'windows': {'type': 'winget', 'id': 'Docker.DockerDesktop'},
'darwin': {'type': 'brew', 'package': 'docker', 'cask': True},
'linux': {'type': 'script', 'commands': [
'curl -fsSL https://get.docker.com -o get-docker.sh',
'sudo sh get-docker.sh',
'sudo usermod -aG docker $USER'
]}
},
'kubectl': {
'name': 'kubectl',
'description': 'Kubernetes command-line tool',
'category': 'devops',
'windows': {'type': 'winget', 'id': 'Kubernetes.kubectl'},
'darwin': {'type': 'brew', 'package': 'kubectl'},
'linux': {'type': 'script', 'commands': [
'curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"',
'sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl'
]}
},
'minikube': {
'name': 'Minikube',
'description': 'Local Kubernetes cluster',
'category': 'devops',
'windows': {'type': 'winget', 'id': 'Kubernetes.minikube'},
'darwin': {'type': 'brew', 'package': 'minikube'},
'linux': {'type': 'script', 'commands': [
'curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64',
'sudo install minikube-linux-amd64 /usr/local/bin/minikube'
]}
},
'terraform': {
'name': 'Terraform',
'description': 'Infrastructure as Code tool',
'category': 'devops',
'windows': {'type': 'winget', 'id': 'Hashicorp.Terraform'},
'darwin': {'type': 'brew', 'package': 'terraform'},
'linux': {'type': 'script', 'commands': [
'wget -O- https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg',
'echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list',
'sudo apt update && sudo apt install terraform -y'
]}
},
'helm': {
'name': 'Helm',
'description': 'Kubernetes package manager',
'category': 'devops',
'windows': {'type': 'winget', 'id': 'Helm.Helm'},
'darwin': {'type': 'brew', 'package': 'helm'},
'linux': {'type': 'script', 'commands': [
'curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash'
]}
},
# ==================== TESTING & API TOOLS ====================
'postman': {
'name': 'Postman',
'description': 'API development platform',
'category': 'testing',
'windows': {'type': 'winget', 'id': 'Postman.Postman'},
'darwin': {'type': 'brew', 'package': 'postman', 'cask': True},
'linux': {'type': 'snap', 'package': 'postman'}
},
'insomnia': {
'name': 'Insomnia',
'description': 'REST and GraphQL client',
'category': 'testing',
'windows': {'type': 'winget', 'id': 'Insomnia.Insomnia'},
'darwin': {'type': 'brew', 'package': 'insomnia', 'cask': True},
'linux': {'type': 'snap', 'package': 'insomnia'}
},
# ==================== TEAM & PRODUCTIVITY ====================
'slack': {
'name': 'Slack',
'description': 'Team messaging',
'category': 'collaboration',
'windows': {'type': 'winget', 'id': 'SlackTechnologies.Slack'},
'darwin': {'type': 'brew', 'package': 'slack', 'cask': True},
'linux': {'type': 'snap', 'package': 'slack'}
},
'notion': {
'name': 'Notion',
'description': 'All-in-one workspace',
'category': 'collaboration',
'windows': {'type': 'winget', 'id': 'Notion.Notion'},
'darwin': {'type': 'brew', 'package': 'notion', 'cask': True},
'linux': {'type': 'snap', 'package': 'notion-snap-reborn'}
},
'discord': {
'name': 'Discord',
'description': 'Voice, video & text communication',
'category': 'collaboration',
'windows': {'type': 'winget', 'id': 'Discord.Discord'},
'darwin': {'type': 'brew', 'package': 'discord', 'cask': True},
'linux': {'type': 'snap', 'package': 'discord'}
},
'teams': {
'name': 'Microsoft Teams',
'description': 'Microsoft collaboration platform',
'category': 'collaboration',
'windows': {'type': 'winget', 'id': 'Microsoft.Teams'},
'darwin': {'type': 'brew', 'package': 'microsoft-teams', 'cask': True},
'linux': {'type': 'snap', 'package': 'teams'}
},
'zoom': {
'name': 'Zoom',
'description': 'Video conferencing',
'category': 'collaboration',
'windows': {'type': 'winget', 'id': 'Zoom.Zoom'},
'darwin': {'type': 'brew', 'package': 'zoom', 'cask': True},
'linux': {'type': 'snap', 'package': 'zoom-client'}
},
# ==================== POWER-USER EXTRAS ====================
'windows-terminal': {
'name': 'Windows Terminal',
'description': 'Modern terminal for Windows',
'category': 'power_tools',
'windows': {'type': 'winget', 'id': 'Microsoft.WindowsTerminal'},
'darwin': None,
'linux': None
},
'iterm2': {
'name': 'iTerm2',
'description': 'Terminal replacement for macOS',
'category': 'power_tools',
'windows': None,
'darwin': {'type': 'brew', 'package': 'iterm2', 'cask': True},
'linux': None
},
'oh-my-zsh': {
'name': 'Oh My Zsh',
'description': 'Zsh configuration framework',
'category': 'power_tools',
'windows': None,
'darwin': {'type': 'script', 'commands': ['sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"']},
'linux': {'type': 'script', 'commands': [
'sudo apt install zsh -y',
'sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"'
]}
},
'7zip': {
'name': '7-Zip',
'description': 'File archiver with high compression',
'category': 'power_tools',
'windows': {'type': 'winget', 'id': '7zip.7zip'},
'darwin': {'type': 'brew', 'package': 'p7zip'},
'linux': {'type': 'apt', 'package': 'p7zip-full'}
},
'powertoys': {
'name': 'PowerToys',
'description': 'Windows power-user utilities',
'category': 'power_tools',
'windows': {'type': 'winget', 'id': 'Microsoft.PowerToys'},
'darwin': None,
'linux': None
},
'wsl': {
'name': 'WSL (Ubuntu)',
'description': 'Windows Subsystem for Linux',
'category': 'power_tools',
'windows': {'type': 'winget', 'id': 'Canonical.Ubuntu.2204'},
'darwin': None,
'linux': None
},
'fzf': {
'name': 'fzf',
'description': 'Command-line fuzzy finder',
'category': 'power_tools',
'windows': {'type': 'winget', 'id': 'junegunn.fzf'},
'darwin': {'type': 'brew', 'package': 'fzf'},
'linux': {'type': 'apt', 'package': 'fzf'}
},
'ripgrep': {
'name': 'ripgrep',
'description': 'Fast search tool (rg)',
'category': 'power_tools',
'windows': {'type': 'winget', 'id': 'BurntSushi.ripgrep.MSVC'},
'darwin': {'type': 'brew', 'package': 'ripgrep'},
'linux': {'type': 'apt', 'package': 'ripgrep'}
}
}
def check_prerequisites(self):
"""Check if package managers are installed"""
print("🔍 Checking prerequisites...\n")
if self.os_type == 'windows':
try:
subprocess.run(['winget', '--version'], capture_output=True, check=True)
print("✓ winget is installed")
except:
print("✗ winget not found. Please install App Installer from Microsoft Store")
return False
elif self.os_type == 'darwin':
try:
subprocess.run(['brew', '--version'], capture_output=True, check=True)
print("✓ Homebrew is installed")
except:
print("✗ Homebrew not found. Installing Homebrew...")
install_cmd = '/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"'
os.system(install_cmd)
elif self.os_type == 'linux':
print("✓ Using system package managers (apt/snap)")
print()
return True
def setup_environment_variables_windows(self, tool_key):
"""Setup environment variables for Windows"""
tool = self.tools[tool_key]
install_info = tool.get('windows', {})
if not install_info:
return True
env_paths = install_info.get('env_paths', [])
if not env_paths:
return True
try:
import winreg
key = winreg.OpenKey(winreg.HKEY_CURRENT_USER, 'Environment', 0, winreg.KEY_ALL_ACCESS)
try:
current_path, _ = winreg.QueryValueEx(key, 'PATH')
except FileNotFoundError:
current_path = ''
username = os.environ.get('USERNAME', '')
paths_to_add = []
for path in env_paths:
path = path.replace('{username}', username)
if os.path.exists(path) and path not in current_path:
paths_to_add.append(path)
if paths_to_add:
if current_path and not current_path.endswith(';'):
current_path += ';'
new_path = current_path + ';'.join(paths_to_add)
winreg.SetValueEx(key, 'PATH', 0, winreg.REG_EXPAND_SZ, new_path)
winreg.CloseKey(key)
import ctypes
HWND_BROADCAST = 0xFFFF
WM_SETTINGCHANGE = 0x1A
SMTO_ABORTIFHUNG = 0x0002
result = ctypes.c_long()
ctypes.windll.user32.SendMessageTimeoutW(
HWND_BROADCAST, WM_SETTINGCHANGE, 0, "Environment",
SMTO_ABORTIFHUNG, 5000, ctypes.byref(result)
)
return True
return True
except Exception as e:
print(f" ⚠️ Could not set environment variables: {str(e)[:50]}")
return False
def get_tools_by_category(self, category_key):
"""Get all tools in a specific category available for current OS"""
tools = []
for key, tool in self.tools.items():
if tool.get('category') == category_key:
os_config = tool.get(self.os_type)
if os_config is not None: # Tool is available for this OS
tools.append((key, tool))
return tools
def display_main_menu(self):
"""Display category selection menu"""
print("\n" + "=" * 70)
print(" 🛠️ Developer Environment Setup Tool")
print("=" * 70)
print(f" Detected OS: {platform.system()} {platform.release()}")
print("=" * 70)
print()
print(" Select categories to browse (enter numbers separated by spaces):")
print(" Or type 'all' to install essential tools from all categories\n")
category_list = list(self.categories.items())
for idx, (key, cat) in enumerate(category_list, 1):
tool_count = len(self.get_tools_by_category(key))
print(f" [{idx:2d}] {cat['name']:<35} ({tool_count} tools)")
print()
print(" [ 0] Review selection and install")
print(" [99] Exit without installing")
print()
if self.selected_tools:
print(f" 📋 Currently selected: {len(self.selected_tools)} tools")
print()
return category_list
def display_category_menu(self, category_key):
"""Display tools within a category"""
category = self.categories[category_key]
tools = self.get_tools_by_category(category_key)
print("\n" + "-" * 70)
print(f" {category['name']}")
print(f" {category['description']}")
print("-" * 70)
print()
print(" Select tools (enter numbers separated by spaces):")
print(" Type 'all' to select all tools in this category\n")
for idx, (key, tool) in enumerate(tools, 1):
selected = "✓" if key in self.selected_tools else " "
print(f" [{selected}] [{idx:2d}] {tool['name']:<25} - {tool['description']}")
print()
print(" [ 0] Back to categories")
print()
return tools
def get_category_selection(self, category_list):
"""Get user's category selection"""
while True:
try:
choice = input(" Your choice: ").strip().lower()
if choice == '99':
return 'exit'
if choice == '0':
return 'install'
if choice == 'all':
return 'all_essential'
selected_indices = [int(x.strip()) for x in choice.split()]
selected_categories = []
for idx in selected_indices:
if 1 <= idx <= len(category_list):
selected_categories.append(category_list[idx-1][0])
else:
print(f" Invalid choice: {idx}")
raise ValueError
return selected_categories
except (ValueError, IndexError):
print(" Invalid input. Please enter numbers separated by spaces.\n")
def get_tool_selection(self, tools):
"""Get user's tool selection within a category"""
while True:
try:
choice = input(" Your choice: ").strip().lower()
if choice == '0':
return 'back'
if choice == 'all':
return [key for key, _ in tools]
selected_indices = [int(x.strip()) for x in choice.split()]
selected_tools = []
for idx in selected_indices:
if 1 <= idx <= len(tools):
tool_key = tools[idx-1][0]
if tool_key in self.selected_tools:
self.selected_tools.remove(tool_key)
print(f" Removed: {self.tools[tool_key]['name']}")
else:
selected_tools.append(tool_key)
else:
print(f" Invalid choice: {idx}")
raise ValueError
return selected_tools
except (ValueError, IndexError):
print(" Invalid input. Please enter numbers separated by spaces.\n")
def get_basic_tools(self):
"""Get the list of basic essential tools for automatic setup"""
basic = {
'version_control': ['git'],
'editors': ['vscode'],
'browsers': ['chrome'],
'languages': ['node', 'python'],
'databases': [],
'devops': [],
'testing': [],
'collaboration': [],
'power_tools': []
}
if self.os_type == 'windows':
basic['power_tools'].append('windows-terminal')
elif self.os_type == 'darwin':
basic['power_tools'].append('iterm2')
return basic
def select_essential_tools(self):
"""Select essential tools from each category"""
essentials = self.get_basic_tools()
for category, tools in essentials.items():
for tool in tools:
if tool in self.tools and tool not in self.selected_tools:
os_config = self.tools[tool].get(self.os_type)
if os_config is not None:
self.selected_tools.append(tool)
def display_setup_type_menu(self):
"""Display setup type selection (Basic vs Custom)"""
print("\n" + "=" * 70)
print(" 🛠️ Developer Environment Setup Tool")
print("=" * 70)
print(f" Detected OS: {platform.system()} {platform.release()}")
print("=" * 70)
print()
print(" Choose your setup type:\n")
print(" [1] 🚀 Basic Setup (Recommended)")
print(" Automatically installs essential development tools:")
basic_tools = self.get_basic_tools()
basic_names = []
for cat_tools in basic_tools.values():
for tool_key in cat_tools:
if tool_key in self.tools:
os_config = self.tools[tool_key].get(self.os_type)
if os_config is not None:
basic_names.append(self.tools[tool_key]['name'])
print(f" → {', '.join(basic_names)}")
print()
print(" [2] ⚙️ Custom Setup")
print(" Manually browse categories and select tools to install")
print()
print(" [0] Exit")
print()
return self.get_setup_type_choice()
def get_setup_type_choice(self):
"""Get user's setup type choice"""
while True:
choice = input(" Your choice (1/2/0): ").strip()
if choice == '1':
return 'basic'
elif choice == '2':
return 'custom'
elif choice == '0':
return 'exit'
else:
print(" Invalid choice. Please enter 1, 2, or 0.\n")
def run_basic_setup(self):
"""Run automatic basic setup with essential tools"""
print("\n" + "=" * 70)
print(" 🚀 Basic Setup - Installing Essential Development Tools")
print("=" * 70)
# Select essential tools
self.select_essential_tools()
# Display what will be installed
print("\n The following tools will be installed:\n")
for cat_key, cat_info in self.categories.items():
cat_tools = [t for t in self.selected_tools if self.tools[t].get('category') == cat_key]
if cat_tools:
print(f" {cat_info['icon']} {cat_info['name'].split(' ', 1)[1]}:")
for tool_key in cat_tools:
print(f" • {self.tools[tool_key]['name']} - {self.tools[tool_key]['description']}")
print("\n" + "-" * 70)
print(f" Total: {len(self.selected_tools)} essential tools")
print("-" * 70)
# Quick confirmation
confirm = input("\n Press Enter to start installation (or 'n' to cancel): ").strip().lower()
if confirm == 'n':
print(" Installation cancelled.")
return False
# Save configuration
self.save_config(self.selected_tools)
# Install tools
print("\n 🚀 Starting installation...\n")
success_count = 0
failed_tools = []
for tool_key in self.selected_tools:
if self.install_tool(tool_key):
success_count += 1
else:
failed_tools.append(self.tools[tool_key]['name'])
# Summary
print("\n" + "=" * 70)
print(f" ✨ Basic Setup Complete!")
print(f" ✓ Successfully installed: {success_count}/{len(self.selected_tools)}")
if failed_tools:
print(f" ✗ Failed: {', '.join(failed_tools)}")
print("\n 💡 Troubleshooting tips:")
print(" • Run PowerShell/Terminal as Administrator")
print(" • Check if the tool is already installed")
print(" • Try installing manually from official website")
print("=" * 70)
print("\n 💡 Note: Restart your terminal/shell to use newly installed tools.\n")
return True
def install_tool(self, tool_key):
"""Install a specific tool based on OS"""
tool = self.tools[tool_key]
os_config = tool.get(self.os_type)
if not os_config:
print(f" ⚠️ {tool['name']} - not available for {self.os_type}")
return False
install_type = os_config['type']
print(f" 📦 Installing {tool['name']}...", end=' ', flush=True)
try:
if install_type == 'winget':
package_ids = [os_config['id']]
if 'fallback_ids' in os_config:
package_ids.extend(os_config['fallback_ids'])
last_error = None
for pkg_id in package_ids:
cmd = ['winget', 'install', '--id', pkg_id, '--silent', '--accept-source-agreements', '--accept-package-agreements']
result = subprocess.run(cmd, capture_output=True, text=True)
if result.returncode == 0:
print("✓")
self.setup_environment_variables_windows(tool_key)
return True
elif result.returncode == -1978335189 or 'already installed' in result.stdout.lower():
print("✓ (already installed)")
return True
else:
last_error = result
print(f"✗ (exit code: {last_error.returncode})")
error_output = (last_error.stderr or last_error.stdout or '').strip()[:200]
if 'administrator' in error_output.lower():
print(f" 💡 Tip: Try running as Administrator")
elif error_output:
print(f" Error: {error_output}")
return False
elif install_type == 'brew':
if os_config.get('tap'):
subprocess.run(['brew', 'tap', os_config['tap']], capture_output=True)
if os_config.get('cask'):
cmd = ['brew', 'install', '--cask', os_config['package']]
else:
cmd = ['brew', 'install', os_config['package']]
elif install_type == 'apt':
packages = os_config['package'].split()
cmd = ['sudo', 'apt-get', 'install', '-y'] + packages
elif install_type == 'snap':
cmd = ['sudo', 'snap', 'install', os_config['package']]
if os_config.get('classic'):
cmd.append('--classic')
elif install_type == 'script':
for command in os_config.get('commands', []):
subprocess.run(command, shell=True, check=True, capture_output=True)
print("✓")
return True
result = subprocess.run(cmd, capture_output=True, text=True)
if result.returncode == 0:
print("✓")
if self.os_type == 'windows':
self.setup_environment_variables_windows(tool_key)
return True
else:
print(f"✗ (exit code: {result.returncode})")
if result.stderr:
print(f" Error: {result.stderr.strip()[:100]}")
return False
except Exception as e:
print(f"✗ ({str(e)[:50]})")
return False
def save_config(self, selected_tools):
"""Save selected tools to config file"""
config = {
'os': self.os_type,
'tools': selected_tools,
'timestamp': str(Path.home())
}
with open(self.config_file, 'w') as f:
json.dump(config, f, indent=2)
def load_config(self):
"""Load previously selected tools"""
if self.config_file.exists():
with open(self.config_file, 'r') as f:
return json.load(f)
return None
def review_and_install(self):
"""Review selection and proceed with installation"""
if not self.selected_tools:
print("\n ⚠️ No tools selected. Saving empty configuration.\n")
self.save_config([]) # Save an empty configuration
return False
# Group selected tools by category
print("\n" + "=" * 70)