Env Management logo

Env Management

OrganizationPopular
aipoch
env-management

Use when a notebook run fails on a missing package (ImportError, ModuleNotFoundError, "there is no package called"), when you need to inspect an installed package version, or when you need to install, add, or manage Python or R packages for the notebook runtime. Covers inspect_packages, routing Python vs R through manage_packages, why in-cell %pip/!pip/install.packages() and OS installers are forbidden, restarting the kernel after an install, and when to stop and ask the user.

Overview

Publisheraipoch
Repositoryopen-science
Skill nameenv-management
Stars
5.5K
Forks
512
Bundled files
Instructions only
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by aipoch on GitHub. Read the source before you install it.

Installation

Install the Env Management AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/aipoch/open-science/tree/main/resources/skills/env-management
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/aipoch/open-science.git /tmp/open-science
mkdir -p .claude/skills
cp -r /tmp/open-science/resources/skills/env-management .claude/skills/env-management
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Env Management in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Env Management on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Env Management is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Environment and package management

The notebook runs against the session's bound runtime: the app-managed default (default-python / default-r) unless you bind another one with notebook_bind_runtime — a named environment you created, or one of the user's own detected interpreters. You never activate environments by hand, and you never install packages from inside a cell. Installs happen in the trusted main process through a single tool, manage_packages, and always land in the currently bound runtime. This page is the workflow for getting a package installed and for knowing when a package is not something you can install yourself.

When a package is missing

A run that fails with ImportError / ModuleNotFoundError (Python) or Error in library(x): there is no package called 'x' (R) means the package is not in the environment yet. The fix is one manage_packages call, not a code change. Do not rewrite the cell to use a different library that "does roughly the same thing" — install the package the task actually needs. Do not fall back to reading data or computing results a worse way to dodge the missing import.

Check an installed version

Use inspect_packages(language, packages) when the user asks whether a package is installed in an app-managed runtime or which version is present, or when your code depends on a version-specific feature. It reads package metadata from the session's bound app-managed runtime without importing the package or changing the environment. An installed result does not prove the import will succeed; use notebook_execute when importability itself is the question.

Inspection does not provision a missing app-managed default runtime. If it reports DEFAULT_RUNTIME_NOT_READY, use notebook_execute in that language to prepare the runtime under notebook execution approval, then retry inspect_packages.

inspect_packages intentionally rejects a user-owned external runtime because reading its metadata executes that interpreter. Use notebook_execute for an external runtime so the user sees the normal notebook execution approval.

Do not use inspection as a mandatory preflight for every install. For a clear missing-package error, call manage_packages directly; installation is the recovery action, while inspection is for explicit version and compatibility questions.

Route by language

  • Python package → manage_packages(language="python", packages=["numpy", "pandas"]).
  • R package → manage_packages(language="r", packages=["ggplot2"]). R packages install from conda-forge as r-<name> automatically; pass the plain CRAN name (ggplot2, not r-ggplot2).
  • A PyPI-only Python package that is not on conda → add usePip=true.
  • A package that needs a specific conda channel → pass channels=["bioconda"]. Leave channels off otherwise; the app supplies the right default mirror.

manage_packages always returns a target receipt. When resolution succeeds, it identifies the implicit default or explicit binding and the actual runtime; selection:"unresolved" means no target could be established. After a failed bind or switch, inspect bindingChanged and target before deciding where a later install would run. Every install persists — there is no "temporary" install to undo later. Install once; it stays available in later cells and sessions on that runtime. To install into a different environment, bind or switch to it first (notebook_bind_runtime / notebook_switch_runtime); there is no per-call environment argument. The app-managed defaults are additive-only (bare name or name==version); for uninstalls, version ranges, or git/URL specs, create a named environment and install there.

Restart the kernel after an install when told to

manage_packages returns a compact result with ok, needsRestart, the installer method, the target receipt, verified packageChanges, and an actionable error on failure. A requested package change reports installed, updated, unchanged, or removed plus its observed before/after version when available. unchanged means only that distribution metadata in the reported target did not change; it does not prove the current Kernel can import the module. When importability or the loaded version matters, use notebook_execute to import the package and inspect its version. When needsRestart is true (always true for R, because the running kernel holds the old library state), call notebook_restart before you import or library()-load the new package, then re-run the cell. For Python, a fresh import usually sees the new package without a restart; if an earlier failed import was cached, restart and retry.

Never install any other way

These bypass the install gate and are forbidden:

  • OS package managers — apt, brew, yum — and sudo.
  • curl | bash, downloading and running installers, or hand-rolled subprocess installs.
  • In-cell installs: %pip install, !pip install, install.packages(...), remotes::install_github(...). These run inside the kernel, which has no install-network path and is sandboxed in a later phase — they do not belong in a cell.

When to stop and tell the user

Some things are not a manage_packages install:

  • A package that needs a system / OS-level dependency (a compiler, a shared C library, a CUDA/GPU toolchain) that is not present. Stop and report the limitation to the user — say what is needed and why it is out of scope here; do not try to self-install system dependencies.

When you choose to select a newly created isolated environment (to remove/downgrade a package, use richer specs, or keep a project's deps separate), await manage_environments(action:"create", language, name), check created.runnable, and use its canonical created.runtimeId. Create does not select the environment; continue only when created.runnable is true. With no existing binding for that language, pass the receipt's runtimeId to notebook_bind_runtime; with an existing binding, pass it to notebook_switch_runtime. Do not use the short environment name as runtimeId, and do not call list merely to rediscover the environment you just created. Only action:"list" returns the full environment snapshot; create and remove do not return that snapshot, and instead return receipts for the environment they created or removed. The app-managed defaults cannot be removed.

Frequently asked questions

What does the Env Management AI skill do?

Use when a notebook run fails on a missing package (ImportError, ModuleNotFoundError, "there is no package called"), when you need to inspect an installed package version, or when you need to install, add, or manage Python or R packages for the notebook runtime. Covers inspect_packages, routing Python vs R through manage_packages, why in-cell %pip/!pip/install.packages() and OS installers are forbidden, restarting the kernel after an install, and when to stop and ask the user.

Why use Env Management on TypingMind?

Because you install it once and use it with any model. Env Management is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Env Management in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/aipoch/open-science/tree/main/resources/skills/env-management. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Env Management?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Env Management?

As many as you like. As long as a model supports skills, you can use Env Management with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Env Management AI skill free?

Yes. It is published on GitHub by aipoch under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇