@eldrforge/git-tools 0.1.17 → 0.1.19
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/guide/index.md +56 -0
- package/package.json +6 -2
package/guide/index.md
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# @eldrforge/git-tools - Agentic Guide
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Git utilities for automation. Provides secure process execution and comprehensive Git operations with validation and safety checks.
|
|
6
|
+
|
|
7
|
+
## Key Features
|
|
8
|
+
|
|
9
|
+
- **Secure Execution** - Safe shell command execution with input validation
|
|
10
|
+
- **Git Operations** - Comprehensive Git command wrappers
|
|
11
|
+
- **Input Validation** - Prevent command injection attacks
|
|
12
|
+
- **Error Handling** - Robust error handling and logging
|
|
13
|
+
- **No Dependencies** - Minimal footprint (only shell-escape and semver)
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import { executeGitCommand, validateGitInput } from '@eldrforge/git-tools';
|
|
19
|
+
|
|
20
|
+
// Execute git command safely
|
|
21
|
+
const result = await executeGitCommand('status', ['--short']);
|
|
22
|
+
|
|
23
|
+
// Validate user input
|
|
24
|
+
const safeBranch = validateGitInput(userInput, 'branch-name');
|
|
25
|
+
|
|
26
|
+
// Get git information
|
|
27
|
+
const currentBranch = await getCurrentBranch();
|
|
28
|
+
const isDirty = await isWorkingTreeDirty();
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Dependencies
|
|
32
|
+
|
|
33
|
+
- shell-escape - Safe shell argument escaping
|
|
34
|
+
- semver - Semantic version parsing
|
|
35
|
+
|
|
36
|
+
## Package Structure
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
src/
|
|
40
|
+
├── child.ts # Child process execution
|
|
41
|
+
├── git.ts # Git command wrappers
|
|
42
|
+
├── validation.ts # Input validation
|
|
43
|
+
├── logger.ts # Logging utilities
|
|
44
|
+
└── index.ts
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Key Exports
|
|
48
|
+
|
|
49
|
+
- `executeGitCommand()` - Execute git commands safely
|
|
50
|
+
- `executeCommand()` - Execute arbitrary commands safely
|
|
51
|
+
- `validateGitInput()` - Validate git-related input
|
|
52
|
+
- `getCurrentBranch()` - Get current git branch
|
|
53
|
+
- `isWorkingTreeDirty()` - Check for uncommitted changes
|
|
54
|
+
- `getRemoteUrl()` - Get remote repository URL
|
|
55
|
+
- `getBranchCommits()` - Get commits on branch
|
|
56
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eldrforge/git-tools",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.19",
|
|
4
4
|
"description": "Git utilities for automation - secure process execution and Git operations",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
}
|
|
12
12
|
},
|
|
13
13
|
"files": [
|
|
14
|
-
"dist"
|
|
14
|
+
"dist",
|
|
15
|
+
"guide"
|
|
15
16
|
],
|
|
16
17
|
"repository": {
|
|
17
18
|
"type": "git",
|
|
@@ -37,6 +38,9 @@
|
|
|
37
38
|
],
|
|
38
39
|
"author": "Tim O'Brien <tobrien@discursive.com>",
|
|
39
40
|
"license": "Apache-2.0",
|
|
41
|
+
"engines": {
|
|
42
|
+
"node": ">=24.0.0"
|
|
43
|
+
},
|
|
40
44
|
"dependencies": {
|
|
41
45
|
"@types/semver": "^7.7.0",
|
|
42
46
|
"semver": "^7.7.2",
|