|
2 | 2 |
|
3 | 3 | Help Gemini CLI create, build, test, and run Flutter apps. |
4 | 4 |
|
5 | | -## Status: Experimental |
| 5 | +* **Status: Experimental** - This is an experimental project. Features and commands may change drastically. We welcome your feedback! |
6 | 6 |
|
7 | | -This is an experimental repository, which means the things will change |
8 | | -(sometimes drastically). Feedback very welcome! |
| 7 | +## ✨ Features |
9 | 8 |
|
10 | | -## Contribute |
| 9 | +- **🚀 Project Bootstrapping**: Create new Flutter projects from scratch with built-in best practices, including linters, documentation, and design planning. |
| 10 | +- **🔧 Guided Refactoring**: Execute complex refactoring tasks with automated planning, git branch management, and step-by-step implementation guides for your approval. |
| 11 | +- **✅ Automated Pre-Commit Checks**: Automatically format, analyze, and test your code before committing to maintain codebase quality. |
| 12 | +- **✍️ Smart Commit Messaging**: Generate descriptive, conventional commit messages based on your staged changes. |
| 13 | +- **🧠 Context Priming**: Initializes Gemini with specific rules and context for Dart and Flutter, ensuring high-quality, idiomatic code generation. |
11 | 14 |
|
12 | | -See [CONTRIBUTING.md](CONTRIBUTING.md) |
| 15 | +## 📋 Prerequisites |
13 | 16 |
|
14 | | -## Installation |
| 17 | +1. **Gemini CLI 0.4.0+** installed and configured. |
| 18 | +2. **Flutter & Dart SDK** installed on your system. |
| 19 | +3. **Git** installed and available in your PATH. |
15 | 20 |
|
16 | | -First, make sure you are using Gemini CLI 0.4.0 or greater. You can check your |
17 | | -version of Gemini CLI this way: `gemini --version`. |
| 21 | +## 🚀 Installation |
18 | 22 |
|
19 | | -Now install the extension: |
| 23 | +### 1. Install from GitHub |
20 | 24 |
|
21 | | -```shell-command |
| 25 | +Use the `gemini extensions install` command to install directly from the source repository: |
| 26 | + |
| 27 | +```bash |
22 | 28 | gemini extensions install --source https://github.com/gemini-cli-extensions/flutter.git |
23 | 29 | ``` |
24 | 30 |
|
25 | | -Once installed, run this to update it: |
| 31 | +You can manage the extension with the following commands: |
26 | 32 |
|
27 | | -```shell-command |
| 33 | +```bash |
| 34 | +# Update to the latest version |
28 | 35 | gemini extensions update flutter |
| 36 | + |
| 37 | +# Uninstall the extension |
| 38 | +gemini extensions uninstall flutter |
29 | 39 | ``` |
30 | 40 |
|
31 | | -To uninstall it: |
| 41 | +### 2. Available Commands |
32 | 42 |
|
33 | | -```shell-command |
34 | | -gemini extensions uninstall flutter |
| 43 | +The new commands will be available in new Gemini CLI sessions. The following commands will be available (with or without the `flutter:` prefix): |
| 44 | + |
| 45 | +- `/start` - Primes Gemini with the rules and context for Flutter development. |
| 46 | +- `/create-app` - Guides you through bootstrapping a new Flutter project with best practices. |
| 47 | +- `/refactor` - Manages a structured refactoring session with automated planning. |
| 48 | +- `/commit` - Automates pre-commit checks and generates a descriptive commit message. |
| 49 | + |
| 50 | +## 💡 Usage |
| 51 | + |
| 52 | +This extension provides powerful commands to automate key phases of the development lifecycle. |
| 53 | + |
| 54 | +### `/start` |
| 55 | + |
| 56 | +Initializes Gemini with the proper context for Flutter development. It summarizes the coding guidelines, documentation rules, and available tools. **Use this command at the beginning of a session.** |
| 57 | + |
| 58 | +```bash |
| 59 | +/start # Initialize context to start a session |
| 60 | +/start What were we last doing in this app? # Start a session and pick up where you left off |
35 | 61 | ``` |
36 | 62 |
|
37 | | -## Rules |
| 63 | +### `/create-app` |
38 | 64 |
|
39 | | -The [flutter.md](./flutter.md) file contains rules for writing Dart and Flutter |
40 | | -code. Some are very opinionated, so you should probably review them and make |
41 | | -sure they agree with your style. |
| 65 | +Initiates a guided process to bootstrap a new Flutter application, ensuring your project starts with a solid foundation. |
42 | 66 |
|
43 | | -The [override](./override) file contains certain important rules that are |
44 | | -appended to the end of all of Gemini's rules so that they have more weight. |
| 67 | +**Process:** |
| 68 | +1. Asks for the package's purpose, details, and desired location on your filesystem. |
| 69 | +2. Creates a new Flutter project with recommended settings and linter rules. |
| 70 | +3. Generates starter `pubspec.yaml`, `README.md`, and `CHANGELOG.md` files. |
| 71 | +4. Produces a `DESIGN.md` and `IMPLEMENTATION.md` for your review and approval before any code is written. |
45 | 72 |
|
46 | | -## Available Commands |
| 73 | +```bash |
| 74 | +/create-app I want to create a trip planning app |
| 75 | +``` |
47 | 76 |
|
48 | | -This extension adds some commands, all of which can be run with or without the |
49 | | -"flutter:" prefix (as long as there isn't a name collision with another |
50 | | -extension). |
| 77 | +### `/refactor` |
51 | 78 |
|
52 | | -### `/start` (or `/flutter:start` if you have more than one start command) |
| 79 | +Starts a structured session to refactor existing code. It helps you plan and execute changes safely and efficiently. |
53 | 80 |
|
54 | | -Initializes Gemini CLI to work on Dart and Flutter code. It will summarize the |
55 | | -coding guidelines, documentation rules, and the tools it has available for |
56 | | -Dart and Flutter |
57 | | -development. Use this command at the beginning of a session to ensure Gemini CLI |
58 | | -is primed with the correct context. |
| 81 | +**Process:** |
| 82 | +1. Asks for your high-level refactoring goals and what you want to accomplish. |
| 83 | +2. Offers to create a new `git` branch for the refactoring work, isolating changes. |
| 84 | +3. Generates a `REFACTOR.md` design document detailing the proposed changes. |
| 85 | +4. Creates a phased `REFACTOR_IMPLEMENTATION.md` plan for your review and approval. |
59 | 86 |
|
60 | | -### `/create-app` (or `/flutter:create-app` if you have more than one create-app command) |
| 87 | +```bash |
| 88 | +/refactor |
| 89 | +``` |
61 | 90 |
|
62 | | -Starts the process of creating a new Flutter app. Gemini CLI will: |
| 91 | +### `/commit` |
63 | 92 |
|
64 | | -1. Ask for the package's purpose, details, and location. |
65 | | -2. Create a new project with recommended settings, including linter rules. |
66 | | -3. Set up the initial `pubspec.yaml`, `README.md`, and `CHANGELOG.md`. |
67 | | -4. Create a detailed `DESIGN.md` and `IMPLEMENTATION.md` for your review and |
68 | | - approval before writing code. |
| 93 | +Prepares your staged `git` changes for a clean, high-quality commit. It acts as an automated pre-commit hook and message generator. |
| 94 | + |
| 95 | +**Process:** |
| 96 | +1. Runs `dart fix` and `dart format` to clean and format your code. |
| 97 | +2. Executes the Dart analyzer to check for static analysis issues. |
| 98 | +3. Runs your project's test suite to ensure all tests are passing. |
| 99 | +4. Generates a descriptive commit message based on the staged changes for you to review, edit, and approve. |
| 100 | + |
| 101 | +```bash |
| 102 | +/commit |
| 103 | +``` |
69 | 104 |
|
70 | | -This command is ideal for bootstrapping a new project with best practices from |
71 | | -the start. |
| 105 | +## ⚙️ Coding Guidelines |
72 | 106 |
|
73 | | -### `/refactor` (or `/flutter:refactor` if you have more than one refactor command) |
| 107 | +This extension enforces a specific set of coding standards to ensure consistency and quality. These rules are defined in the extension's repository: |
74 | 108 |
|
75 | | -Initiates a guided refactoring session for existing code. Gemini CLI will: |
| 109 | +- **`flutter.md`**: Contains rules and best practices for writing Dart and Flutter code. These rules are opinionated, and we encourage you to review them to ensure they align with your style. |
| 110 | +- **`override`**: Contains important, high-priority rules that are appended to the end of all prompts to ensure they have the most weight. |
76 | 111 |
|
77 | | -1. Ask for the refactoring goals and what you want to accomplish. |
78 | | -2. Offer to create a new branch for the refactoring work. |
79 | | -3. Generate a `REFACTOR.md` design document outlining the proposed changes. |
80 | | -4. Create a detailed, phased `REFACTOR_IMPLEMENTATION.md` plan for your review |
81 | | - and approval. |
| 112 | +## 🐛 Troubleshooting |
82 | 113 |
|
83 | | -This command helps structure complex refactoring tasks, ensuring they are |
84 | | -well-planned and executed. |
| 114 | +### Common Issues |
85 | 115 |
|
86 | | -### `/commit` (or `/flutter:commit` if you have more than one commit command) |
| 116 | +1. **"Command not recognized"**: Ensure the extension is installed correctly and you have restarted the Gemini CLI. Verify the installation with `gemini extensions list`. |
87 | 117 |
|
88 | | -Prepares your current changes for a git commit. Gemini CLI will: |
| 118 | +2. **"Gemini CLI version error"**: This extension requires Gemini CLI version 0.4.0 or greater. Check your version with `gemini --version` and update if necessary. |
89 | 119 |
|
90 | | -1. Run `dart fix` and `dart format` to clean up the code. |
91 | | -2. Run the analyzer to check for any issues. |
92 | | -3. Run tests to ensure everything is passing. |
93 | | -4. Generate a descriptive commit message based on the changes for you to review |
94 | | - and approve. |
| 120 | +### Filing Issues |
95 | 121 |
|
96 | | -This command helps maintain code quality and consistency in your commit history. |
| 122 | +If you have feedback, suggestions, or run into issues, please [file an issue on GitHub](https://github.com/flutter/gemini-cli-extension/issues/new/choose). |
97 | 123 |
|
98 | | -## Filing Issues |
| 124 | +## 🤝 Contributing |
99 | 125 |
|
100 | | -If you have feedback, suggestions, or run into issues using the extension, |
101 | | -please file an issue at |
102 | | -https://github.com/flutter/gemini-cli-extension/issues/new/choose |
| 126 | +Contributions are welcome! Please see our [CONTRIBUTING.md](CONTRIBUTING.md) guide for more details on how to get started. |
0 commit comments