type-git 0.4.0 → 0.6.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
@@ -23,7 +23,7 @@ Typed inputs are checked against supported output contracts, with runtime valida
23
23
 
24
24
  This library wraps Git CLI with a focus on:
25
25
 
26
- 1. **Output Contract Safety**: Typed APIs only expose operations where stdout format is guaranteed
26
+ 1. **Output Contract Safety**: Parsed convenience APIs expose operations with stable stdout formats; typed CLI access returns raw output
27
27
  2. **Repository Context**: Separates `Git` (non-repo operations) from `Repo` (repo operations)
28
28
  3. **Worktree vs Bare**: Type-safe distinction between worktree and bare repositories
29
29
  4. **Raw Escape Hatch**: Arbitrary git commands via `raw()` when needed
@@ -89,6 +89,20 @@ import { TypeGit } from 'type-git/node';
89
89
  const git = await TypeGit.create({ useLegacyVersion: true });
90
90
  ```
91
91
 
92
+ ### Typed CLI commands
93
+
94
+ Use `command()` for registered CLI operations, including ones without a parsed convenience method:
95
+
96
+ ```typescript
97
+ const hash = await git.command('hash-object', [['--stdin']], { stdin: 'hello' });
98
+ await repo.command('remote add', [{ operand: 'origin' }, { operand: '/path/to/upstream' }]);
99
+ ```
100
+
101
+ Option tuples and operand objects retain ordering and repeated flags. Literal combinations are
102
+ checked against declarative rules; dynamic input is validated at runtime. The result contains
103
+ raw stdout, stderr, and exit status. See the [API design and pinned baselines](docs/design/typed-command-api.md)
104
+ and [coverage ledger](docs/design/command-coverage.md) for the currently registered scopes and remaining audit work.
105
+
92
106
  ### Advanced Usage
93
107
 
94
108
  For more control over adapters, you can use the factory function:
@@ -104,6 +118,10 @@ const git = await createGit({
104
118
  });
105
119
  ```
106
120
 
121
+ On Windows, pass `{ windowsHide: true }` to `TypeGit.create()` or `createNodeAdapters()` to keep
122
+ Git from opening console windows. To write your own `ExecAdapter` (for example one that only
123
+ allows specific invocations), see the [adapter contract](docs/adapters.md).
124
+
107
125
  ### Full Example
108
126
 
109
127
  ```typescript
@@ -193,6 +211,7 @@ src/
193
211
  │ ├── node/ # Node.js adapter
194
212
  │ ├── bun/ # Bun adapter
195
213
  │ └── deno/ # Deno adapter
214
+ ├── constraints/ # Declarative Git rules, type projection, and finite-domain exploration
196
215
  ├── impl/ # Git and repository operations
197
216
  ├── runner/ # Command execution, progress, and errors
198
217
  ├── parsers/ # Machine-output parsers
@@ -206,6 +225,10 @@ See the [migration guide](docs/migrations/0.4.0.md) for breaking changes and API
206
225
  The public API is still evolving; pin an exact version for controlled upgrades.
207
226
  Some flags require newer Git versions; LFS JSON queries require a compatible Git LFS installation.
208
227
 
228
+ Option restrictions are maintained in an [evidence-backed constraint model](docs/design/option-constraints.md).
229
+ Git restrictions and typed API exceptions are listed separately. Clone has generated finite-domain
230
+ compiler tests and independent Git conformance tests; this does not claim exhaustive Git coverage.
231
+
209
232
  ### Validation scope
210
233
 
211
234
  - **Node.js**: Unit and real-Git integration tests run in CI on Linux and Windows