Metadata-Version: 2.4
Name: projectcats-cli
Version: 1.0.3
Summary: ProjectCats CLI with .pcat packaging, isolated boxes, plugins, and multitasking terminal.
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: prompt-toolkit
Dynamic: license-file

Here is a ready-to-use `README.md` in English tailored to `projectcats-cli` (`pcat`), covering packaging, profiles, module inspection/merging/splitting, isolated boxes, plugins, and the multitasking terminal.

```markdown
# ProjectCats (`pcat`)

A lightweight Python CLI and multitasking terminal toolkit for packing projects into `.pcat` module archives, inspecting and splitting/merging builds, running isolated sandboxes (`pcat box`), and extending commands via plugins.

## Features

- **Project Packaging & Execution (`pack`, `unpack`, `run`, `info`)**: Pack directories or single files into split or single-chunk `.pcat` modules (`PCATIDX` / `PCATMOD` format) with `SHA-256` verification and optional execution entry points.
- **Build Profiles (`--profile`, `profiles`)**: Use predefined or custom profiles (`dev`, `release`, `data`, or custom entries in `~/.pcat/config.json`) with clear descriptions and chunk/executable settings.
- **Module Inspection & Manipulation (`inspect`, `merge`, `split`)**:
  - `pcat inspect`: View project metadata, chunk sizes, `SHA-256` checksums, and integrity status without extracting to a target folder.
  - `pcat merge`: Combine multiple `.pcat` archives into a single bundle with conflict handling (`error`, `overwrite`, `prefix`).
  - `pcat split`: Split a `.pcat` archive into multiple smaller `.pcat` modules (`--per-file` or `--parts`).
- **Isolated Boxes (`pcat box`)**: Run background or foreground workspaces (`up`, `run`, `ps`, `logs`, `attach`, `stop`, `rm`) with optional virtual environments and live console attachment.
- **Plugin System (`plugins`, `plugin init`)**: Load custom `.py` plugins from `~/.pcat/plugins`, `./plugins`, or `PCAT_PLUGINS_DIR` to register new CLI subcommands.
- **Project Cat Terminal (`pcat -o`)**: Multi-pane / tab terminal UI (`prompt_toolkit`) with `0.05s` UI refresh, built-in `EDIT`/`CMD` file editor (`edit` / `vim`), box `attach` / `detach`, and non-blocking process output streaming.

## Installation

Install from PyPI:

```bash
pip install projectcats-cli

```

Or install locally in editable mode from source:

```bash
pip install -e .

```

## Quick Start

```bash
# Check CLI version and help
pcat
pcat --help

# Create a new project from a template
pcat new my_app

# Pack a project using a build profile
pcat pack ./my_app --profile release -o ./dist/my_app.pcat

# Inspect archive metadata, chunks, and SHA-256 integrity
pcat inspect ./dist/my_app.pcat

# Run a packed project directly
pcat run ./dist/my_app.pcat

# Open the multitasking terminal
pcat -o

```

## CLI Commands Overview

| Command | Description |
| --- | --- |
| `pcat -o` | Launch Project Cat Terminal (`grid` and `tabs` layouts) |
| `pcat new <name...> [--force]` | Create one or more projects from a template (`pcat new --list`) |
| `pcat pack <path> [--profile name]` | Pack files or directories into `.pcat` modules |
| `pcat profiles` | List build profiles and their descriptions |
| `pcat inspect <file.pcat> [--json]` | Inspect chunks, sizes, and `SHA-256` checksums |
| `pcat merge <out.pcat> <parts...>` | Merge multiple `.pcat` archives into one bundle |
| `pcat split <file.pcat> [--per-file | --parts n]` | Split a `.pcat` archive into smaller `.pcat` modules |
| `pcat run <file.pcat> [-- args...]` | Execute a runnable `.pcat` archive |
| `pcat unpack <file.pcat> [-o dir]` | Verify and extract a `.pcat` archive |
| `pcat box {up|run|ps|logs|attach|stop|rm}` | Manage isolated box workspaces |
| `pcat plugins` / `pcat plugin init <name>` | List loaded plugins or scaffold a new plugin template |
| `pcat config {show|set|template|reset}` | Manage global `pcat` configuration |

## Writing Custom Plugins

Create a `.py` file in `~/.pcat/plugins/` (or generate a starter file with `pcat plugin init my_cmd`):

```python
from __future__ import annotations

import argparse

PLUGIN_VERSION = "0.1.0"
PLUGIN_DESCRIPTION = "Example plugin adding a custom 'hello' command."
ENABLED = True


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


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


def register(ctx) -> None:
    ctx.register_command(
        name="hello",
        handler=_handle_hello,
        help="Print a greeting message.",
        parser_setup=_setup_parser,
    )

```

## Terminal Shortcuts (`pcat -o`)

* `Ctrl + N`: Create a new pane or tab
* `Ctrl + D`: Close current pane (prompts to exit if only one remains)
* `Ctrl + T`: Switch between `GRID` and `TABS` layout modes
* `Ctrl + Arrow Keys`: Move focus between panes or tabs
* `Ctrl + U` / `Ctrl + J`: Scroll output up / down (`Alt + U` / `Alt + J` for faster scroll)
* `Ctrl + K`: Jump to bottom of output
* `Ctrl + V`: Paste clipboard text
* `Ctrl + Q`: Quit `pcat`

Inside the built-in editor (`edit <file>` or `vim <file>`):

* `Ctrl + I`: Toggle between `EDIT` and `CMD` mode
* In `CMD` mode: `s` (save), `sq` (save & quit), `q` (quit without saving), `py` / `python` / `runbypython` / `rbp` (run buffer with Python)

```

<ElicitationsGroup message="Next steps for your release:">
  <Elicitation label="Prepare a clean pyproject.toml" query="Create a complete pyproject.toml for projectcats-cli with metadata, description, dependencies, and the pcat entry point."/>
  <Elicitation label="Add a LICENSE file" query="Write a clean MIT LICENSE file in English for my projectcats-cli repository."/>
</ElicitationsGroup>

```
