diff --git a/.gemini/commands/step_by_step.toml b/.gemini/commands/step_by_step.toml new file mode 100644 index 0000000..ae33a71 --- /dev/null +++ b/.gemini/commands/step_by_step.toml @@ -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 +... +""" diff --git a/ChangeLog b/ChangeLog index e8f0e24..9b7e949 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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 @@ -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 diff --git a/README.md b/README.md index 8e4a7c5..a5c3047 100644 --- a/README.md +++ b/README.md @@ -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 `. + +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.** diff --git a/list_commands.py b/list_commands.py new file mode 100644 index 0000000..a1b5477 --- /dev/null +++ b/list_commands.py @@ -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()