Commit 8bccc0f
Migrate from ArgumentParser to Swift Configuration
Replace ArgumentParser with Swift Configuration for unified CLI and
environment variable configuration management. This migration follows
the CelestraCloud pattern and provides better fault tolerance and
automatic type conversion.
**New Configuration Infrastructure:**
- ConfigurationLoader: Actor-based configuration management with
CommandLineArgumentsProvider and EnvironmentVariablesProvider
- ConfigurationKeys: Centralized key definitions with dual-key fallback
(CLI arguments and environment variables)
- BushelConfiguration: Configuration structs with validation pattern
transforming optional to non-optional fields
**Command Updates:**
- SyncCommand: Removed 13 @Option/@Flag properties, ~110 lines reduced
- ExportCommand: Removed 8 @Option/@Flag properties, ~110 lines reduced
- StatusCommand: Removed 5 @Option/@Flag properties, ~120 lines reduced
- ListCommand: Removed 6 @Option/@Flag properties, ~50 lines reduced
- ClearCommand: Removed 5 @Option/@Flag properties, ~60 lines reduced
**CLI Updates:**
- BushelCloudCLI: Replaced AsyncParsableCommand with manual subcommand
dispatch using simple switch statement
- Package.swift: Removed ArgumentParser dependency, added Swift
Configuration with CommandLineArguments trait
- Updated platform requirements: macOS 15+, iOS 18+, watchOS 11+
**Benefits:**
- Unified configuration: Single ConfigurationLoader handles both CLI
arguments and environment variables
- Automatic type conversion for String, Int, Double, Bool
- Secrets handling with automatic redaction
- Better fault tolerance: Invalid values fall back to defaults
- Cleaner code: ~450 lines of boilerplate removed
All commands maintain the same CLI argument syntax while using a
significantly cleaner implementation.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent 69f99cf commit 8bccc0f
File tree
11 files changed
+742
-434
lines changed- Sources
- BushelCloudCLI
- Commands
- BushelCloudKit/Configuration
11 files changed
+742
-434
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
99 | 103 | | |
100 | 104 | | |
101 | 105 | | |
| |||
107 | 111 | | |
108 | 112 | | |
109 | 113 | | |
110 | | - | |
| 114 | + | |
| 115 | + | |
111 | 116 | | |
112 | 117 | | |
113 | 118 | | |
114 | 119 | | |
115 | 120 | | |
116 | 121 | | |
117 | | - | |
118 | | - | |
| 122 | + | |
119 | 123 | | |
120 | 124 | | |
121 | 125 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
39 | 37 | | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
53 | 61 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | 30 | | |
32 | 31 | | |
33 | 32 | | |
34 | 33 | | |
35 | 34 | | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
43 | 41 | | |
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 | 42 | | |
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 | | - | |
| 43 | + | |
104 | 44 | | |
105 | 45 | | |
106 | | - | |
| 46 | + | |
| 47 | + | |
107 | 48 | | |
108 | | - | |
| 49 | + | |
109 | 50 | | |
110 | 51 | | |
111 | 52 | | |
| |||
120 | 61 | | |
121 | 62 | | |
122 | 63 | | |
123 | | - | |
124 | | - | |
125 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
126 | 67 | | |
127 | 68 | | |
128 | 69 | | |
| |||
137 | 78 | | |
138 | 79 | | |
139 | 80 | | |
140 | | - | |
| 81 | + | |
141 | 82 | | |
142 | 83 | | |
143 | 84 | | |
| |||
0 commit comments