Docs

Put pdep to work in your repository

Install the CLI, set up your repository and your agent, and approve the work where it matters. Below are the steps, then every command and tool.

Get started

Four steps, a few minutes. The repository needs Git and at least one commit.

  1. Install pdep

    The installer checks the release's SHA-256 checksum and puts pdep in ~/.pdep/bin. Run it again to update.

    Windows (PowerShell)

    > irm https://pdep.dev/install.ps1 | iex

    macOS and Linux

    $ curl -fsSL https://pdep.dev/install.sh | sh
  2. Sign in

    Approve this machine on pdep.dev. Community is free; pdep never sees a password or a passkey.

    $ pdep login
  3. Set up the repository

    Creates .pdep/ and sets up your agent: its MCP server and the guard hook. In a folder of repositories, it sets up each one.

    $ pdep init
  4. Ask your agent

    Open the repository in your agent and ask for a change as usual. The agent starts a pdep task and asks for your approval when it needs it.

Your agents

pdep init writes the PDEP MCP server and the guard hook into each agent’s own project files. Your other settings stay as they are; run it again any time.

$ pdep init --claude --codex

Any number of agents at once. Without a flag: Claude Code. Already set up? pdep hook install adds an agent later.

Claude Code

$ pdep init --claude
MCP server
.mcp.json
Guard hook
.claude/settings.local.json
Then
Restart Claude Code and allow the pdep server once.

OpenAI Codex

Experimental
$ pdep init --codex
MCP server
.codex/config.toml
Guard hook
.codex/hooks.json
Then
Trust the project, then approve the hook with /hooks.

Cursor

Experimental
$ pdep init --cursor
MCP server
.cursor/mcp.json
Guard hook
.cursor/hooks.json
Then
Trust the workspace and turn on the pdep server in MCP settings.

Copilot (VS Code)

Experimental
$ pdep init --copilot
MCP server
.vscode/mcp.json
Guard hook
.github/hooks/pdep.json
Then
Trust the workspace; agent hooks are a VS Code preview.

Gemini CLI

$ pdep init --gemini
MCP server
.gemini/settings.json
Guard hook
.gemini/settings.json
Then
Run gemini trust in the folder and approve the hook.

Windsurf

$ pdep init --windsurf
MCP server
your Windsurf MCP settings (pdep prints the entry)
Guard hook
.devin/hooks.json
Then
Add the printed MCP entry; the hook works as is.

Experimental: the agent’s hook input is not fully documented yet. An edit pdep cannot read is allowed and logged, never silently blocked; CI still checks every pull request.

How a task runs

The agent does the work through pdep's MCP tools; you decide at the points that matter.

  1. The agent analyses

    It starts a task, describes the problem and writes the analysis: what it found in the code and what it will change.

  2. You approve the analysis

    pdep opens an approval window. Type the 6-digit code from your authenticator app or your e-mail, or send it back with a reason.

  3. You approve the plan

    The plan names the files and the steps. Only after you approve it can the agent edit code, and only inside the plan's scope: the guard hook blocks the rest.

  4. It works step by step

    At each checkpoint you continue or send the step back.

  5. You accept the delivery

    The agent verifies the change and reviews it against your conventions; you approve the review and accept the delivery. In CI, pdep ci verify checks the records on the pull request.

The ten stages in detail →

CLI reference

pdep --help and pdep <command> --help list every option. In a folder of repositories, -C <repository> runs a command for one of them.

Repository and tasks

Your agent usually starts tasks itself; these are for you.

CommandWhat it does
pdep init
Set up pdep in this repository, or in each repository of a folder, with Claude Code. Signs in to pdep.dev the first time.
pdep init --codex --cursor
Other agents, any number of them: --claude, --codex, --cursor, --copilot, --gemini, --windsurf. --no-hook skips the agents.
pdep start --title <title> --type <type> [--risk <level>]
Start a task yourself. Types: bug, feature, refactor, dependency, docs, chore, security. Risk: low, medium (the default), high, critical.
pdep status [TASK-0001]
List the tasks, or show one: its stage, plan, scope and steps.

Approvals

The approval window does these for you. In a terminal without a desktop (SSH, containers) use the commands.

CommandWhat it does
pdep approve TASK-0001
Approve what the task waits for (the analysis, the plan or the conformance review) with your code; a step checkpoint at once.
pdep reject TASK-0001 -r "<reason>"
Send the analysis or the plan back, with the reason the agent reads.
pdep reject TASK-0001 --step S1 -r "<reason>"
Send a completed step back.
pdep accept TASK-0001
Accept the delivery with your code and close the task.
pdep cancel TASK-0001 -r "<reason>"
Abandon an open task, confirmed with your code. Its records stay for audit.

What pdep knows about the code

What the agent reads before it designs a change.

CommandWhat it does
pdep profile
The project map pdep computes from the code: projects and layers, packages, type and naming families.
pdep conventions
How the repository already does things (.pdep/conventions.yaml). Every change is checked against them.
pdep code-rules
The code rules the agent follows here: your organisation's, from the console, and .pdep/code-rules.md.

Agents

pdep init does this once; the hooks are run by the agent, not by you.

CommandWhat it does
pdep hook install [--codex …]
Set up the agents again: the MCP server and the guard hook, with the same flags as pdep init.
pdep mcp
The MCP server, over stdio. The agent starts it from its MCP settings.
pdep hook check --agent <agent>
The before-edit hook: blocks edits pdep has not authorized.
pdep hook prompt --agent <agent>
The before-prompt hook: stops prompts that break your prompt rules.

Account

Anywhere, no repository needed.

CommandWhat it does
pdep login
Sign in: pdep shows a code, and you approve this machine on pdep.dev.
pdep whoami
The account this machine is signed in to.
pdep logout
Revoke this machine's sign-in on pdep.dev and forget it here.

Databases and prompt rules

PostgreSQL and SQL Server, read only. The connection string is never an argument.

CommandWhat it does
pdep db add <name> --provider postgres --agent
Add a connection (postgres or sqlserver). pdep asks for the connection string and keeps it in the OS credential store. --agent lets agents query it.
pdep db list
Your connections: name, provider, whether agents may query it. Never the connection string.
pdep db test <name>
Connect and run SELECT 1.
pdep db remove <name>
Remove a connection and its connection string.
pdep rules sync --rule "<rule>" --db <name> --query "SELECT …"
Fill a prompt rule with values from a query. Only hashes of the values leave the machine. --days 30 lets them count for 30 days.
pdep rules sync --rule "<rule>" --file values.txt
The same from a file, one value per line.
pdep rules sync
Run every saved source again, for example from a scheduled task.
pdep rules sources
The saved sources and their queries. --remove "<rule>" forgets a rule's sources.

CI

The enforcement point: a required check on the protected branch.

CommandWhat it does
pdep ci verify --base origin/main
Check that every code change in the pull request is covered by an approved, accepted plan.
pdep trust
Write pdep.dev's signing keys into .pdep/trust/cloud-keys.json, to review and commit.

Options for every command

CommandWhat it does
--json
One JSON object, {"pdepCli":1,"ok":…}, for scripts and integrations.
-C <repository>
Run the command for one repository of a folder, for example pdep -C api approve TASK-0001.
--help
The command's options.

MCP tools

The agent goes through the stages with these tools; each stage has a gate it must pass. You don't call them yourself.

Task

  • pdep_start_task
  • pdep_get_task
  • pdep_list_repositories

Problem and analysis

  • pdep_submit_problem
  • pdep_submit_analysis
  • pdep_submit_diagnosis
  • pdep_submit_solution_design
  • pdep_submit_impact_analysis
  • pdep_submit_project_baseline

Plan and approvals

  • pdep_create_plan
  • pdep_request_approval
  • pdep_wait_for_approval
  • pdep_submit_approval_code

Implementation

  • pdep_get_implementation_authorization
  • pdep_start_step
  • pdep_complete_step
  • pdep_approve_step
  • pdep_reopen_step

Verification and delivery

  • pdep_submit_verification
  • pdep_submit_security_review
  • pdep_get_structural_changes
  • pdep_submit_conformance_review
  • pdep_submit_delivery

Project knowledge and data

  • pdep_get_project_profile
  • pdep_get_conventions
  • pdep_code_rules
  • pdep_db_query

Files

Commit .pdep/ with your code, except the local state. The agent can't edit policies, conventions, code rules or pdep's state.

.pdep/tasks/<TASK-ID>/The task's documents, plan and approval records. Commit them in the same pull request as the code they cover.
.pdep/policies/default.yamlHow strict each stage is: which approvals, step checkpoints, the minimum assurance.
.pdep/conventions.yamlHow the repository already does things, with evidence. Reviews and CI check changes against it.
.pdep/code-rules.mdYour team's code rules: each ## heading starts a rule the agent follows.
.pdep/trust/cloud-keys.jsonThe signing keys CI trusts, written by pdep trust.
.pdep/state.dbLocal state, ignored by Git. Don't commit it.
~/.pdep/binThe pdep program. The installer updates it.
~/.pdep/databases.jsonYour database connections, without their connection strings.
~/.pdep/prompts/Your prompts for the approval window, masked, kept for 30 days.

In CI

Make pdep ci verify a required check on the protected branch. It reads committed files only and runs nothing from the pull request. Pin the version so a new release doesn't change the check.

Azure Pipelines

steps:
  - checkout: self
    fetchDepth: 0
  - script: |
      curl -fsSL https://pdep.dev/install.sh | PDEP_VERSION=0.17.0 sh
      echo "##vso[task.prependpath]$HOME/.pdep/bin"
    displayName: Install pdep
  - script: pdep ci verify --base origin/$(System.PullRequest.TargetBranchName) --allow-unsigned
    displayName: PDEP ci verify
    condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest'))

GitHub Actions

on:
  pull_request:
jobs:
  verify:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - run: |
          curl -fsSL https://pdep.dev/install.sh | PDEP_VERSION=0.17.0 sh
          echo "$HOME/.pdep/bin" >> "$GITHUB_PATH"
      - run: pdep ci verify --base origin/${{ github.base_ref }} --allow-unsigned

--allow-unsigned is for repositories on L0 approvals. Once approvals are signed by pdep.dev, set minApprovalAssurance in the policy and remove the flag.

Environment variables

PDEP_VERSIONInstall this version instead of the latest, for example in CI.
PDEP_APPROVAL_WINDOW=offNo approval window (SSH, containers): type the code in the agent's chat instead.
PDEP_API_URLAnother pdep server, for example your own. https only.
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1Linux without ICU: pdep runs without SQL Server support.

Stuck somewhere?

Tell us what you tried and what happened, and we will answer by e-mail.