localptp
v0.1.1
Published
LocalCode Orchestrator CLI — drives a local coding model over large codebases.
Readme
LocalPTP — LocalCode Orchestrator
A command-line orchestrator that drives a local coding model (served by LM Studio) over a large codebase. It indexes your repo, builds focused context packages, decomposes a task into ordered subtasks, and applies model-generated diffs through safety gates with approval checkpoints — then reviews and summarizes the work.
Everything runs against a model on your own machine. No code leaves your computer.
Features
- Repo indexing — scans the codebase into
.ai-orchestrator/index.jsonand a/aimemory map. - Context builder — assembles role-scoped, token-budgeted context for the model.
- Task planning — decomposes a task into ordered subtasks via the model.
- Step/run loop — model → diff → safety gates → approval → apply → tests, one subtask at a time or looped.
- Safety gates — approval prompts, risky-path confirmation, changed-file limits, binary/path-traversal refusals.
- Review — advisory review of the current Git diff (modifies nothing).
- Summarize — closes the loop by updating
/aimemory from the session.
Requirements
- Node.js ≥ 20
- LM Studio running locally with a model loaded and its OpenAI-compatible server started (default
http://localhost:1234/v1).- Default model:
qwen/qwen3.6-27b(configurable — see Configuration).
- Default model:
- Git (the orchestrator operates on a Git working tree).
Installation
Install from npm (recommended)
npm install -g localptp
localptp <command>Try it without installing
npx localptp <command>Clone and build (for contributors)
# 1. Clone
git clone https://github.com/AlmogMaayan/LocalPTP.git
cd LocalPTP
# 2. Install dependencies
npm install
# 3. Build
npm run buildRun it (contributor workflow)
During development (no build step, runs the TypeScript directly):
npm run localptp -- <command>After building, run the compiled CLI:
node dist/cli.js <command>Or install it globally so localptp is on your PATH:
npm install -g .
localptp <command>Deprecated alias: The
localcoderbinary resolves to the same CLI for one release and will be removed thereafter. Please update any scripts to uselocalptp.
Quick start
# 0. Start LM Studio, load qwen/qwen3.6-27b, and start its local server.
# 1. Scaffold /ai memory + .ai-orchestrator/config.yml (idempotent)
localptp init
# 2. Verify LM Studio is reachable and the model responds
localptp doctor
# 3. Index the repo
localptp index
# 4. Create a task
localptp task "add input validation to the signup form"
# 5. Plan it into subtasks (calls the model)
localptp plan
# 6. Execute — one subtask, or loop until a stop condition
localptp step
localptp run
# 7. Review the diff and summarize the session
localptp review
localptp summarizeCommands
| Command | Description |
|---------|-------------|
| init | Scaffold /ai memory + .ai-orchestrator/config.yml (idempotent; no source edits). |
| config [key] [value] | Show the merged config, a sub-tree, or set a dotted key (e.g. config model.model). |
| doctor | Verify LM Studio is reachable and the model responds. |
| index | Scan the repo and write .ai-orchestrator/index.json + update /ai memory map files. |
| context [--role <role>] | Preview the context package for a role (read-only; no model call). |
| task <text> | Create a scoped task + session and mark them active. |
| plan | Decompose the active task into ordered subtasks (calls the model). |
| resume [index] | List past sessions and continue from a selected one. |
| step | Run the next pending subtask: model → diff → safety gates → approval → apply → tests. |
| run | Loop the step cycle over pending subtasks with approval checkpoints until a stop condition. |
| review | Review the current Git diff with the model (advisory; modifies nothing). |
| summarize | Summarize the session and update /ai memory files. |
Global flags: --json (structured output) · --debug (verbose logging).
Configuration
localptp init writes .ai-orchestrator/config.yml. Sensible defaults apply when a field is absent. Key model settings:
model:
provider: lmstudio
base_url: http://localhost:1234/v1
model: qwen/qwen3.6-27b
api_key: lm-studio
temperature: 0.2
max_context_tokens: 32768
timeout_ms: 60000Read or change values from the CLI:
localptp config model.model # show current model
localptp config model.model qwen/qwen3.6-27b # set the model
localptp config model.baseUrl # show the LM Studio endpointSafety, context, and command settings (typecheck/lint/test/build) are also configurable — run localptp config to see the full merged tree.
Development
npm run build # compile TypeScript to dist/
npm run typecheck # type-check without emitting
npm test # run the vitest suiteLicense
MIT © 2026 Maayan Almog
