Skip to content

Commit f579c89

Browse files
author
Colin McNeil
committed
Add prompts for basic git actions
1 parent 66184b8 commit f579c89

File tree

6 files changed

+100
-0
lines changed

6 files changed

+100
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
You are an expert for managing git branches in a project.
2+
3+
The only commands you deal with are `branch`, `checkout` or `merge`.
4+
5+
`rebase` can rewrite history and therefore should not be used.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
The user wants to complete the following task related to git branches:
2+
3+
{{task}}

prompts/git_branches/README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
model: gpt-4
3+
stream: true
4+
functions:
5+
- name: git
6+
description: Run git branch-related commands against a project
7+
parameters:
8+
type: object
9+
properties:
10+
command:
11+
type: string
12+
description: The branch command. Either `branch`, `checkout` or `merge`. `rebase` can rewrite history and therefore should not be used.
13+
args:
14+
type: array
15+
description: The arguments to pass into the git command
16+
items:
17+
type: string
18+
description: An argument to the git command
19+
container:
20+
image: alpine/git:latest
21+
---
22+
23+
# Background
24+
25+
Branch management is a common use case of git, so this tool is used to execute branch and related commands (git checkout, git branch, git merge)
26+
27+
## Running the tool
28+
29+
```sh
30+
DIR=$PWD
31+
docker run --rm -it \
32+
-v /var/run/docker.sock:/var/run/docker.sock \
33+
--mount type=volume,source=docker-prompts,target=/prompts \
34+
--mount type=bind,source=$HOME/.openai-api-key,target=/root/.openai-api-key \
35+
--mount type=bind,source=/Users/slim/docker/labs-make-runbook/prompts,target=/my-prompts \
36+
--workdir /my-prompts \
37+
vonwig/prompts:latest run \
38+
$DIR \
39+
$USER \
40+
"$(uname -o)" \
41+
git_branches
42+
# "github:docker/labs-make-runbook?ref=main&path=prompts/git_branches"
43+
```
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
You are an expert for managing files in a git project.
2+
3+
Either `rm`, `add` or `mv`.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
The user wants to complete the following task related to git files:
2+
3+
{{task}}

prompts/git_files/README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
model: gpt-4
3+
stream: true
4+
functions:
5+
- name: git
6+
description: Run git file-related commands against a project
7+
parameters:
8+
type: object
9+
properties:
10+
command:
11+
type: string
12+
description: The branch command. Either `rm`, `mv` or `add`.
13+
args:
14+
type: array
15+
description: The arguments to pass into the git command
16+
items:
17+
type: string
18+
description: An argument to the git command
19+
container:
20+
image: alpine/git:latest
21+
---
22+
23+
# Background
24+
25+
File management is a common use case of git, so this tool is used to execute commands to manage the staged files in a git repo (git rm, git add, git mv)
26+
27+
## Running the tool
28+
29+
```sh
30+
DIR=$PWD
31+
docker run --rm -it \
32+
-v /var/run/docker.sock:/var/run/docker.sock \
33+
--mount type=volume,source=docker-prompts,target=/prompts \
34+
--mount type=bind,source=$HOME/.openai-api-key,target=/root/.openai-api-key \
35+
--mount type=bind,source=/Users/slim/docker/labs-make-runbook/prompts,target=/my-prompts \
36+
--workdir /my-prompts \
37+
vonwig/prompts:latest run \
38+
$DIR \
39+
$USER \
40+
"$(uname -o)" \
41+
git_files
42+
# "github:docker/labs-make-runbook?ref=main&path=prompts/git_files"
43+
```

0 commit comments

Comments
 (0)