Skip to content

Open source AI coding agent. Designed for large projects and real world tasks.

docs/readme wip

Dane Schneider19e933891382
diff --git a/README.md b/README.md
index 9445e419..f3a514d3 100644
--- a/README.md
+++ b/README.md
@@ -183,7 +183,7 @@ First, `cd` into a **project directory** where you want to get something done or
cd your-project-dir
```
-You might want to initialize a git repository if you haven't already. Plandex integrates nicely with git, though it's not required.
+For a new project, you might also want to initialize a git repo. Plandex doesn't require that your project is in a git repo, but it does integrate well with git if you use it.
```bash
git init
@@ -203,7 +203,7 @@ pdx
☁️ *If you're using Plandex Cloud, you'll be prompted at this point to start a trial.*
-Now just give a quick the REPL help text a quick read, and you're ready go.
+Then just give a quick the REPL help text a quick read, and you're ready go. The REPL starts in *chat mode* by default, which is good for fleshing out ideas before moving to implementation. Once the task is clear, Plandex will prompt you to switch to *tell mode* to make a detailed plan and start writing code.
<br/>
diff --git a/docs/docs/cli-reference.md b/docs/docs/cli-reference.md
index e55f7f76..65f5922d 100644
--- a/docs/docs/cli-reference.md
+++ b/docs/docs/cli-reference.md
@@ -31,6 +31,45 @@ For help on a specific command, use:
plandex [command] --help
```
+## REPL
+
+The easiest way to use Plandex is through the REPL. Start it in your project directory with:
+
+```bash
+plandex
+```
+
+or for short:
+
+```bash
+pdx
+```
+
+### Flags
+
+The REPL has a few convenient flags you can use to start it with different modes, autonomy settings, and model packs. You can pass any of these to `plandex` or `pdx` when starting the REPL.
+
+```
+ Mode
+ --chat, -c Start in chat mode (for conversation without making changes)
+ --tell, -t Start in tell mode (for implementation)
+
+ Autonomy
+ --no-auto None → step-by-step, no automation
+ --basic Basic → auto-continue plans, no other automation
+ --plus Plus → auto-update context, smart context, auto-commit changes
+ --semi Semi-Auto → auto-load context
+ --full Full-Auto → auto-apply, auto-exec, auto-debug
+
+ Models
+ --daily Daily driver pack (default models, balanced capability, cost, and speed)
+ --strong Strong pack (more capable models, higher cost and slower)
+ --cheap Cheap pack (less capable models, lower cost and faster)
+ --oss Open source pack (open source models)
+```
+
+All commands listed below can be run in the REPL by prefixing them with a backslash (`\`), e.g. `\new`.
+
## Plans
### new
@@ -44,6 +83,8 @@ plandex new -n new-plan # with name
`--name/-n`: Name of the new plan. The name is generated automatically after first prompt if no name is specified on creation.
+`--context-dir/-d`: Base directory to load context from when auto-loading context is enabled.
+
### plans
List plans. Output includes index, when each plan was last updated, the current branch of each plan, the number of tokens in context, and the number of tokens in the conversation (prior to summarization).
diff --git a/docs/docs/core-concepts/debugging-commands.md b/docs/docs/core-concepts/debugging-commands.md
index ddf61969..b87f8619 100644
--- a/docs/docs/core-concepts/debugging-commands.md
+++ b/docs/docs/core-concepts/debugging-commands.md
@@ -1,9 +1,9 @@
---
sidebar_position: 9
-sidebar_label: Auto-Debug Terminal Commands
+sidebar_label: Debug Terminal Commands
---
-# Auto-Debug Terminal Commands
+# Debug Terminal Commands
As of version 2.0.0, Plandex includes a powerful new `plandex debug` command that can repeatedly run any terminal command, continually making fixes based on the command's output until it succeeds.
@@ -30,14 +30,6 @@ By default, `plandex debug` will run the command up to 5 times before giving up.
plandex debug 10 'npm test'
```
-## Auto-Commit
-
-By default, `plandex debug` will not commit the changes it makes to git. If you want to automatically commit the changes after each try with an auto-generated commit message, you can use the `--commit\-c` flag:
-
-```bash
-plandex debug -c 'npm test' # will commit changes after each try
-```
-
## Commands That Succeed
If a command succeeds on the first try, `plandex debug` will exit immediately without making any model calls, so you can use it for commands that may or may not succeed on the first try.
diff --git a/docs/docs/environment-variables.md b/docs/docs/environment-variables.md
index ffbaf2f5..7d0ff698 100644
--- a/docs/docs/environment-variables.md
+++ b/docs/docs/environment-variables.md
@@ -21,8 +21,6 @@ PLANDEX_API_HOST= # Defaults to 'http://localhost:8099' if PLANDEX_ENV is develo
```bash
OPENAI_API_KEY= # Your OpenAI key (if self-hosting or using BYO API Key mode with Plandex Cloud)
OPENROUTER_API_KEY= # Your OpenRouter.ai API key (if self-hosting or using BYO API Key mode with Plandex Cloud)
-TOGETHER_API_KEY = # Your Together.ai API key (if self-hosting or using BYO API Key mode with Plandex Cloud)
-# etc.
OPENAI_API_BASE= # Your OpenAI server, such as http://localhost:1234/v1 Defaults to empty.
OPENAI_ORG_ID= # Your OpenAI organization ID. Defaults to empty.
diff --git a/docs/docs/hosting/self-hosting/_category_.json b/docs/docs/hosting/self-hosting/_category_.json
new file mode 100644
index 00000000..1d9eec8f
--- /dev/null
+++ b/docs/docs/hosting/self-hosting/_category_.json
@@ -0,0 +1,6 @@
+{
+ "label": "Self-Hosting",
+ "position": 1,
+ "collapsible": true,
+ "collapsed": false
+}
\ No newline at end of file
diff --git a/docs/docs/hosting/self-hosting.md b/docs/docs/hosting/self-hosting/advanced-self-hosting.md
similarity index 62%
rename from docs/docs/hosting/self-hosting.md
rename to docs/docs/hosting/self-hosting/advanced-self-hosting.md
index 3b4b23d4..2b4a5062 100644
--- a/docs/docs/hosting/self-hosting.md
+++ b/docs/docs/hosting/self-hosting/advanced-self-hosting.md
@@ -1,57 +1,11 @@
---
sidebar_position: 2
-sidebar_label: Self-Hosting
+sidebar_label: Advanced Self-Hosting
---
-# Self-Hosting
+# Advanced Self-Hosting
-Plandex is open source and uses a client-server architecture. The server can be self-hosted. You can either run it locally or on a cloud server that you control.
-
-## Quickstart
-
-The self-hosting quickstart requires git, docker, and docker-compose. It's designed for local use with a single user. If you instead want to run Plandex on a remote server with multiple users or orgs, continue on to the [Requirements](#requirements) section below.
-
-1. Run the server in local mode:
-
-```bash
-git clone https://github.com/plandex-ai/plandex.git
-cd plandex/app
-./start_local.sh
-```
-
-2. In a new terminal session, install the Plandex CLI if you haven't already:
-
-```bash
-curl -sL https://plandex.ai/install.sh | bash
-```
-
-3. Run:
-
-```bash
-plandex sign-in
-```
-
-4. When prompted 'Use Plandex Cloud or another host?', select 'Local mode host'. Confirm the default host, which is `http://localhost:8099`.
-
-5. If you don't have an OpenRouter account, first [sign up here.](https://openrouter.ai/signup) Then [generate an API key here.](https://openrouter.ai/keys) Set the `OPENROUTER_API_KEY` environment variable:
-
-```bash
-export OPENROUTER_API_KEY=<your-openrouter-api-key>
-```
-
-6. If you don't have an OpenAI account, first [sign up here.](https://platform.openai.com/signup) Then [generate an API key here.](https://platform.openai.com/account/api-keys) Set the `OPENAI_API_KEY` environment variable:
-
-```bash
-export OPENAI_API_KEY=<your-openai-api-key>
-```
-
-7. In a project directory, start the Plandex REPL:
-
-```bash
-plandex
-```
-
-You're ready to start building!
+The easiest way to self-host Plandex is to use the [Local Mode Quickstart](./local-mode-quickstart.md). But if you need to run Plandex on a remote server with multiple users or orgs, or you want to run it without docker/docker-compose, keep reading below.
## Requirements
@@ -61,7 +15,7 @@ The Plandex server requires a PostgreSQL database (ideally v14), a persistent fi
The Plandex server can be run in development or production mode. The main differences are how authentication pins and emails are handled, and the default path for the persistent file system.
-Development mode is designed for local usage with a single user. Email isn't enabled. Authentication pins are copied to the clipboard instead of sent via email, and a system notification will pop up to let you know that the pin is ready to paste. The pin will also be output to the console. In development mode, the default base directory is `$HOME/plandex-server`.
+Development mode is designed for local usage with a single user. Email isn't enabled and verification pins are skipped. In development mode, the default base directory is `$HOME/plandex-server`.
Production mode is designed for multiple users or organizations. Email is enabled and SMTP environment variables are required. Authentication pins are sent via email. In production mode, the default base directory is `/plandex-server`.
@@ -69,24 +23,9 @@ Development or production mode is set with the `GOENV` environment variable. It
In both development and production mode, the server runs on port 8099 by default. This can be changed with the `PORT` environment variable.
-## docker-compose
-
-For local usage in development mode, you can skip setting up PostgreSQL if you use `docker-compose` with the included `docker-compose.yml` file:
-
-```bash
-git clone https://github.com/plandex-ai/plandex.git
-cd plandex/app
-cp _env .env
-# edit .env to override any default environment variables
-docker compose build
-docker compose up
-```
-
-## Other Methods
-
-### PostgreSQL Database
+## PostgreSQL Database
-If you aren't using docker-compose, you'll need a PostgreSQL database. You can run the following SQL to create a user and database, replacing `user` and `password` with your own values:
+If you aren't using docker-compose to start the server and run the database, you'll need a PostgreSQL database. You can run the following SQL to create a user and database, replacing `user` and `password` with your own values:
```sql
CREATE USER 'user' WITH PASSWORD 'password';
@@ -114,12 +53,6 @@ You'll also need a `DATABASE_URL`:
export DATABASE_URL=postgres://user:password@host:5432/plandex # replace with your own database URL
```
-If you're running in production mode, set `API_HOST` to the host the API server is running on:
-
-```bash
-export API_HOST=api.your-domain.ai
-```
-
In production mode, you'll also need to connect to SMTP to send emails. Set the following environment variables:
```bash
@@ -136,6 +69,12 @@ In either development or production mode, the base directory for the persistent
export PLANDEX_BASE_DIR=~/some-dir/plandex-server
```
+When running the Plandex CLI, to connect to a server running in production mode, set the API_HOST environment variable to the host the server is running on:
+
+```bash
+export API_HOST=api.your-domain.ai
+```
+
### Using Docker Build
The server can be run from a Dockerfile at `app/Dockerfile.server`:
@@ -191,7 +130,7 @@ plandex sign-in # follow the prompts to create a new account on your self-hosted
## Note On Local CLI Files
-If you use the Plandex CLI and then for some reason you reset the database or use a new one, you'll need to remove the local files that the CLI creates in directories where you used Plandex in order to start fresh. Otherwise, the CLI will attempt to authenticate with an account that doesn't exist in the new database and you'll get errors. This could also happen if you use Plandex Cloud and then switch to self-hosting.
+If you use the Plandex CLI and then for some reason you reset the database or use a new one, you'll need to remove the local files that the CLI creates in directories where you used Plandex in order to start fresh. Otherwise, the CLI will attempt to authenticate with an account that doesn't exist in the new database and you'll get errors.
To resolve this, remove the following in any directory you used the CLI in:
diff --git a/docs/docs/hosting/self-hosting/local-mode-quickstart.md b/docs/docs/hosting/self-hosting/local-mode-quickstart.md
new file mode 100644
index 00000000..2daf1743
--- /dev/null
+++ b/docs/docs/hosting/self-hosting/local-mode-quickstart.md
@@ -0,0 +1,55 @@
+---
+sidebar_position: 1
+sidebar_label: Local Mode Quickstart
+---
+
+# Self-Hosting
+
+Plandex is open source and uses a client-server architecture. The server can be self-hosted. You can either run it locally or on a cloud server that you control. To run it on a cloud server, continue on to the [Advanced Self-Hosting](#advanced-self-hosting) section below. To run it locally, keep reading below.
+
+## Local Mode Quickstart
+
+The quickstart requires git, docker, and docker-compose. It's designed for local use with a single user. If you instead want to run Plandex on a remote server with multiple users or orgs, continue on to the [Requirements](#requirements) section below.
+
+1. Run the server in local mode:
+
+```bash
+git clone https://github.com/plandex-ai/plandex.git
+cd plandex/app
+./start_local.sh
+```
+
+2. In a new terminal session, install the Plandex CLI if you haven't already:
+
+```bash
+curl -sL https://plandex.ai/install.sh | bash
+```
+
+3. Run:
+
+```bash
+plandex sign-in
+```
+
+4. When prompted 'Use Plandex Cloud or another host?', select 'Local mode host'. Confirm the default host, which is `http://localhost:8099`.
+
+5. If you don't have an OpenRouter account, first [sign up here.](https://openrouter.ai/signup) Then [generate an API key here.](https://openrouter.ai/keys) Set the `OPENROUTER_API_KEY` environment variable:
+
+```bash
+export OPENROUTER_API_KEY=<your-openrouter-api-key>
+```
+
+6. If you don't have an OpenAI account, first [sign up here.](https://platform.openai.com/signup) Then [generate an API key here.](https://platform.openai.com/account/api-keys) Set the `OPENAI_API_KEY` environment variable:
+
+```bash
+export OPENAI_API_KEY=<your-openai-api-key>
+```
+
+7. In a project directory, start the Plandex REPL:
+
+```bash
+plandex
+```
+
+You're ready to start building!
+
diff --git a/docs/docs/quick-start.md b/docs/docs/quick-start.md
index 1f5ddec6..51597208 100644
--- a/docs/docs/quick-start.md
+++ b/docs/docs/quick-start.md
@@ -17,20 +17,20 @@ Note that Windows is supported via [WSL](https://learn.microsoft.com/en-us/windo
## Hosting Options
-| # | Option | Description |
-|---|---------|--------------------------------|
-| 1 | **Plandex Cloud (Integrated Models)** | No separate accounts or API keys are required. This is the quickest way to get started. If you choose this option, skip ahead to the [Create A Plan](#create-a-plan) section below. |
-| 2 | **Plandex Cloud (BYO API Key)** | You'll need accounts and API keys for [OpenRouter.ai](https://openrouter.ai) and [OpenAI](https://platform.openai.com) to get started with the default models. |
-| 3 | **Self-Hosted** | First, follow the [self-hosting guide](./hosting/self-hosting.md) to set up your own Plandex server. You'll also need accounts and API keys for [OpenRouter.ai](https://openrouter.ai) and [OpenAI](https://platform.openai.com) to get started with the default models. |
+| Option | Description |
+|---------|--------------------------------|
+| **Plandex Cloud (Integrated Models)** | • No separate accounts or API keys.<br/>• Easy multi-device usage.<br/>• Centralized billing and budgeting.<br/>• Quickest way to [get started.](https://app.plandex.ai/start?modelsMode=integrated) |
+| **Plandex Cloud (BYO API Key)** | • Use Plandex Cloud with your own [OpenRouter.ai](https://openrouter.ai) and [OpenAI](https://platform.openai.com) keys.<br/> |
+| **Self-hosted/Local Mode** | • Run Plandex locally with Docker or host on your own server.<br/>• Use your own [OpenRouter.ai](https://openrouter.ai) and [OpenAI](https://platform.openai.com) keys.<br/>• Follow the [local-mode quickstart](./hosting/self-hosting.md) to get started. |
-If you're going with option 2 or 3 above, you'll need to set the `OPENROUTER_API_KEY` and `OPENAI_API_KEY` environment variables before continuing:
+If you're going with a 'BYO API Key' option above (whether cloud or self-hosted), you'll need to set the `OPENROUTER_API_KEY` and `OPENAI_API_KEY` environment variables before continuing:
```bash
export OPENROUTER_API_KEY=...
export OPENAI_API_KEY=...
```
-## Create A Plan
+## Get Started
If you're starting on a new project, make a directory first:
@@ -44,159 +44,41 @@ Now `cd` into your **project's directory.**
cd your-project-dir
```
-For a new project, you might also want to initialize a git repo. Plandex doesn't require that your project is in a git repo, but it does integrate well with git if you use it.
+Then just give a quick the REPL help text a quick read, and you're ready go. The REPL starts in *chat mode* by default, which is good for fleshing out ideas before moving to implementation. Once the task is clear, Plandex will prompt you to switch to *tell mode* to make a detailed plan and start writing code.
```bash
-git init
+plandex
```
-Now **create your first plan** with `plandex new`.
+or for short:
```bash
-plandex new
+pdx
```
-*Note: if you're using Plandex Cloud, you'll be prompted at this point to start a trial.*
+☁️ *If you're using Plandex Cloud, you'll be prompted at this point to start a trial.*
-## Load In Context
+Then just give a quick the REPL help text a quick read, and you're ready go.
-Load any relevant files, directories, directory layouts, urls, or images **into the LLM's context** with `plandex load`. You can also pipe in the results of a command.
+## REPL Flags
-```bash
-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://raw.githubusercontent.com/plandex-ai/plandex/main/README.md # load the text content of a url
-plandex load images/mockup.png # load an image
-npm test | plandex load # pipe in the output of a command
-```
-
-## Send A Prompt
-
-Now **send your prompt.** You can pass it in as a file:
-
-```bash
-plandex tell -f prompt.txt
-```
-
-Write it in vim:
-
-```bash
-plandex tell # tell with no arguments opens vim so you can write your prompt there
-```
-
-Or pass it inline (use enter for line breaks):
+The REPL has a few convenient flags you can use to start it with different modes, autonomy settings, and model packs. You can pass any of these to `plandex` or `pdx` when starting the REPL.
-```bash
-plandex tell "add a new line chart showing the number of foobars over time to components/charts.tsx"
-```
-
-Plandex will make a plan for your task and then implement that plan in code. **The changes won't yet be applied to your project files.** Instead, they'll accumulate in Plandex's sandbox.
-
-**Note**: if you're not quite ready to give Plandex a task yet and want to ask questions or chat a bit first, you can use `plandex chat` instead of `plandex tell`. It works the same way, but it makes Plandex respond conversationally and prevents it from making any changes yet. Once you're ready, you can use `plandex tell` to go ahead with the implementation.
-
-```bash
-plandex chat "is it clear from the context how to add a new line chart?"
```
+ Mode
+ --chat, -c Start in chat mode (for conversation without making changes)
+ --tell, -t Start in tell mode (for implementation)
-## Review The Changes
-
-When Plandex has finished with your task, you can review the proposed changes with the `plandex diff` command, which shows them in `git diff` format:
-
-```bash
-plandex diff
-```
-
-Or you can view them in a local browser UI:
-
-```bash
-plandex diff --ui
-```
-
-## Iterate If Needed
-
-If the proposed changes have issues or need more work, you have a few options:
-
-### 1. Continue prompting.
-
-You can send another prompt to continue updating or refining the plan.
-
-```bash
-plandex tell "the line chart should be centered and have a width and height of 80% of the screen"
-```
-
-### 2. Rewind the plan.
-
-You can use `plandex rewind` to revert to an earlier step in the plan, load in new context or update the prompt as needed, then proceed from there with another `plandex tell` or a `plandex continue` (which continues from where the plan left off).
+ Autonomy
+ --no-auto None → step-by-step, no automation
+ --basic Basic → auto-continue plans, no other automation
+ --plus Plus → auto-update context, smart context, auto-commit changes
+ --semi Semi-Auto → auto-load context
+ --full Full-Auto → auto-apply, auto-exec, auto-debug
-Use `plandex log` for a list of all changes in a plan. You can rewind one step by running `plandex rewind` with no arguments, go back a specific number of steps (`plandex rewind 3`), or rewind to a specific change with a hash `plandex rewind e7e06e0`.
-
-Seeing the conversation history can also be helpful when rewinding, since `plandex log` doesn't include conversation messages in its output. You can do that with `plandex convo`.
-
-### 3. Reject incorrect files.
-
-While we're working hard to make file updates as reliable as possible, bad updates can still happen. If the plan's changes were applied incorrectly to a file, you can either [apply the changes](#apply-the-changes) and then fix the problems manually, *or* you can reject the updates to that file and then make the proposed changes yourself manually.
-
-To reject changes to a file (or multiple files), you can run `plandex reject` with the file path(s):
-
-```bash
-plandex reject components/charts.tsx
-```
-
-Once the bad update is rejected, copy the changes from the plan's output or run `plandex convo` to output the full conversation and copy them from there. Then apply the updates to that file yourself.
-
-## Apply The Changes
-
-Once you're happy (enough) with the plan's changes, you can apply them to your project files with `plandex apply`:
-
-```bash
-plandex apply
-```
-
-If you're in a git repository, Plandex will give you the option of grouping the changes into a git commit with an automatically generated commit message.
-
-## Auto-Debug Problems
-
-If you have a test suite, type checker, or start command that's failing after you apply the changes, you can use the `plandex debug` command to send the output to Plandex and ask it to automatically fix the problem(s).
-
-```bash
-plandex debug 'npm test'
-```
-
-This will make Plandex run the given command, send the output to the LLM, attempt a fix, apply the changes, and then run the command again to verify that the problem is fixed. By default, Plandex will try up to 5 times before giving up, but you can also specify the number of tries like this:
-
-```bash
-plandex debug 10 'npm test' # try 10 times
-```
-
----
-
-**You've now experienced the core workflow of Plandex!** While there are more commands and options available, those described above are what you'll be using most often.
-
-## CLI Help
-
-After any plandex command is run, commands that could make sense to run next will be suggested. You can learn to use Plandex quickly by jumping in and following these suggestions.
-
-You can get help on the CLI with `plandex help` and a list of all commands with `plandex help --all`. Get help on a specific command and its options with `plandex [command] --help`.
-
-## Aliases
-
-You can use the `pdx` alias instead of `plandex` to type a bit less, and most common commands have their own aliases as well.
-
-Here are the same commands we went through above using aliases to minimize typing:
-
-```bash
-pdx new
-pdx l some-file.ts another-file.ts # load
-pdx t -f prompt.txt # tell
-pdx ct "is it clear from the context how to add a new line chart?" # chat
-pdx diff
-pdx diff --ui
-pdx log
-pdx rw e7e06e0 # rewind
-pdx c # continue
-pdx rj components/charts.tsx # reject
-pdx ap # apply
-pdx db 'npm test' # debug
+ Models
+ --daily Daily driver pack (default models, balanced capability, cost, and speed)
+ --strong Strong pack (more capable models, higher cost and slower)
+ --cheap Cheap pack (less capable models, lower cost and faster)
+ --oss Open source pack (open source models)
```
\ No newline at end of file