skills/e-marchand/skills/4d-add-dependency

4d-add-dependency

SKILL.md

4D Add Dependency

Add dependencies to a 4D project by updating the appropriate configuration files.

Usage

Run the script to add a dependency:

python3 scripts/add_dependency.py <repo> [options]

Arguments

  • repo: GitHub repo (owner/repo), GitHub URL, or local path

Options

  • --name NAME: Override dependency name (default: derived from repo)
  • --tag TAG: Exact version tag (e.g., 1.0.0)
  • --version VERSION: Semantic version (e.g., latest, 1.1.0)
  • --project PATH: Path to 4D project root

Examples

# GitHub dependency with tag
python3 scripts/add_dependency.py mesopelagique/JSONRPC --tag 1.0.0

# GitHub URL (no version)
python3 scripts/add_dependency.py https://github.com/mesopelagique/SemVer

# GitHub release URL (tag extracted automatically)
python3 scripts/add_dependency.py https://github.com/mesopelagique/SemVer/releases/tag/0.2.0

# Local sibling folder
python3 scripts/add_dependency.py ../MyComponent

# Local folder with custom name
python3 scripts/add_dependency.py /path/to/component --name MyComponent

File Formats

dependencies.json

Located at Project/Sources/dependencies.json:

{
    "version": 2130,
    "dependencies": {
        "LocalComponent": {},
        "GitHubComponent": {
            "github": "owner/repo",
            "tag": "1.0.0"
        }
    }
}

environment4d.json

Required for non-sibling local dependencies. Found by walking up from project root, or created in parent directory:

{
    "dependencies": {
        "ComponentName": "file:///path/to/component.4dbase"
    }
}

Behavior

  1. GitHub repos/URLs: Add entry with github field and optional tag/version
    • Release URLs (/releases/tag/x.x.x) automatically extract the tag
  2. Local sibling folders: Add empty entry {} to dependencies.json only
  3. Local non-sibling folders: Also add file:// path to environment4d.json
Weekly Installs
6
GitHub Stars
1
First Seen
Feb 5, 2026
Installed on
opencode6
github-copilot6
codex6
amp6
kimi-cli6
gemini-cli6