AntGravityCLI 1.0.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- antgravitycli-1.0.2/AntGravityCLI.egg-info/PKG-INFO +232 -0
- antgravitycli-1.0.2/AntGravityCLI.egg-info/SOURCES.txt +40 -0
- antgravitycli-1.0.2/AntGravityCLI.egg-info/dependency_links.txt +1 -0
- antgravitycli-1.0.2/AntGravityCLI.egg-info/entry_points.txt +2 -0
- antgravitycli-1.0.2/AntGravityCLI.egg-info/requires.txt +6 -0
- antgravitycli-1.0.2/AntGravityCLI.egg-info/top_level.txt +1 -0
- antgravitycli-1.0.2/PKG-INFO +232 -0
- antgravitycli-1.0.2/README.md +212 -0
- antgravitycli-1.0.2/antgravity_cli/__init__.py +0 -0
- antgravitycli-1.0.2/antgravity_cli/config.py +68 -0
- antgravitycli-1.0.2/antgravity_cli/console_io.py +167 -0
- antgravitycli-1.0.2/antgravity_cli/handlers.py +18 -0
- antgravitycli-1.0.2/antgravity_cli/i18n.py +73 -0
- antgravitycli-1.0.2/antgravity_cli/interfaces.py +44 -0
- antgravitycli-1.0.2/antgravity_cli/list_skills.py +53 -0
- antgravitycli-1.0.2/antgravity_cli/main.py +52 -0
- antgravitycli-1.0.2/antgravity_cli/parser.py +106 -0
- antgravitycli-1.0.2/antgravity_cli/repl.py +126 -0
- antgravitycli-1.0.2/antgravity_cli/runner.py +31 -0
- antgravitycli-1.0.2/antgravity_cli/translate/en-us/config.json +5 -0
- antgravitycli-1.0.2/antgravity_cli/translate/en-us/console_io.json +6 -0
- antgravitycli-1.0.2/antgravity_cli/translate/en-us/handlers.json +6 -0
- antgravitycli-1.0.2/antgravity_cli/translate/en-us/interfaces.json +1 -0
- antgravitycli-1.0.2/antgravity_cli/translate/en-us/list_skills.json +5 -0
- antgravitycli-1.0.2/antgravity_cli/translate/en-us/main.json +1 -0
- antgravitycli-1.0.2/antgravity_cli/translate/en-us/parser.json +8 -0
- antgravitycli-1.0.2/antgravity_cli/translate/en-us/repl.json +12 -0
- antgravitycli-1.0.2/antgravity_cli/translate/en-us/runner.json +1 -0
- antgravitycli-1.0.2/antgravity_cli/translate/en-us/test_cli.json +1 -0
- antgravitycli-1.0.2/antgravity_cli/translate/pt-br/config.json +5 -0
- antgravitycli-1.0.2/antgravity_cli/translate/pt-br/console_io.json +6 -0
- antgravitycli-1.0.2/antgravity_cli/translate/pt-br/handlers.json +6 -0
- antgravitycli-1.0.2/antgravity_cli/translate/pt-br/interfaces.json +1 -0
- antgravitycli-1.0.2/antgravity_cli/translate/pt-br/list_skills.json +5 -0
- antgravitycli-1.0.2/antgravity_cli/translate/pt-br/main.json +1 -0
- antgravitycli-1.0.2/antgravity_cli/translate/pt-br/parser.json +8 -0
- antgravitycli-1.0.2/antgravity_cli/translate/pt-br/repl.json +12 -0
- antgravitycli-1.0.2/antgravity_cli/translate/pt-br/runner.json +1 -0
- antgravitycli-1.0.2/antgravity_cli/translate/pt-br/test_cli.json +1 -0
- antgravitycli-1.0.2/antgravity_cli/utils.py +10 -0
- antgravitycli-1.0.2/pyproject.toml +47 -0
- antgravitycli-1.0.2/setup.cfg +4 -0
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: AntGravityCLI
|
|
3
|
+
Version: 1.0.2
|
|
4
|
+
Summary: A portable and interactive command-line interface (CLI) for the Google Antigravity ecosystem.
|
|
5
|
+
Author-email: Henrique Fazolo <henriquefazolo@gmail.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/henriquefazolo/AntGravityCLI
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Requires-Python: >=3.11
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
Requires-Dist: click>=8.4.2
|
|
15
|
+
Requires-Dist: colorama>=0.4.6
|
|
16
|
+
Requires-Dist: python-dotenv>=1.2.2
|
|
17
|
+
Requires-Dist: google-antigravity>=0.1.5
|
|
18
|
+
Requires-Dist: rich>=13.7.1
|
|
19
|
+
Requires-Dist: prompt-toolkit>=3.0.43
|
|
20
|
+
|
|
21
|
+
# AntGravity CLI
|
|
22
|
+
|
|
23
|
+
<p align="center">
|
|
24
|
+
<img src=".img/ant%20gravity.png" alt="AntGravity CLI Logo" width="400">
|
|
25
|
+
</p>
|
|
26
|
+
|
|
27
|
+
A portable and interactive command-line interface (CLI) developed in Python to flexibly interact with agents from the **Google Antigravity** ecosystem.
|
|
28
|
+
|
|
29
|
+
## Requirements
|
|
30
|
+
|
|
31
|
+
- Python 3.11.7 (as configured in the development environment).
|
|
32
|
+
- Installed dependencies (including `google-antigravity`, `click`, `colorama`, `python-dotenv`).
|
|
33
|
+
|
|
34
|
+
## Installation and Setup
|
|
35
|
+
|
|
36
|
+
1. Make sure the virtual environment is activated:
|
|
37
|
+
```powershell
|
|
38
|
+
.\.venv\Scripts\activate
|
|
39
|
+
```
|
|
40
|
+
2. Configure your environment using a `.env` file. You can copy the template from [.env.example](file:///.env.example) to get started:
|
|
41
|
+
```powershell
|
|
42
|
+
cp .env.example .env
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Environment Resolution and Default Values
|
|
46
|
+
|
|
47
|
+
The CLI resolves configuration by loading `.env` files. By default, it loads them in two stages:
|
|
48
|
+
1. **Physical CLI script installation folder**: Loads `.env` for global default configuration.
|
|
49
|
+
2. **Current Working Directory (CWD)**: Loads `.env` for workspace-specific configurations (which override the global ones).
|
|
50
|
+
|
|
51
|
+
Alternatively, you can load a custom `.env` file using the `--env-file` / `-e` option. When a custom `.env` file is specified, the default `.env` files (global and CWD) are **not** loaded automatically, giving you full control over the variables.
|
|
52
|
+
|
|
53
|
+
If a `.env` file is not present or a specific variable is not set, the CLI falls back to the following default values:
|
|
54
|
+
|
|
55
|
+
| Environment Variable | CLI Option | Description | Default Value |
|
|
56
|
+
| :--- | :--- | :--- | :--- |
|
|
57
|
+
| `GEMINI_API_KEY` | `--api-key` | Gemini API Key | *None (Required)* |
|
|
58
|
+
| `GEMINI_MODEL` | `--model` / `-m` | Gemini Model to be used | `gemini-3.1-flash-lite` |
|
|
59
|
+
| `ANTGRAVITY_LANG` | `--language` / `-l` | CLI UI Language | `en-us` |
|
|
60
|
+
| `ANTGRAVITY_YOLO` | `--yolo` / `-y` | Run in YOLO (Safe-bypass) Mode | `False` (Safe Mode) |
|
|
61
|
+
| `ANTGRAVITY_WORKSPACE` | `--workspace` / `-w` | Restricted workspace paths | *None (Current CWD)* |
|
|
62
|
+
| `ANTGRAVITY_SYSTEM_INSTRUCTION` | `--system-instruction` / `-s` | System instruction or path | *None* |
|
|
63
|
+
| `ANTGRAVITY_SKILLS_PATH` | `--skills-path` / `-k` | Custom workspace skills folders | *None* |
|
|
64
|
+
| `ANTGRAVITY_SILENT` | `--silent` | Hide thoughts and tool execution logs | `False` |
|
|
65
|
+
| `ANTGRAVITY_VERBOSE` | `--verbose` / `-v` | Show internal reasoning details | `False` |
|
|
66
|
+
|
|
67
|
+
*(You can always override these values dynamically by passing their respective flags on the command line).*
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## How to Use
|
|
73
|
+
|
|
74
|
+
### 1. Single Prompt Mode
|
|
75
|
+
To send a prompt and receive the response directly:
|
|
76
|
+
```powershell
|
|
77
|
+
python main.py "Write a greeting in Python"
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### 2. Interactive Mode (REPL)
|
|
81
|
+
To start a continuous chat with the agent (which maintains session history):
|
|
82
|
+
```powershell
|
|
83
|
+
python main.py
|
|
84
|
+
```
|
|
85
|
+
**Useful commands in Interactive Mode:**
|
|
86
|
+
- `/reset`: Clears conversation history and resets agent context.
|
|
87
|
+
- `/exit` or `/quit`: Closes the interactive terminal.
|
|
88
|
+
|
|
89
|
+
**Auto-completion and Active Skills:**
|
|
90
|
+
* **Real-time Auto-completion**: As you type `/` in the prompt (either at the start or mid-sentence), a dynamic dropdown menu displaying all special commands and active skills will instantly pop up. The auto-completion is case-insensitive, stays open stably when you delete characters (Backspace), and ignores regular chat text and trailing spaces to maintain a clean console.
|
|
91
|
+
* **Banner Skills Listing**: At REPL startup, a welcome banner displays all available active workspace skills one per line, limited to 5. If more than 5 exist, a localized ellipsis (`... and more` or `... e mais`) is appended.
|
|
92
|
+
* **Hybrid Skills Resolution**: By default (when `--skills-path` / `-k` is not specified), the welcome banner list, autocomplete menu, and prompt parser strictly load active skills from the CLI script's physical installation directory (`.agents/skills`), even when executing the CLI from or targeting a different CWD/workspace. This ensures that internal CLI utility skills (like `/gerar_skill_template` and `/gerenciar_deploy`) are always loaded and executable. If you explicitly pass one or more custom paths via the `--skills-path` / `-k` flag, the CLI dynamically loads **both** your custom/local workspace skills and the physical Ant installation skills simultaneously, giving you access to both sets of tools in the REPL session.
|
|
93
|
+
|
|
94
|
+
### 3. Safe Mode vs YOLO Mode
|
|
95
|
+
- **Safe Mode (Default)**: Whenever the agent tries to run risky terminal commands (like the `RUN_COMMAND` tool), the CLI will request your permission in the console (`[y/N]`) before proceeding.
|
|
96
|
+
- **YOLO Mode (`-y` / `--yolo`)**: Disables all safety confirmations and executes all actions autonomously.
|
|
97
|
+
```powershell
|
|
98
|
+
python main.py -y "Create a folder named test and list the directory"
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### 4. Listing Available Skills
|
|
102
|
+
You can quickly scan and list the names of all active local agent skills folders registered in `.agents/skills/` using the utility script:
|
|
103
|
+
```powershell
|
|
104
|
+
python list_skills.py
|
|
105
|
+
```
|
|
106
|
+
*(This script supports localization, reading the system language from the `ANTGRAVITY_LANG` environment variable).*
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## Available Options
|
|
111
|
+
|
|
112
|
+
You can customize the CLI behavior using flags:
|
|
113
|
+
|
|
114
|
+
| Flag | Shortcut | Env Variable | Description |
|
|
115
|
+
| :--- | :--- | :--- | :--- |
|
|
116
|
+
| `--model` | `-m` | `GEMINI_MODEL` | Specifies the Gemini model (default: `gemini-3.1-flash-lite`). |
|
|
117
|
+
| `--yolo` | `-y` | `ANTGRAVITY_YOLO` | Skips all permissions/confirmations and runs everything freely. |
|
|
118
|
+
| `--workspace` | `-w` | `ANTGRAVITY_WORKSPACE` | Restricts file tools to a specific directory (can be repeated). |
|
|
119
|
+
| `--system-instruction` | `-s` | `ANTGRAVITY_SYSTEM_INSTRUCTION` | Text with custom system instructions or path to a text file. |
|
|
120
|
+
| `--api-key` | | `GEMINI_API_KEY` | Passes the API key directly on the command line. |
|
|
121
|
+
| `--skills-path` | `-k` | `ANTGRAVITY_SKILLS_PATH` | Path to skills folders (can be repeated). If not provided and the `./skills` folder exists, it will be loaded by default. |
|
|
122
|
+
| `--silent` | | `ANTGRAVITY_SILENT` | Hides internal thoughts and tool calls in the terminal. |
|
|
123
|
+
| `--verbose` | `-v` | `ANTGRAVITY_VERBOSE` | Displays the AI's internal reasoning thoughts (Chain of Thought) in gray on the console. |
|
|
124
|
+
| `--language` | `-l` | `ANTGRAVITY_LANG` | Specifies the output translation language (default: `en-us`, e.g. `pt-br`, `en-us`). |
|
|
125
|
+
| `--env-file` | `-e` | | Path to a custom `.env` file to load configurations from (bypasses default global and local .env files). |
|
|
126
|
+
|
|
127
|
+
Advanced usage example:
|
|
128
|
+
```powershell
|
|
129
|
+
python main.py -m gemini-3.5-flash -y -s "You are a concise assistant speaking Spanish" "Hello!"
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## Localization (i18n)
|
|
135
|
+
|
|
136
|
+
The AntGravity CLI features built-in internationalization (i18n). Output messages, error states, and terminal prompts are decoupled from the core source code and stored as localized translation files inside the `translate/` directory.
|
|
137
|
+
|
|
138
|
+
### Structure of `translate/`
|
|
139
|
+
```text
|
|
140
|
+
translate/
|
|
141
|
+
├── pt-br/ # Brazilian Portuguese translations
|
|
142
|
+
│ ├── config.json
|
|
143
|
+
│ ├── console_io.json
|
|
144
|
+
│ ├── handlers.json
|
|
145
|
+
│ ├── parser.json
|
|
146
|
+
│ └── repl.json
|
|
147
|
+
└── en-us/ # English translations (Default)
|
|
148
|
+
├── config.json
|
|
149
|
+
├── console_io.json
|
|
150
|
+
├── handlers.json
|
|
151
|
+
├── parser.json
|
|
152
|
+
└── repl.json
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### Adding New Languages
|
|
156
|
+
To support a new language (e.g. `es-es` for Spanish):
|
|
157
|
+
1. Create a new directory named after the locale code inside `translate/` (e.g. `translate/es-es/`).
|
|
158
|
+
2. Copy the JSON files from `translate/en-us/` into the new folder and translate their text values.
|
|
159
|
+
3. Switch the CLI runtime language using the `--language es-es` flag.
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## Customization and Settings (`.agents`)
|
|
164
|
+
|
|
165
|
+
The `.agents` folder at the root of your project is the **Local Workspace Customization** folder. Through it, you can define rules, create new skills, and customize agent responses.
|
|
166
|
+
|
|
167
|
+
### Complete Structure of `.agents`
|
|
168
|
+
|
|
169
|
+
```text
|
|
170
|
+
my-project/
|
|
171
|
+
└── .agents/
|
|
172
|
+
├── AGENTS.md # Project rules and guidelines
|
|
173
|
+
├── skills.json # (Optional) Skills configuration and registration
|
|
174
|
+
└── skills/ # Folder containing specific skills
|
|
175
|
+
└── gerenciar_deploy/ # Example of a skill
|
|
176
|
+
├── SKILL.md # Skill instructions and triggers (Required)
|
|
177
|
+
├── scripts/ # Supporting scripts
|
|
178
|
+
├── examples/ # Usage/code examples
|
|
179
|
+
└── references/ # Reference documentation
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### 1. Project Rules (`AGENTS.md`)
|
|
183
|
+
The `.agents/AGENTS.md` file defines the general rules of behavior, style, and technical constraints that the agent must follow in this project (e.g., code pattern, language, preferred frameworks).
|
|
184
|
+
|
|
185
|
+
*There is also the global scope at `C:\Users\<user>\.gemini\config\AGENTS.md` for rules that apply to the entire machine.*
|
|
186
|
+
|
|
187
|
+
### 2. Skills (`skills/`)
|
|
188
|
+
**Skills** are packages of behavior and tools dynamically loaded depending on conversation context or user request.
|
|
189
|
+
|
|
190
|
+
* **The `SKILL.md` file (Required)**:
|
|
191
|
+
Defines YAML metadata (used by the AI for auto-activation) and the body with the skill instructions:
|
|
192
|
+
```markdown
|
|
193
|
+
---
|
|
194
|
+
name: "Utility Development Tools"
|
|
195
|
+
description: "Useful for any general development, automation, scripting, or workspace query task."
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
# Skill Instructions
|
|
199
|
+
Whenever the user requests an automation or script execution:
|
|
200
|
+
1. Analyze the prompt and use the corresponding tools in `scripts/`.
|
|
201
|
+
2. Explain the execution result at the end.
|
|
202
|
+
```
|
|
203
|
+
* **Scripts (`scripts/`)**:
|
|
204
|
+
Any executable script inserted in the `scripts/` folder will be automatically exposed as a tool that the agent can run (e.g., `gerenciar_deploy.script_name`).
|
|
205
|
+
|
|
206
|
+
### 3. Skills Registration (`skills.json`)
|
|
207
|
+
The `skills.json` file at the root of the `.agents/` folder allows inheriting skills from other shared directories or disabling default skills:
|
|
208
|
+
```json
|
|
209
|
+
{
|
|
210
|
+
"entries": [
|
|
211
|
+
{ "path": "path/to/external/skills" }
|
|
212
|
+
],
|
|
213
|
+
"exclude": [
|
|
214
|
+
"skill_name_to_ignore"
|
|
215
|
+
]
|
|
216
|
+
}
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
## Agent Personality and Instructions
|
|
222
|
+
|
|
223
|
+
The agent's personality, tone of voice, and behavioral guidelines are resolved at multiple levels of precedence:
|
|
224
|
+
|
|
225
|
+
1. **Initialization Flag (`-s` / `--system-instruction`)**:
|
|
226
|
+
Defines system instructions directly in command execution (free text or file path).
|
|
227
|
+
2. **Local and Global Rules (`AGENTS.md`)**:
|
|
228
|
+
Read from `.agents/AGENTS.md` (local) and `C:\Users\<user>\.gemini\config\AGENTS.md` (global).
|
|
229
|
+
3. **Skill Instructions (`SKILL.md`)**:
|
|
230
|
+
Merged into the chat context when the corresponding skill is activated.
|
|
231
|
+
4. **Default Personality (Fallback)**:
|
|
232
|
+
If no instruction is provided, assumes the default profile of the Google Antigravity ecosystem.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
README.md
|
|
2
|
+
pyproject.toml
|
|
3
|
+
AntGravityCLI.egg-info/PKG-INFO
|
|
4
|
+
AntGravityCLI.egg-info/SOURCES.txt
|
|
5
|
+
AntGravityCLI.egg-info/dependency_links.txt
|
|
6
|
+
AntGravityCLI.egg-info/entry_points.txt
|
|
7
|
+
AntGravityCLI.egg-info/requires.txt
|
|
8
|
+
AntGravityCLI.egg-info/top_level.txt
|
|
9
|
+
antgravity_cli/__init__.py
|
|
10
|
+
antgravity_cli/config.py
|
|
11
|
+
antgravity_cli/console_io.py
|
|
12
|
+
antgravity_cli/handlers.py
|
|
13
|
+
antgravity_cli/i18n.py
|
|
14
|
+
antgravity_cli/interfaces.py
|
|
15
|
+
antgravity_cli/list_skills.py
|
|
16
|
+
antgravity_cli/main.py
|
|
17
|
+
antgravity_cli/parser.py
|
|
18
|
+
antgravity_cli/repl.py
|
|
19
|
+
antgravity_cli/runner.py
|
|
20
|
+
antgravity_cli/utils.py
|
|
21
|
+
antgravity_cli/translate/en-us/config.json
|
|
22
|
+
antgravity_cli/translate/en-us/console_io.json
|
|
23
|
+
antgravity_cli/translate/en-us/handlers.json
|
|
24
|
+
antgravity_cli/translate/en-us/interfaces.json
|
|
25
|
+
antgravity_cli/translate/en-us/list_skills.json
|
|
26
|
+
antgravity_cli/translate/en-us/main.json
|
|
27
|
+
antgravity_cli/translate/en-us/parser.json
|
|
28
|
+
antgravity_cli/translate/en-us/repl.json
|
|
29
|
+
antgravity_cli/translate/en-us/runner.json
|
|
30
|
+
antgravity_cli/translate/en-us/test_cli.json
|
|
31
|
+
antgravity_cli/translate/pt-br/config.json
|
|
32
|
+
antgravity_cli/translate/pt-br/console_io.json
|
|
33
|
+
antgravity_cli/translate/pt-br/handlers.json
|
|
34
|
+
antgravity_cli/translate/pt-br/interfaces.json
|
|
35
|
+
antgravity_cli/translate/pt-br/list_skills.json
|
|
36
|
+
antgravity_cli/translate/pt-br/main.json
|
|
37
|
+
antgravity_cli/translate/pt-br/parser.json
|
|
38
|
+
antgravity_cli/translate/pt-br/repl.json
|
|
39
|
+
antgravity_cli/translate/pt-br/runner.json
|
|
40
|
+
antgravity_cli/translate/pt-br/test_cli.json
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
antgravity_cli
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: AntGravityCLI
|
|
3
|
+
Version: 1.0.2
|
|
4
|
+
Summary: A portable and interactive command-line interface (CLI) for the Google Antigravity ecosystem.
|
|
5
|
+
Author-email: Henrique Fazolo <henriquefazolo@gmail.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/henriquefazolo/AntGravityCLI
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Requires-Python: >=3.11
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
Requires-Dist: click>=8.4.2
|
|
15
|
+
Requires-Dist: colorama>=0.4.6
|
|
16
|
+
Requires-Dist: python-dotenv>=1.2.2
|
|
17
|
+
Requires-Dist: google-antigravity>=0.1.5
|
|
18
|
+
Requires-Dist: rich>=13.7.1
|
|
19
|
+
Requires-Dist: prompt-toolkit>=3.0.43
|
|
20
|
+
|
|
21
|
+
# AntGravity CLI
|
|
22
|
+
|
|
23
|
+
<p align="center">
|
|
24
|
+
<img src=".img/ant%20gravity.png" alt="AntGravity CLI Logo" width="400">
|
|
25
|
+
</p>
|
|
26
|
+
|
|
27
|
+
A portable and interactive command-line interface (CLI) developed in Python to flexibly interact with agents from the **Google Antigravity** ecosystem.
|
|
28
|
+
|
|
29
|
+
## Requirements
|
|
30
|
+
|
|
31
|
+
- Python 3.11.7 (as configured in the development environment).
|
|
32
|
+
- Installed dependencies (including `google-antigravity`, `click`, `colorama`, `python-dotenv`).
|
|
33
|
+
|
|
34
|
+
## Installation and Setup
|
|
35
|
+
|
|
36
|
+
1. Make sure the virtual environment is activated:
|
|
37
|
+
```powershell
|
|
38
|
+
.\.venv\Scripts\activate
|
|
39
|
+
```
|
|
40
|
+
2. Configure your environment using a `.env` file. You can copy the template from [.env.example](file:///.env.example) to get started:
|
|
41
|
+
```powershell
|
|
42
|
+
cp .env.example .env
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Environment Resolution and Default Values
|
|
46
|
+
|
|
47
|
+
The CLI resolves configuration by loading `.env` files. By default, it loads them in two stages:
|
|
48
|
+
1. **Physical CLI script installation folder**: Loads `.env` for global default configuration.
|
|
49
|
+
2. **Current Working Directory (CWD)**: Loads `.env` for workspace-specific configurations (which override the global ones).
|
|
50
|
+
|
|
51
|
+
Alternatively, you can load a custom `.env` file using the `--env-file` / `-e` option. When a custom `.env` file is specified, the default `.env` files (global and CWD) are **not** loaded automatically, giving you full control over the variables.
|
|
52
|
+
|
|
53
|
+
If a `.env` file is not present or a specific variable is not set, the CLI falls back to the following default values:
|
|
54
|
+
|
|
55
|
+
| Environment Variable | CLI Option | Description | Default Value |
|
|
56
|
+
| :--- | :--- | :--- | :--- |
|
|
57
|
+
| `GEMINI_API_KEY` | `--api-key` | Gemini API Key | *None (Required)* |
|
|
58
|
+
| `GEMINI_MODEL` | `--model` / `-m` | Gemini Model to be used | `gemini-3.1-flash-lite` |
|
|
59
|
+
| `ANTGRAVITY_LANG` | `--language` / `-l` | CLI UI Language | `en-us` |
|
|
60
|
+
| `ANTGRAVITY_YOLO` | `--yolo` / `-y` | Run in YOLO (Safe-bypass) Mode | `False` (Safe Mode) |
|
|
61
|
+
| `ANTGRAVITY_WORKSPACE` | `--workspace` / `-w` | Restricted workspace paths | *None (Current CWD)* |
|
|
62
|
+
| `ANTGRAVITY_SYSTEM_INSTRUCTION` | `--system-instruction` / `-s` | System instruction or path | *None* |
|
|
63
|
+
| `ANTGRAVITY_SKILLS_PATH` | `--skills-path` / `-k` | Custom workspace skills folders | *None* |
|
|
64
|
+
| `ANTGRAVITY_SILENT` | `--silent` | Hide thoughts and tool execution logs | `False` |
|
|
65
|
+
| `ANTGRAVITY_VERBOSE` | `--verbose` / `-v` | Show internal reasoning details | `False` |
|
|
66
|
+
|
|
67
|
+
*(You can always override these values dynamically by passing their respective flags on the command line).*
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## How to Use
|
|
73
|
+
|
|
74
|
+
### 1. Single Prompt Mode
|
|
75
|
+
To send a prompt and receive the response directly:
|
|
76
|
+
```powershell
|
|
77
|
+
python main.py "Write a greeting in Python"
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### 2. Interactive Mode (REPL)
|
|
81
|
+
To start a continuous chat with the agent (which maintains session history):
|
|
82
|
+
```powershell
|
|
83
|
+
python main.py
|
|
84
|
+
```
|
|
85
|
+
**Useful commands in Interactive Mode:**
|
|
86
|
+
- `/reset`: Clears conversation history and resets agent context.
|
|
87
|
+
- `/exit` or `/quit`: Closes the interactive terminal.
|
|
88
|
+
|
|
89
|
+
**Auto-completion and Active Skills:**
|
|
90
|
+
* **Real-time Auto-completion**: As you type `/` in the prompt (either at the start or mid-sentence), a dynamic dropdown menu displaying all special commands and active skills will instantly pop up. The auto-completion is case-insensitive, stays open stably when you delete characters (Backspace), and ignores regular chat text and trailing spaces to maintain a clean console.
|
|
91
|
+
* **Banner Skills Listing**: At REPL startup, a welcome banner displays all available active workspace skills one per line, limited to 5. If more than 5 exist, a localized ellipsis (`... and more` or `... e mais`) is appended.
|
|
92
|
+
* **Hybrid Skills Resolution**: By default (when `--skills-path` / `-k` is not specified), the welcome banner list, autocomplete menu, and prompt parser strictly load active skills from the CLI script's physical installation directory (`.agents/skills`), even when executing the CLI from or targeting a different CWD/workspace. This ensures that internal CLI utility skills (like `/gerar_skill_template` and `/gerenciar_deploy`) are always loaded and executable. If you explicitly pass one or more custom paths via the `--skills-path` / `-k` flag, the CLI dynamically loads **both** your custom/local workspace skills and the physical Ant installation skills simultaneously, giving you access to both sets of tools in the REPL session.
|
|
93
|
+
|
|
94
|
+
### 3. Safe Mode vs YOLO Mode
|
|
95
|
+
- **Safe Mode (Default)**: Whenever the agent tries to run risky terminal commands (like the `RUN_COMMAND` tool), the CLI will request your permission in the console (`[y/N]`) before proceeding.
|
|
96
|
+
- **YOLO Mode (`-y` / `--yolo`)**: Disables all safety confirmations and executes all actions autonomously.
|
|
97
|
+
```powershell
|
|
98
|
+
python main.py -y "Create a folder named test and list the directory"
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### 4. Listing Available Skills
|
|
102
|
+
You can quickly scan and list the names of all active local agent skills folders registered in `.agents/skills/` using the utility script:
|
|
103
|
+
```powershell
|
|
104
|
+
python list_skills.py
|
|
105
|
+
```
|
|
106
|
+
*(This script supports localization, reading the system language from the `ANTGRAVITY_LANG` environment variable).*
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## Available Options
|
|
111
|
+
|
|
112
|
+
You can customize the CLI behavior using flags:
|
|
113
|
+
|
|
114
|
+
| Flag | Shortcut | Env Variable | Description |
|
|
115
|
+
| :--- | :--- | :--- | :--- |
|
|
116
|
+
| `--model` | `-m` | `GEMINI_MODEL` | Specifies the Gemini model (default: `gemini-3.1-flash-lite`). |
|
|
117
|
+
| `--yolo` | `-y` | `ANTGRAVITY_YOLO` | Skips all permissions/confirmations and runs everything freely. |
|
|
118
|
+
| `--workspace` | `-w` | `ANTGRAVITY_WORKSPACE` | Restricts file tools to a specific directory (can be repeated). |
|
|
119
|
+
| `--system-instruction` | `-s` | `ANTGRAVITY_SYSTEM_INSTRUCTION` | Text with custom system instructions or path to a text file. |
|
|
120
|
+
| `--api-key` | | `GEMINI_API_KEY` | Passes the API key directly on the command line. |
|
|
121
|
+
| `--skills-path` | `-k` | `ANTGRAVITY_SKILLS_PATH` | Path to skills folders (can be repeated). If not provided and the `./skills` folder exists, it will be loaded by default. |
|
|
122
|
+
| `--silent` | | `ANTGRAVITY_SILENT` | Hides internal thoughts and tool calls in the terminal. |
|
|
123
|
+
| `--verbose` | `-v` | `ANTGRAVITY_VERBOSE` | Displays the AI's internal reasoning thoughts (Chain of Thought) in gray on the console. |
|
|
124
|
+
| `--language` | `-l` | `ANTGRAVITY_LANG` | Specifies the output translation language (default: `en-us`, e.g. `pt-br`, `en-us`). |
|
|
125
|
+
| `--env-file` | `-e` | | Path to a custom `.env` file to load configurations from (bypasses default global and local .env files). |
|
|
126
|
+
|
|
127
|
+
Advanced usage example:
|
|
128
|
+
```powershell
|
|
129
|
+
python main.py -m gemini-3.5-flash -y -s "You are a concise assistant speaking Spanish" "Hello!"
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## Localization (i18n)
|
|
135
|
+
|
|
136
|
+
The AntGravity CLI features built-in internationalization (i18n). Output messages, error states, and terminal prompts are decoupled from the core source code and stored as localized translation files inside the `translate/` directory.
|
|
137
|
+
|
|
138
|
+
### Structure of `translate/`
|
|
139
|
+
```text
|
|
140
|
+
translate/
|
|
141
|
+
├── pt-br/ # Brazilian Portuguese translations
|
|
142
|
+
│ ├── config.json
|
|
143
|
+
│ ├── console_io.json
|
|
144
|
+
│ ├── handlers.json
|
|
145
|
+
│ ├── parser.json
|
|
146
|
+
│ └── repl.json
|
|
147
|
+
└── en-us/ # English translations (Default)
|
|
148
|
+
├── config.json
|
|
149
|
+
├── console_io.json
|
|
150
|
+
├── handlers.json
|
|
151
|
+
├── parser.json
|
|
152
|
+
└── repl.json
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### Adding New Languages
|
|
156
|
+
To support a new language (e.g. `es-es` for Spanish):
|
|
157
|
+
1. Create a new directory named after the locale code inside `translate/` (e.g. `translate/es-es/`).
|
|
158
|
+
2. Copy the JSON files from `translate/en-us/` into the new folder and translate their text values.
|
|
159
|
+
3. Switch the CLI runtime language using the `--language es-es` flag.
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## Customization and Settings (`.agents`)
|
|
164
|
+
|
|
165
|
+
The `.agents` folder at the root of your project is the **Local Workspace Customization** folder. Through it, you can define rules, create new skills, and customize agent responses.
|
|
166
|
+
|
|
167
|
+
### Complete Structure of `.agents`
|
|
168
|
+
|
|
169
|
+
```text
|
|
170
|
+
my-project/
|
|
171
|
+
└── .agents/
|
|
172
|
+
├── AGENTS.md # Project rules and guidelines
|
|
173
|
+
├── skills.json # (Optional) Skills configuration and registration
|
|
174
|
+
└── skills/ # Folder containing specific skills
|
|
175
|
+
└── gerenciar_deploy/ # Example of a skill
|
|
176
|
+
├── SKILL.md # Skill instructions and triggers (Required)
|
|
177
|
+
├── scripts/ # Supporting scripts
|
|
178
|
+
├── examples/ # Usage/code examples
|
|
179
|
+
└── references/ # Reference documentation
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### 1. Project Rules (`AGENTS.md`)
|
|
183
|
+
The `.agents/AGENTS.md` file defines the general rules of behavior, style, and technical constraints that the agent must follow in this project (e.g., code pattern, language, preferred frameworks).
|
|
184
|
+
|
|
185
|
+
*There is also the global scope at `C:\Users\<user>\.gemini\config\AGENTS.md` for rules that apply to the entire machine.*
|
|
186
|
+
|
|
187
|
+
### 2. Skills (`skills/`)
|
|
188
|
+
**Skills** are packages of behavior and tools dynamically loaded depending on conversation context or user request.
|
|
189
|
+
|
|
190
|
+
* **The `SKILL.md` file (Required)**:
|
|
191
|
+
Defines YAML metadata (used by the AI for auto-activation) and the body with the skill instructions:
|
|
192
|
+
```markdown
|
|
193
|
+
---
|
|
194
|
+
name: "Utility Development Tools"
|
|
195
|
+
description: "Useful for any general development, automation, scripting, or workspace query task."
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
# Skill Instructions
|
|
199
|
+
Whenever the user requests an automation or script execution:
|
|
200
|
+
1. Analyze the prompt and use the corresponding tools in `scripts/`.
|
|
201
|
+
2. Explain the execution result at the end.
|
|
202
|
+
```
|
|
203
|
+
* **Scripts (`scripts/`)**:
|
|
204
|
+
Any executable script inserted in the `scripts/` folder will be automatically exposed as a tool that the agent can run (e.g., `gerenciar_deploy.script_name`).
|
|
205
|
+
|
|
206
|
+
### 3. Skills Registration (`skills.json`)
|
|
207
|
+
The `skills.json` file at the root of the `.agents/` folder allows inheriting skills from other shared directories or disabling default skills:
|
|
208
|
+
```json
|
|
209
|
+
{
|
|
210
|
+
"entries": [
|
|
211
|
+
{ "path": "path/to/external/skills" }
|
|
212
|
+
],
|
|
213
|
+
"exclude": [
|
|
214
|
+
"skill_name_to_ignore"
|
|
215
|
+
]
|
|
216
|
+
}
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
## Agent Personality and Instructions
|
|
222
|
+
|
|
223
|
+
The agent's personality, tone of voice, and behavioral guidelines are resolved at multiple levels of precedence:
|
|
224
|
+
|
|
225
|
+
1. **Initialization Flag (`-s` / `--system-instruction`)**:
|
|
226
|
+
Defines system instructions directly in command execution (free text or file path).
|
|
227
|
+
2. **Local and Global Rules (`AGENTS.md`)**:
|
|
228
|
+
Read from `.agents/AGENTS.md` (local) and `C:\Users\<user>\.gemini\config\AGENTS.md` (global).
|
|
229
|
+
3. **Skill Instructions (`SKILL.md`)**:
|
|
230
|
+
Merged into the chat context when the corresponding skill is activated.
|
|
231
|
+
4. **Default Personality (Fallback)**:
|
|
232
|
+
If no instruction is provided, assumes the default profile of the Google Antigravity ecosystem.
|