You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: correct CLI syntax - use -p flag for non-interactive mode
- Add -p flag to all one-shot command examples
- Document non-interactive mode limitations (no file writes, no shell)
- Add --yolo mode documentation
- Add --output-format json example
- Update shell alias usage examples
- Clarify Google Search works in interactive mode
Copy file name to clipboardExpand all lines: README.md
+30-20Lines changed: 30 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,45 +29,42 @@ docker run -it --rm \
29
29
ungb/gemini-cli
30
30
```
31
31
32
-
### One-Shot Commands
32
+
### One-Shot Commands (Non-Interactive)
33
+
34
+
Use the `-p` (or `--prompt`) flag for non-interactive mode:
33
35
34
36
```bash
35
37
# Ask a question about your codebase
36
38
docker run -it --rm \
37
39
-v $(pwd):/workspace \
38
40
-e GOOGLE_API_KEY=$GOOGLE_API_KEY \
39
41
ungb/gemini-cli \
40
-
gemini "explain the architecture of this project"
42
+
gemini -p "explain the architecture of this project"
41
43
42
44
# Generate code
43
45
docker run -it --rm \
44
46
-v $(pwd):/workspace \
45
47
-e GOOGLE_API_KEY=$GOOGLE_API_KEY \
46
48
ungb/gemini-cli \
47
-
gemini "create a REST API endpoint for user authentication"
48
-
49
-
# Fix bugs
50
-
docker run -it --rm \
51
-
-v $(pwd):/workspace \
52
-
-e GOOGLE_API_KEY=$GOOGLE_API_KEY \
53
-
ungb/gemini-cli \
54
-
gemini "fix the failing tests in src/utils"
49
+
gemini -p "create a REST API endpoint for user authentication"
55
50
56
51
# Code review
57
52
docker run -it --rm \
58
53
-v $(pwd):/workspace \
59
54
-e GOOGLE_API_KEY=$GOOGLE_API_KEY \
60
55
ungb/gemini-cli \
61
-
gemini "review the changes in the last commit for security issues"
56
+
gemini -p "review the changes in the last commit for security issues"
62
57
63
-
#Generate documentation
58
+
#JSON output (for scripts/automation)
64
59
docker run -it --rm \
65
60
-v $(pwd):/workspace \
66
61
-e GOOGLE_API_KEY=$GOOGLE_API_KEY \
67
62
ungb/gemini-cli \
68
-
gemini "generate API documentation for this module"
63
+
gemini -p --output-format json "list all TODO comments"
69
64
```
70
65
66
+
> **Note**: Non-interactive mode (`-p`) has limitations - it cannot authorize tools like WriteFile or run shell commands. For tasks requiring file modifications, use interactive mode.
0 commit comments