Declarative ecosystem and framework definitions for Prison.
Prison's prison ecosystem init command reads the TOML files in ecosystems/
to detect a project's language, package managers, and frameworks. It will then
propose matching [box], [setup], [checkpoint], and [egress] settings for
the project's prison.toml.
# Pull the catalog into `~/.prison/ecosystems`
prison ecosystem update https://github.com/gjazali/prison-ecosystems.git
# Or pull from a local checkout
git clone https://github.com/gjazali/prison-ecosystems.git
prison ecosystem update prison-ecosystems
# Detect ecosystems in a project and propose prison.toml edits
cd ~/my-project
prison ecosystem initYou can also set PRISON_ECOSYSTEMS=/path/to/prison-ecosystems to read a local
checkout directly without having to copy ecosystems/*.toml into the host's
~/.prison/ecosystems/.
Create a .toml file under ecosystems/. Something like:
name = "pnpm"
description = "JavaScript/TypeScript (pnpm)"
group = "javascript-pkg" # (Optional)
priority = 30 # A higher number will win within the same group
[detect]
files = ["pnpm-lock.yaml"] # This will match if any file or glob exists in the project root
all_files = [] # (Optional)
# Match a regular expression against a project file (optional)
# [[detect.match]]
# file = "package.json"
# pattern = '"next"\s*:'
[box]
shadow = ["node_modules"] # Directories that will be shadowed from the host worktree
[setup]
commands = ["pnpm install --frozen-lockfile"]
[checkpoint]
ignore = [".pnpm-store/"] # Extra files and directories that the checkpoint will ignore
[egress]
hosts = [
"registry.npmjs.org",
"*.npmjs.org",
]
docs = [
"pnpm.io",
"nodejs.org",
"developer.mozilla.org",
]- Package managers for the same language should share a
group(such asjavascript-pkgorpython-pkg) withpriorityreflecting specificity (lockfiles higher than generic manifests). - Frameworks and tools (such as
nextjs,vite,pytest,ruff) should omitgroupso that they compose on top of the detected package manager. - It is recommended to keep
egress.hostsminimal. You should list only the registries or download hosts the ecosystem will actually need. - Additionally, you should keep
egress.docslimited to official, first-party documentation domains (avoid shared-hosting wildcards like*.readthedocs.ioor*.github.io). Theprison ecosystem initcommand will propose aprison.tomlwithegress.docsadded by default unless--no-docsis specified.