Commit 936488a
committed
cli(feat): Modernize CLI with new commands and streamlined flags
why: Align vcspull CLI with modern DevOps tool conventions (Terraform,
Cargo, Ruff, Biome) for improved developer experience and automation
support. Previous CLI lacked introspection commands, dry-run support,
and machine-readable output.
what:
Breaking Changes:
- Remove `vcspull import` command (split into `add` and `discover`)
- Rename `-c/--config` to `-f/--file` across all commands
- Add `-w/--workspace/--workspace-root` (all aliases supported)
New Commands:
- `vcspull list` - List configured repos with --tree, --json, --ndjson
- `vcspull status` - Check repo health (exists, clean/dirty, ahead/behind)
- `vcspull add` - Add single repository with --dry-run support
- `vcspull discover` - Scan filesystem for repos with --dry-run support
New Infrastructure:
- Create _output.py for OutputFormatter (JSON/NDJSON/human modes)
- Create _colors.py with semantic colors and NO_COLOR support
- Add --dry-run/-n flag to sync, add, discover commands
- Add --json/--ndjson structured output to sync, list, status
- Add --color {auto,always,never} flag with NO_COLOR env support
Improvements:
- Split _import.py into add.py (single) and discover.py (bulk)
- Update sync.py with new flags and dry-run preview mode
- Update fmt.py to use -f flag instead of -c
- Wire all new commands in __init__.py with updated examples
- Update README.md with new command examples
- Update CHANGES with breaking changes and migration guide
- Update test_log.py for new module structure
Migration Guide in CHANGES:
- vcspull import NAME URL → vcspull add NAME URL
- vcspull import --scan DIR → vcspull discover DIR
- vcspull sync -c FILE → vcspull sync -f FILE
- vcspull sync --workspace-root PATH → vcspull sync -w PATH
refs: All tests pass (109 tests), mypy clean, ruff clean1 parent 1514bde commit 936488a
13 files changed
Lines changed: 1392 additions & 1320 deletions
File tree
- src/vcspull/cli
- tests
- cli
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 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 | + | |
35 | 85 | | |
36 | 86 | | |
37 | 87 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
95 | 95 | | |
96 | | - | |
| 96 | + | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
| 99 | + | |
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
104 | | - | |
105 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
106 | 107 | | |
107 | 108 | | |
108 | | - | |
| 109 | + | |
109 | 110 | | |
110 | 111 | | |
111 | 112 | | |
112 | 113 | | |
113 | 114 | | |
114 | | - | |
| 115 | + | |
115 | 116 | | |
116 | 117 | | |
117 | 118 | | |
118 | | - | |
| 119 | + | |
119 | 120 | | |
120 | 121 | | |
121 | 122 | | |
| |||
124 | 125 | | |
125 | 126 | | |
126 | 127 | | |
127 | | - | |
| 128 | + | |
128 | 129 | | |
129 | 130 | | |
130 | 131 | | |
| |||
149 | 150 | | |
150 | 151 | | |
151 | 152 | | |
152 | | - | |
| 153 | + | |
153 | 154 | | |
154 | 155 | | |
155 | 156 | | |
| |||
0 commit comments