Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .gemini/commands/step_by_step.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
description = "Presents a response as a step by step process for the user to follow."
prompt = """
# Task

Break down the user's request into a clear, step-by-step process.

## Context
User input: {{args}}

## Instructions

1. **Analyze** the user's request carefully.
2. **Structure** your response as a clear, numbered list of steps.
3. **Actionable Steps**: Ensure each step is a direct action the user can take.
4. **Logical Flow**: The steps should follow a logical chronological or dependency-based order.
5. **Headers**: Use headers to separate distinct phases if the process is complex.
6. **Verification**: Include a final step or section on how to verify the task is complete, if applicable.

## Format
1. Step 1
2. Step 2
...
"""
26 changes: 15 additions & 11 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
* 1.0.0
- Release of verion 1.0
* 1.4.0
- Modified ChangeLog so changes are listed in reverse chronological order.
- Added step_by_step custom command.

* 1.1.0
- Added support for PHP, Ruby, Java, and C#.
- Find latest verion of the API and prompt user whether to use this version.
- Modified setup.sh to clone copies of the client libraries.
* 1.3.0
- Added explain command.
- Placed client libraries in a sub-directory of the project directory.
- Updated setup and update scripts.
- Added constraint to GEMINI.md to never modify files in api_examples.

* 1.2.0
- Updated README.md for clarity
Expand All @@ -15,8 +17,10 @@
- Modified logic in setup and update scripts.
- Added tests for setup and update scripts.

* 1.3.0
- Added explain command.
- Placed client libraries in a sub-directory of the project directory.
- Updated setup and update scripts.
- Added constraint to GEMINI.md to never modify files in api_examples.
* 1.1.0
- Added support for PHP, Ruby, Java, and C#.
- Find latest verion of the API and prompt user whether to use this version.
- Modified setup.sh to clone copies of the client libraries.

* 1.0.0
- Release of verion 1.0
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,22 @@ b. **Set Context in Gemini:** The `gemini` command must be run from the root of
> ... (results displayed) ...
> "Save the results to csv"

### Customm Commands

There is a bug in `/help`. It does not list custom commands defined in
`.gemini/commands` under the project directory.

This is a partial list of custom commands:

* `/explain` - Format the response from the model to be more readable.
* `/step_by_step` - Format the response as series of steps. Show the model's thinking process. This is useful for debugging.

To see the full list, from within the Assistant, `ls -l .gemini/commands`. This
will provide a list of the .toml files that define the commands. For example, `explain.toml`
can be executed as `/explain <your request>`.

Or, you can execute `run list_commands.py` from within the Assistant to see the full list with descriptions.

## Directory Structure

* `google-ads-api-developer-assistant/`: Root directory. **Launch `gemini` from here.**
Expand Down
42 changes: 42 additions & 0 deletions list_commands.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import pathlib
import tomllib
import sys

def main():
commands_dir = pathlib.Path(".gemini/commands")

if not commands_dir.exists():
print(f"Directory not found: {commands_dir.absolute()}")
sys.exit(1)

files = sorted(commands_dir.glob("*.toml"))

if not files:
print("No .toml files found in .gemini/commands")
return

# Collect all commands and descriptions
commands = []
for file_path in files:
try:
with file_path.open("rb") as f:
data = tomllib.load(f)
description = data.get("description", "No description found")
commands.append((file_path.stem, description))
except Exception as e:
print(f"Error reading {file_path.name}: {e}", file=sys.stderr)

if not commands:
return

# Calculate max length for alignment
max_len = max(len(cmd[0]) for cmd in commands)

# Print aligned output
# We add a few spaces gap between command and description
gap = 3
for name, description in commands:
print(f"{name:<{max_len + gap}}{description}")

if __name__ == "__main__":
main()