Plandex is an open-source tool that you can operate directly from your terminal. Thanks to its intelligent agents running in the background, it can handle complex tasks that span multiple files and require numerous steps.
The concept is simple: you assign a task to Plandex, and it breaks it down into smaller, more manageable subtasks, which it then completes one by one until the job is done. It’s even better than having an intern!
Plandex helps you move faster through your backlog, get unstuck when you’re struggling with a technology, and spend less time on boring tasks—all without risk. Any changes are first applied in a protected sandbox, which you can review before integrating them into your project. With its version control system, you can easily roll back changes or test different approaches in parallel.
Another strength of Plandex is its context management. You can quickly add files or entire folders to the AI’s context, and they will be automatically updated as you work. This ensures that the AI always has access to the most recent state of your project for optimal results.
Plandex is compatible with the main operating systems on the market (Mac, Linux, Windows…) and launches directly from a standalone executable, with no dependencies. You just need to install it, provide your OpenAI API key, and you’re good to go!
However, keep in mind that Plandex won’t code your project from start to finish for you. Think of it as an assistant that helps you with the heavy lifting and saves you valuable time, but you’ll still need to keep an eye on what it does. Automatic file updates may sometimes require a bit of manual polishing.
Overall, the results are quite satisfying, especially when you take the time to clearly formulate your instructions and select the right files to include in the context. If you throw your entire project at it without organization, the AI might struggle to produce clean code. But when used wisely, it can quickly become your best friend.
Moreover, the developers behind the project are full of ideas to improve their creation. Support for open-source models, integration with other AI providers like Google or Anthropic, community plugins—the ongoing projects are plentiful, and that’s great!
Take a look at the project’s GitHub repo—there’s plenty of fun to be had!
How to use Plandex
Installation
To install Plandex, run the following command in your terminal:
curl -sL https://plandex.ai/install.sh | bash
Note that Windows is supported via WSL. Plandex only works correctly on Windows in the WSL shell, not in the Windows CMD prompt or PowerShell.
Setup
- Set your OpenAI API key:
export OPENAI_API_KEY=your_api_key_here
- Create a new project directory:
mkdir your-project-dir
cd your-project-dir
- Initialize a git repository (optional but recommended):
git init
Creating a Plan
To create your first plan, use the plandex new
command:
plandex new
Loading Context
Load relevant files, directories, or other content into the LLM’s context using plandex load
:
plandex load some-file.ts another-file.ts
plandex load src/components -r # load a whole directory
plandex load src --tree # load a directory layout (file names only)
plandex load src/**/*.ts # load files matching a glob pattern
plandex load https://example.com/file.txt # load content from a URL
plandex load images/mockup.png # load an image
You can also pipe in the output of a command:
npm test | plandex load
Sending Prompts
Send prompts to Plandex using the plandex tell
command:
plandex tell -f prompt.txt # from a file
plandex tell # opens vim for writing the prompt
plandex tell "add a new line chart to components/charts.tsx" # inline prompt
Reviewing Changes
Review proposed changes before applying them:
plandex diff # shows changes in git diff format
plandex changes # opens Plandex's changes TUI
Applying Changes
Once you’re satisfied with the changes, apply them to your project files:
plandex apply
If you’re in a git repository, Plandex will offer to group the changes into a commit with an automatically generated commit message.
Additional Features
- Version Control: Plandex integrates with git, allowing you to revert changes, experiment with branches, and use the
plandex rewind
command to back up and iterate on prompts. - Sandbox Environment: Changes accumulate in a protected sandbox, preventing accidental edits to your project files.
- Multiple Model Support: While Plandex uses OpenAI by default, it can work with other models like Claude, Gemini, and open-source options.
- Collaborative Features: Plandex is designed with future sharing and collaboration features in mind.
By following these steps and utilizing Plandex’s features, you can efficiently tackle complex coding tasks, refactor code, and manage large-scale projects with the assistance of AI.