Skip to content

Commit

Permalink
Merge pull request #1 from docker/cm/git-basics
Browse files Browse the repository at this point in the history
Add prompts for basic git actions
  • Loading branch information
ColinMcNeil authored Jul 12, 2024
2 parents 30b94da + f579c89 commit a8b29b2
Show file tree
Hide file tree
Showing 6 changed files with 100 additions and 0 deletions.
5 changes: 5 additions & 0 deletions prompts/git_branches/010_system_prompt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
You are an expert for managing git branches in a project.

The only commands you deal with are `branch`, `checkout` or `merge`.

`rebase` can rewrite history and therefore should not be used.
3 changes: 3 additions & 0 deletions prompts/git_branches/100_user_prompt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
The user wants to complete the following task related to git branches:

{{task}}
43 changes: 43 additions & 0 deletions prompts/git_branches/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
model: gpt-4
stream: true
functions:
- name: git
description: Run git branch-related commands against a project
parameters:
type: object
properties:
command:
type: string
description: The branch command. Either `branch`, `checkout` or `merge`. `rebase` can rewrite history and therefore should not be used.
args:
type: array
description: The arguments to pass into the git command
items:
type: string
description: An argument to the git command
container:
image: alpine/git:latest
---

# Background

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)

## Running the tool

```sh
DIR=$PWD
docker run --rm -it \
-v /var/run/docker.sock:/var/run/docker.sock \
--mount type=volume,source=docker-prompts,target=/prompts \
--mount type=bind,source=$HOME/.openai-api-key,target=/root/.openai-api-key \
--mount type=bind,source=/Users/slim/docker/labs-make-runbook/prompts,target=/my-prompts \
--workdir /my-prompts \
vonwig/prompts:latest run \
$DIR \
$USER \
"$(uname -o)" \
git_branches
# "github:docker/labs-make-runbook?ref=main&path=prompts/git_branches"
```
3 changes: 3 additions & 0 deletions prompts/git_files/010_system_prompt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You are an expert for managing files in a git project.

Either `rm`, `add` or `mv`.
3 changes: 3 additions & 0 deletions prompts/git_files/100_user_prompt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
The user wants to complete the following task related to git files:

{{task}}
43 changes: 43 additions & 0 deletions prompts/git_files/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
model: gpt-4
stream: true
functions:
- name: git
description: Run git file-related commands against a project
parameters:
type: object
properties:
command:
type: string
description: The branch command. Either `rm`, `mv` or `add`.
args:
type: array
description: The arguments to pass into the git command
items:
type: string
description: An argument to the git command
container:
image: alpine/git:latest
---

# Background

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)

## Running the tool

```sh
DIR=$PWD
docker run --rm -it \
-v /var/run/docker.sock:/var/run/docker.sock \
--mount type=volume,source=docker-prompts,target=/prompts \
--mount type=bind,source=$HOME/.openai-api-key,target=/root/.openai-api-key \
--mount type=bind,source=/Users/slim/docker/labs-make-runbook/prompts,target=/my-prompts \
--workdir /my-prompts \
vonwig/prompts:latest run \
$DIR \
$USER \
"$(uname -o)" \
git_files
# "github:docker/labs-make-runbook?ref=main&path=prompts/git_files"
```

0 comments on commit a8b29b2

Please sign in to comment.