puzzle-ai v0.15.0
Puzzle 🧩 - AI powered scaffolding
A flexible CLI tool for code generation and scaffolding that integrates with aider-chat to help automate common development tasks.
🤔 Why to use this tool?
Large Language Models (LLMs) are powerful tools for code generation, but they require proper context to be effective. Without clear examples and relevant files, LLMs often make incorrect assumptions, leading to extensive code rewrites.
This tool solves these challenges by providing a structured framework for creating templates for common development tasks like endpoint generation, test creation, CRUD generation, documentation, etc..
With well-designed templates, software development can become a puzzle made up of individual pieces.
📋 Prerequisites
- Node.js (v20+)
- aider-chat (
python -m pip install aider-install && aider-install
) aider installation - git
💾 Installation
npm install -g puzzle-ai
cd /your/project/path
puzzle [aider args]
#example
puzzle --model sonnet --cache-prompts
✨ Features
- Template-based Code Generation: Create and use templates for repetitive coding tasks
- JetBrains IDE Integration: Add/remove files to Aider context directly from your IDE
- Dynamic Context: Programmatically include files and conventions for Aider command
- Batch Processing: Apply AI-powered modifications to multiple files at once
🚀 Usage
Follow this guide to create your first template and start scaffolding
or check out the example project for a complete demonstration of puzzle templates and usage.
🎮 Commands and Parameters
Command | Aliases | Description | Arguments |
---|---|---|---|
puzzle | Runs scaffolding. | optional aider args, custom flags for setup.mjs | |
puzzle create-piece | Launches an interactive wizard to create a new puzzle piece template. | ||
puzzle init | Creates and initializes the configuration file without running the main application. | ||
puzzle-aider | For JetBrains IDE Integration. | optional aider args, custom flags for setup.mjs | |
puzzle-batch | Process multiple files with a single instruction. See Batch Mode. | <pattern> --msg "instruction" Example: puzzle-batch "src/**/*.js" --msg "add JSDoc comments" |
Note 1): Puzzle and Puzzle-aider commands also accept extra arguments that are passed directly to aider (see all arguments in aider --help
). For example, puzzle-aider --architect
or puzzle --model openrouter/anthropic/claude-3.5-sonnet
.
Note 2): the puzzle/common
setup will be also included automatically when you run puzzle-aider
. See Shared Configuration for details.
puzzle
command parameters
Parameter | Aliases | Description |
---|---|---|
--chat | Enables aider chat mode for interactive conversations with the LLM. | |
--history | -H | Uses command history to re-run previous actions. Shows last 10 runs and allows reusing variables. |
--no-update-check | Skips version and dependency update checks. | |
--help | -h | Shows help information. |
--version | -v | Shows the version number. |
⚙️ Configuration
Configuration file .puzzle.json
is located in root of your repository
default config looks like this:
{
"puzzleDir": "puzzle",
"aiderArgs": {
"no-auto-commit": true,
"no-auto-lint": true
}
}
aiderArgs
will be passed to aider
command, check aider --help
for more
For example you can set model like this:
{
"aiderArgs": {
"model": "openrouter/anthropic/claude-3.5-sonnet",
}
}
Or override the default config:
{
"aiderArgs": {
"no-auto-commit": null, // null values are ignored
"auto-commit": true
}
}
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
4 months ago
4 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago