Metadata-Version: 2.4
Name: projectcats-cli
Version: 1.2.0
Summary: ProjectCats CLI with archive packaging, auditing, signatures, and project workspaces.
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: prompt-toolkit
Dynamic: license-file

# ProjectCats CLI (`pcat`)

ProjectCats is a Python command-line utility for packaging projects into `.pcat` archives, checking and manipulating those archives, running projects in temporary workspaces, and managing mini-servers.

## Installation

Python 3.10 or later is required. When installed with pip, the `prompt-toolkit` dependency used by the terminal interface is installed automatically.

### Install from PyPI

Windows (PowerShell):

```powershell
py -m pip install --upgrade projectcats-cli
```

Linux and macOS:

```bash
python3 -m pip install --upgrade projectcats-cli
```

If the `pcat` command is not found, make sure Python's scripts directory is on your `PATH`, or run pip through the same Python installation you intend to use.

Verify the installation:

```text
pcat
pcat --help
```

The first command prints the version; the second displays a brief command list. For detailed options, run `pcat <command> --help`, for example `pcat pack --help`.

### Install from source

From the root of a cloned repository, install the package in editable mode:

```powershell
py -m pip install -e .
```

On Linux and macOS:

```bash
python3 -m pip install -e .
```

A virtual environment is recommended to keep project dependencies separate from system packages:

```text
python -m venv .venv
```

Activate `.venv` using your shell's usual method, then run `python -m pip install -e .`.

### Linux clipboard support

`pcat` does not require a separate clipboard library. To paste with `Ctrl+V` in the terminal editor, install one system clipboard utility:

- Wayland: `wl-clipboard` (the `wl-paste` command)
- X11: `xclip` or `xsel`

The terminal still works without these utilities, but clipboard paste will be unavailable.

## Quick start

```text
pcat new my_app
pcat audit my_app
pcat pack my_app --profile release -o dist/my_app.pcat
pcat pack my_app --dry-run --exclude "*.log"
pcat snapshot create my_app
pcat inspect dist/my_app.pcat
pcat verify dist/my_app.pcat
pcat diff dist/previous.pcat dist/my_app.pcat
pcat doctor --archive dist/my_app.pcat
pcat signing-keygen
pcat sign dist/my_app.pcat
pcat verify-signature dist/my_app.pcat
pcat run dist/my_app.pcat
pcat unpack dist/my_app.pcat -o unpacked
pcat task list my_app
pcat -o
```

Running `pcat -o` without a subcommand opens the interactive Project Cat Terminal.

## Archive format and key

Pass the archive's index `.pcat` file to commands. The module files created alongside it are also required to read, verify, extract, or run the archive. Keep the index and its modules together.

The `--key` option specifies the key used to transform archive data. Use the same key when reading the archive. If omitted, `pcat` uses `default_key` from the configuration (default: `projectcats-default`). This mechanism should not be considered cryptographic protection for confidential data.

A packed directory is marked executable when a supported entry point with a conventional name (`main`, `app`, `run`, `cli`, or `server`) is found. Use `--entry` for other entry-point names. If no entry point is found, the directory is packed as a data-only archive, which cannot be launched with `pcat run`.

Supported entry points include Python (`.py`), shell (`.sh`), PowerShell (`.ps1`), Windows batch (`.bat`, `.cmd`), JavaScript (`.js`), Java (`.jar`), Ruby (`.rb`), Perl (`.pl`), PHP (`.php`), .NET (`.dll`), and native executables. The corresponding runtime must be installed. Windows `.exe` files require Wine on Linux and macOS.

## Commands

In the examples below, arguments in `<>` are required and arguments in `[]` are optional. `...` means one or more arguments.

### Short option aliases

Long options remain available. Short aliases accept values with or without `=`, for example `-ck=64`, `--chunk-kb=64`, or `--chunk-mb=1`.

| Long option | Alias | Used by |
| --- | --- | --- |
| `--output` | `-o` | `pack`, `split`, `plugin init` |
| `--key` | `-k` | Commands that accept an archive key |
| `--key-file` | `-sk` | `sign`, `verify-signature` |
| `--signature` | `-sf` | `sign`, `verify-signature` |
| `--archive-key` | `-ak` | `sign`, `verify-signature` |
| `--chunk-kb` | `-ck` | `pack`, `merge` |
| `--chunk-mb` | `-cm` | `pack`, `merge` |
| `--entry` | `-e` | `pack`, `run`, `audit` |
| `--profile` | `-pr` | `pack`, `run` |
| `--workers` | `-w` | `pack` |
| `--version` | `-v` | `pack` |
| `--note` | `-nt` | `pack` |
| `--exclude` | `-ex` | `pack`, `audit` |
| `--dry-run` | `-dr` | `pack` |
| `--incremental` | `-in` | `pack` |
| `--data-only` | `-do` | `pack` |
| `--list-profiles` | `-lp` | `pack` |
| `--include` | `-i` | `unpack` |
| `--json` | `-j` | `inspect`, `diff`, `audit` |
| `--archive` | `-a` | `doctor` |
| `--max-file-mb` | `-m` | `audit` |
| `--yes` | `-y` | Commands with a confirmation-bypass option |
| `--tail` | `-t` | `box logs`, `serv logs`, `serv follow` |
| `--force` | `-f` | `box rm` |
| `--venv` | `-ve` | `box up`, `box run` |
| `--keep` | `-kp` | `box run` |
| `--name` | `-n` | `serv start` |
| `--host` | `-ho` | `serv start` |
| `--port` | `-p` | `serv start` |
| `--fg` | `-fg` | `serv start` |
| `--unblock` | `-ub` | `serv start` |
| `--from` | `-fr` | `snapshot diff`, `snapshot restore` |
| `--preview` | `-pv` | `snapshot restore` |
| `--delete` | `-d` | `snapshot restore` |
| `--cache` | `-c` | `clean` |
| `--on-conflict` | `-oc` | `merge` |
| `--per-file` | `-pf` | `split` |
| `--parts` | `-p` | `split` |
| `--keep-files` | `-kf` | `serv rm`, `serv del` |
| `--kill-all` | `-ka` | `serv procs` |

Some aliases, such as `-p`, are scoped to a command: `serv start -p 8000` and `split -p 3` are unambiguous.

### Version, help, and terminal

| Command | Arguments and purpose |
| --- | --- |
| `pcat` | Print the installed application version. |
| `pcat -h`, `pcat --help` | Display general help. |
| `pcat -o` | Open the multi-pane Project Cat Terminal. |

### Create projects from templates

```text
pcat new <name> [name ...] [-o <directory>] [--force]
pcat new <template> <name> [name ...] [-o <directory>] [--force]
pcat new.<template> <name> [name ...] [-o <directory>] [--force]
pcat new --list
```

- `<name>` is the project name. You can provide multiple names.
- `<template>` is the name of a built-in or registered custom template.
- `-o`, `--output <directory>` sets the directory in which to create the project. The current directory is used by default.
- `--force` allows creation in an existing non-empty target directory or overwrites a same-named file created by the `script` template.
- `--list` lists built-in and custom templates and shows the current default template.

Built-in templates:

| Template | Generated project |
| --- | --- |
| `py-cli` | Python package with a CLI entry point |
| `script` | Single Python script |
| `mod` | Basic importable Python module |
| `box` | Project configured for `pcat box` |
| `serv` | Project configured for `pcat serv` |
| `fastapi` | FastAPI application with a `/health` endpoint and Uvicorn runner |
| `py-lib` | Python library using a `src` layout, with a pytest test |
| `async-worker` | `asyncio` queue worker example with graceful shutdown |
| `data` | CSV processing example with sample input data |

If no template is specified, `default_template` from the configuration is used. For example, `pcat new box demo` and `pcat new.box demo` both create a project named `demo` from the `box` template. The same forms work with the new templates, such as `pcat new fastapi web_api` or `pcat new.py-lib my_library`.

### Pack projects and use build profiles

```text
pcat pack <path> [-o <directory-or-file.pcat>] [--key <key>]
    [--chunk-kb <KB> | --chunk-mb <MB>] [--entry <path>] [--exclude <glob>]... [--dry-run]
    [--data-only] [--profile <name>]
pcat pack --list-profiles
pcat profiles
```

- `<path>` is a project file or directory.
- `-o`, `--output` sets either the output directory or the desired index `.pcat` file path. If omitted, output is written to `dist_pcat` in the current directory.
- `--key <key>` sets the archive key. The configured key is used by default.
- `--chunk-kb <KB>` sets the module chunk size in kilobytes. `0` or `-1` creates a single module. If omitted, `chunk_kb` from the configuration or the profile value is used.
- `--chunk-mb <MB>` sets the chunk size in mebibytes (`1 MB = 1024 KB`). It is mutually exclusive with `--chunk-kb`. The aliases are `-ck` and `-cm`, respectively.
- `--entry <path>` specifies the entry-point file relative to the project root.
- `--exclude <glob>` excludes matching, case-sensitive relative paths. Repeat the option to provide multiple patterns. Patterns without a slash match names at any directory level; `*` and `?` match within a path segment, while `**` can span directories. Excluding a directory also excludes its contents. For example: `pcat pack . --exclude "*.log" --exclude "build/"`.
- `--dry-run` lists the files that would be packed, their sizes, the compressed payload size, the estimated archive size, and module count. It does not write an archive.
- `--data-only` explicitly creates an archive that cannot be launched with `pcat run`.
- `--profile <name>` applies a build profile. Explicitly supplied packing options take precedence over profile values.
- `--workers <count>` sets the maximum worker threads used for reading and hashing; in incremental mode, independent per-file compression also uses workers. The default is based on the available CPU count. Parallelism is CPU-based; GPU acceleration is not used.
- `--incremental` caches per-file compression results and reuses them on later builds when file contents are unchanged. The cache is stored under `~/.pcat/pack-cache` and can contain compressed copies of project files. Use `pcat clean --cache --yes` to remove it.
- `--version <value>` and `--note <text>` store project release metadata in the archive manifest. `pcat info` displays these fields.
- `--list-profiles` and `pcat profiles` list profiles, their chunk sizes, executable settings, and descriptions.

Built-in profiles:

| Profile | Chunk size | Executable |
| --- | ---: | --- |
| `dev` | 32 KB | Yes |
| `release` | `0` (single module) | Yes |
| `data` | 64 KB | No |

Custom profiles can be defined under `build_profiles` in `~/.pcat/config.json` (on Windows, this is the `.pcat` directory in the user's home directory). A profile can contain `description`, `chunk_kb`, `executable`, `key`, `entry`, and `output` fields. For example:

```json
{
  "build_profiles": {
    "ci": {
      "description": "CI build",
      "chunk_kb": 128,
      "executable": true,
      "entry": "src/main.py"
    }
  }
}
```

Add `build_profiles` to the existing JSON configuration without removing other settings. The `pcat config set` and `pcat config reset` commands save only supported configuration fields and may remove custom profiles.

To make a project directory executable, use a conventional entry-point name or specify one with `--entry`. The `data` profile and `--data-only` disable direct execution.

### Compare archives

```text
pcat diff <left.pcat> <right.pcat> [--key <key>] [--json]
```

`diff` verifies both archives and compares their file paths, sizes, and SHA-256 checksums. The report lists files found only in the left archive, only in the right archive, and files whose contents changed. It also counts unchanged files. `--json` outputs the report as JSON. The command exits successfully when the comparison completes, even when differences are found; invalid or corrupted archives produce an error.

### Diagnose the installation

```text
pcat doctor [--archive <file.pcat>] [--key <key>]
```

`doctor` reports the Python version, installed package and CLI entry point, configuration validity, and availability of optional runtimes (Node.js, Java, Ruby, Perl, PHP, .NET, shell, PowerShell, and Wine). Missing optional runtimes are informational and do not fail the check. Use `--archive` to verify an archive's integrity as part of the diagnosis; `--key` supplies its key. The command returns a non-zero status if it finds an unsupported Python version, invalid configuration, or an invalid archive.

### Audit a project before packing

```text
pcat audit <directory> [--max-file-mb <MB>] [--exclude <glob>]...
    [--entry <path>] [--json]
```

- `audit` reports files above the size limit (100 MB by default), symbolic links, likely executable files that are not declared/conventional entry points, and heuristic credential patterns.
- It follows the packer's default ignored-directory rules and accepts the same repeatable `--exclude` patterns as `pack`. `--entry` identifies a custom expected entry point.
- `--json` returns machine-readable findings. Potential secret values are never included in the report. The scan is heuristic: review findings manually and do not treat a clean result as proof that no secret exists.
- The command is read-only. It does not remove, rewrite, or upload project files. It returns non-zero for likely secret findings or unreadable files; large-file, link, and executable findings are warnings/information.

### Sign and verify releases

```text
pcat signing-keygen [-o <key-file>]
pcat sign <archive.pcat> [--key-file <key-file>] [--signature <file>] [--archive-key <key>]
pcat verify-signature <archive.pcat> [--key-file <key-file>]
    [--signature <file>] [--archive-key <key>]
```

- `signing-keygen` creates a random 32-byte HMAC secret. By default it is written to `~/.pcat/signing.key`; an existing key is never overwritten.
- `sign` validates the archive, then writes an HMAC-SHA256 sidecar named `<archive>.pcat.sig` (for example, `app.pcat.sig`). `--signature` chooses a different sidecar path.
- `verify-signature` checks the archive index and all referenced modules against that sidecar. It returns non-zero when the signature does not match.
- `--key-file` selects the shared signing secret; both signer and verifier need the same secret file. Keep it private and distribute it separately from the archive and signature. `--archive-key` is only for reading a `.pcat` archive that uses a non-default archive key; it is not the signing secret.
- HMAC is a shared-secret signature: any holder of the secret can sign and verify. It is not a public-key signature and does not provide non-repudiation. Do not commit the key file or attach it to a public release.

### Inspect, verify, and extract archives

```text
pcat inspect <file.pcat> [--key <key>] [--json]
pcat verify <file.pcat> [--key <key>]
pcat info <file.pcat> [--key <key>]
pcat unpack <file.pcat> [-o <directory>] [--key <key>] [--include <glob>]...
```

- `inspect` is the detailed view: it lists every module and file, archive sizes, checksums, integrity statuses, and each file's raw size, compressed size, and compression ratio. `--json` outputs the same report as JSON. For legacy archives with one shared compressed stream, each file's compressed size is an estimate based on compressing that file separately; it is marked `~` in text output. Incremental per-file archives show the stored compressed size.
- `verify` checks the integrity of the modules and archive contents. It exits with a non-zero status if it finds errors.
- `info` gives a concise summary: project, version, note, creation date, file/module counts, raw and compressed payload sizes, and estimated bundle size. It does not list every file or verify module integrity; use `inspect` or `verify` for that.
- `unpack` verifies and extracts files. `-o`, `--output` sets the destination directory. By default, `<project-name>_unpacked` is created in the current directory.
- `--include <glob>` extracts only matching relative paths. Repeat it to include multiple patterns.
- `--key` specifies the archive key for all four commands; the configured key is used by default.

### Merge and split archives

```text
pcat merge <output.pcat-or-directory> <archive.pcat> <archive.pcat> [...]
    [--key <key>] [--chunk-kb <KB> | --chunk-mb <MB>] [--on-conflict error|overwrite|prefix]
pcat split <file.pcat> [-o <directory>] [--key <key>]
    [--per-file | --parts <count>]
```

`merge` requires at least two source archives.

- The first argument is either the output index `.pcat` filename or the destination directory.
- `--key` sets the key for the source archives and the output; the configured key is used by default.
- `--chunk-kb` or `--chunk-mb` sets the output chunk size; `--chunk-mb` uses 1024 KB per MB.
- `--on-conflict` controls what happens when archives contain files with the same path: `error` (default) stops with an error, `overwrite` keeps the file from the later archive, and `prefix` adds the source project name to the path.

For `split`:

- `-o`, `--output` sets the output directory. By default, `<project-name>_split` is created in the current directory.
- `--key` sets the source archive key.
- `--per-file` creates a separate archive for each file.
- `--parts <count>` sets the target number of parts. It must be a positive integer; the actual number cannot exceed the number of files.
- `--per-file` and `--parts` cannot be used together. If neither is specified, the number of parts is based on the source archive's module count (at least two, but no more than the number of files).

### Run a packed project

```text
pcat run <file.pcat> [--key <key>] [--entry <path>] [--profile <name>] [-- <program-arguments>...]
```

- `<file.pcat>` is the index file of an executable archive.
- `--key` sets the archive key.
- `--entry <path>` overrides the entry point recorded in the archive.
- `--profile <name>` selects a run profile included from the project's `pcat.json`.
- Arguments after `--` are passed to the program without being processed by `pcat`. For example: `pcat run app.pcat -- --verbose`.

A data-only archive cannot be run directly. The required interpreter or runtime must be installed separately.

### Run profiles and project tasks

Run profiles and tasks are defined in a project's `pcat.json`:

```json
{
  "run_profiles": {
    "debug": {
      "entry": "src/main.py",
      "args": ["--debug"]
    }
  },
  "tasks": {
    "test": ["python", "-m", "unittest"],
    "check": [
      ["python", "-m", "compileall", "."],
      ["python", "-m", "unittest"]
    ]
  }
}
```

- `run_profiles` are included when packing the project. Run one with `pcat run app.pcat --profile debug`; profile arguments are passed before any arguments supplied after `--`. The CLI `--entry` option overrides a profile's entry.
- `pcat task list [project]` lists configured tasks.
- `pcat task run <name> [project] [--yes]` previews and runs a task. A task may be one argument array or a sequence of argument arrays. Each command runs directly (without a shell), in the project directory; a sequence stops at the first non-zero exit code. The final command receives any additional CLI arguments only when invoked through the Python API.
- Running a task executes the commands configured in the project's `pcat.json`; review that file before accepting the confirmation.

### Local project history and archive tools

```text
pcat snapshot create <project>
pcat snapshot list <project>
pcat snapshot diff <project> --from <snapshot-id>
pcat snapshot restore <project> --from <snapshot-id> [--preview] [--delete] [--yes]
pcat compare <archive.pcat> <project-directory> [--key <key>]
pcat vault add <archive.pcat> [--key <key>]
pcat vault list
pcat vault find <query>
pcat vault remove <entry-id> [--yes]
pcat clean [directory] [--key <key>] [--yes] [--cache]
pcat duplicates <directory>
```

- Snapshots store content-addressed file copies outside the project in `~/.pcat/snapshots`. `diff` compares the current project with a snapshot. `restore` previews its changes and asks for confirmation before writing. By default, files created after the snapshot are kept; `--delete` also removes those extra files. `--preview` prints the plan without changing files, while `--yes` skips the restore prompt.
- `compare` checks the archive's file paths, sizes, and hashes against a project directory.
- The local `vault` stores a copy of the archive index and its modules under `~/.pcat/vault`. `find` searches by project name, version, or entry ID. `remove` asks before deleting an entry unless `--yes` is passed.
- `clean [directory]` checks `.pcat` files in that directory (not recursively) and lists module files not referenced by an archive index. It only deletes them when `--yes` is provided. `clean --cache` displays the incremental pack cache size and removes it only with `--yes`.
- `duplicates` reports groups of identical files by size and SHA-256; it does not delete or modify files.

### Plugins

```text
pcat plugins
pcat plugin list
pcat plugin init <name> [-o <directory>]
```

- `plugins` and `plugin list` display discovered plugins, their commands and versions, and any loading errors.
- `plugin init <name>` creates a starter Python plugin file.
- `-o`, `--output <directory>` sets the destination directory. By default, `~/.pcat/plugins` is used.

Plugins are also discovered in `./plugins` and in the directory specified by the `PCAT_PLUGINS_DIR` environment variable. Python plugin files are loaded as code, so only use plugins you trust. A plugin must register commands through a `register(ctx)` function or a `Plugin.register(ctx)` method.

Example plugin handler:

```python
import argparse

def setup(parser: argparse.ArgumentParser) -> None:
    parser.add_argument("--name", default="world")

def handle(args: argparse.Namespace) -> int:
    print(f"Hello, {args.name}!")
    return 0

def register(ctx) -> None:
    ctx.register_command(
        name="hello",
        handler=handle,
        help="Print a greeting.",
        parser_setup=setup,
    )
```

### Project workspaces (`box`)

```text
pcat box up <project-directory-or-file.pcat> [--key <key>] [--venv]
pcat box run <project-directory-or-file.pcat> [--key <key>] [--venv] [--keep] [-- arguments...]
pcat box ps
pcat box logs <id-or-name> [--tail <lines>]
pcat box stop <id-or-name>
pcat box rm <id-or-name> [--force]
```

- `up` copies the project (or extracts the `.pcat` archive) to a workspace and launches it in the background.
- `run` launches the project in the foreground. Arguments after `--` are passed to the entry point.
- `<project-directory-or-file.pcat>` is the source project directory or archive.
- `--key` sets the key if the source is a `.pcat` archive.
- `--venv` creates a virtual environment for the box and installs a non-empty `requirements.txt` (or the file specified in `pcatbox.json`).
- `--keep` for `run` saves a copy of the workspace after the process exits.
- `ps` lists boxes and their status.
- `logs` displays stdout/stderr. `--tail` sets the number of trailing lines (default: `50`).
- `stop` stops a box.
- `rm` removes a box and its workspace. A running box must be stopped first; `--force` stops it before removal.
- `up` and `run` ask before launching code. `-y`, `--yes` skips that prompt. This is only an advisory confirmation: the workspace is not an operating-system sandbox.
- On Linux and macOS, `pcat` refuses to start box or server project code when the CLI is running as root. Do not use `sudo` to launch projects.

For a project directory, `pcatbox.json` can specify `name`, `runtime`, `entry`, `workdir`, `env`, and `requirements`. Supported box runtimes are `python`/`py`, `cmd`/`shell`/`sh`, and `ps`/`powershell`/`pwsh`.

### Mini-servers and remote commands (`serv`)

```text
pcat serv start [project-directory-or-file.pcat] [--name <name>] [--host <address>]
    [--port <port>] [--key <key>] [--fg]
pcat serv connect <id-or-name>
pcat serv exec <id-or-name> <command...>
pcat serv bg <id-or-name> <command...>
pcat serv jobs <id-or-name>
pcat serv kill <id-or-name> <job_id>
pcat serv job restart <id-or-name> <job_id>
pcat serv job del <id-or-name> <job_id>
pcat serv snap <id-or-name> create [name]
pcat serv snap <id-or-name> list
pcat serv snap <id-or-name> restore <name>
pcat serv push <id-or-name> <local-file> [remote-path]
pcat serv pull <id-or-name> <remote-path> [local-file]
pcat serv ps
pcat serv logs <id-or-name> [--tail <lines>]
pcat serv follow <id-or-name> [--tail <lines>]
pcat serv stop <id-or-name>
pcat serv del <id-or-name> [-y] [--keep-files]
pcat serv rm <id-or-name> [id-or-name ...] [--keep-files]
pcat serv procs [--kill-all]
```

- `start` launches a mini-server using a project directory or `.pcat` archive as its workspace. The source is optional.
- `--name` sets the server name; `--host` sets the bind address (default: `127.0.0.1`); `--port` sets the port (default: `0`, which selects one automatically); `--key` sets the key for a source `.pcat` archive; `--fg` runs the server in the current process instead of the background.
- The mini-server's TCP RPC has no authentication or encryption. Keep the default loopback binding; do not bind it to a public or untrusted network.
- `connect` opens an interactive connection. `exec` runs a command and waits for it to finish; `bg` launches a background command and returns its `job_id`.
- `jobs` lists background jobs. `kill` stops a job but keeps its record. `job restart` restarts a job while preserving its ID; `job del` stops a running job, if needed, and removes its record.
- `snap create [name]` saves a workspace snapshot; a name is generated if omitted. `snap list` lists snapshots; `snap restore <name>` restores a snapshot to the workspace.
- `push` copies a local file into the server workspace. The optional destination defaults to the source filename. `pull` downloads a server file; if no local destination is specified, it uses the current directory and the source filename.
- `ps` lists servers. `logs` displays recent log lines (default: `50`); `follow` follows the log in real time (initial tail default: `20`).
- `stop` stops a server.
- `del` deletes one server after confirmation. `-y`, `--yes` skips confirmation; `--keep-files` leaves the server directory on disk.
- `rm` removes records for one or more servers without an interactive confirmation; `--keep-files` preserves their files.
- `procs` finds detached `pcat.serv` background processes; `--kill-all` terminates the processes it finds.
- `start` asks before launching project code. `-y`, `--yes` skips only the startup prompt. Without `--unblock`, interactive connections and operations that execute commands, restart jobs, push files, or restore snapshots ask for confirmation each time.
- `--unblock` disables those confirmations for that server and is saved with its local server record. Use it only when you trust the project and users who can access the server. It is not a security boundary and does not prevent filesystem access or process execution.
- Project code and accepted commands run with the current user's permissions. `pcat` does not install a `blocker.py` sandbox, prevent access outside the workspace, or request a sudo password. Workspace copying is not process or filesystem isolation.

You can identify a server by its full ID, a unique ID prefix, or its name.

### Configuration

```text
pcat config show
pcat config set <key> <value>
pcat config template list
pcat config template add <name> <template-path>
pcat config template remove <name>
pcat config reset
```

Configuration file: `~/.pcat/config.json`.

- `show` displays the configuration path and saved values.
- `set` accepts `default_key` (alias: `key`), `chunk_kb` (alias: `chunk`), `layout_mode` (aliases: `mode`, `layout`), and `default_template` (aliases: `template`, `tpl`).
- `layout_mode` must be `grid` or `tabs`; `chunk_kb` must be an integer.
- `template list` lists custom templates. `add` registers an existing template directory; `remove` unregisters it but does not delete the template files.
- `reset` restores the default configuration.

Defaults: `default_key=projectcats-default`, `chunk_kb=64`, `layout_mode=grid`, `default_template=py-cli`.

## Project Cat Terminal

Launch the terminal with `pcat -o`.

- `Ctrl+N` — create a pane or tab.
- `Ctrl+D` — close the current pane; if it is the last one, prompt to exit.
- `Ctrl+T` — switch between `GRID` and `TABS` layouts.
- `Ctrl` + arrow keys — move focus.
- `Ctrl+U` / `Ctrl+J` — scroll output up/down; `Alt+U` / `Alt+J` scroll faster.
- `Ctrl+K` — jump to the latest output.
- `Ctrl+V` — paste clipboard text (requires an available system clipboard utility).
- `Ctrl+Q` — quit.

In the built-in editor, open a file with `edit <file>` or `vim <file>`. `Ctrl+I` switches between `EDIT` and `CMD` modes. In `CMD` mode: `s` saves, `sq` saves and quits, `q` quits without saving, and `py` / `python` / `runbypython` / `rbp` runs the buffer with Python.
