1 Commands
Nique_372 edited this page 2026-04-25 09:04:47 -05:00

TSNDep Commands Reference

Complete documentation of all TSNDep commands.


Installation Commands

install

Download and install a repository with all its dependencies (recursively).

tsndep install <URL> <BRANCH>
tsndep install <URL> <BRANCH> --path_install /custom/path

Arguments:

  • URL (required) — Git repository URL
  • BRANCH (required) — Branch or tag name

Options:

  • --path_install (optional) — Custom installation directory (default: current directory)

Behavior:

  1. Clones the main repository
  2. Reads its dependencies.json
  3. Recursively clones nested dependencies
  4. Executes pre/post install hooks
  5. Reports success/failure for each repository

Example:

tsndep install https://github.com/trading/my-system.git main
tsndep install https://github.com/trading/my-system.git develop --path_install /home/user/

Output:

[INSTALL:my-system] Root: /path/to/install
[INSTALL:my-system] Cloning from https://github.com/trading/my-system.git
[INSTALL:core-lib] Cloning from https://github.com/trading/core-lib.git
[INSTALL:my-system] Installation completed successfully

init

Create a new dependencies.json template in the current directory.

tsndep init

Arguments: None

Options: None

Behavior:

  • Creates dependencies.json with template structure
  • Includes empty repos array
  • Pre-configured hooks section
  • Sets minimum MT5 build requirement

Example:

cd my-project
tsndep init
# Creates: my-project/dependencies.json

Template Content:

{
  "repos": [],
  "min_mt5_build": 5830,
  "other_languages": [],
  "hooks": {
    "post_install_only_on_success": true,
    "post_install": [],
    "pre_install": [],
    "pre_update": [],
    "post_update_only_on_success": true,
    "post_update": []
  }
}

Dependency Management

add

Add a new dependency to dependencies.json.

tsndep add <URL> <BRANCH> --name <NAME> [--comment <COMMENT>]

Arguments:

  • URL (required) — Git repository URL
  • BRANCH (required) — Branch or tag

Options:

  • --name (required) — Unique repository identifier
  • --comment (optional) — Description or notes

Behavior:

  1. Validates dependencies.json exists
  2. Checks repository doesn't already exist
  3. Appends new dependency
  4. Saves updated configuration

Example:

tsndep add https://github.com/org/ml-models.git main \
  --name ml-lib \
  --comment "Machine learning models"

tsndep add https://github.com/org/utils.git develop \
  --name helper-lib

Output:

[ADD:ml-lib] Added successfully
[ADD:ml-lib] URL: https://github.com/org/ml-models.git
[ADD:ml-lib] Branch: main

remove

Remove a dependency from dependencies.json.

tsndep remove <REPO_NAME>

Arguments:

  • REPO_NAME (required) — Repository identifier to remove

Options: None

Behavior:

  1. Validates dependencies.json exists
  2. Searches for repository by name
  3. Removes entry from repos array
  4. Saves updated configuration

Example:

tsndep remove old-lib
tsndep remove deprecated-module

Output:

[REMOVE:old-lib] Removed successfully

update

Pull latest changes from all repositories.

tsndep update

Arguments: None

Options: None

Behavior:

  1. Reads dependencies.json
  2. For each repository:
    • Checks out correct branch
    • Pulls latest changes
    • Recursively updates sub-dependencies
  3. Executes pre/post update hooks
  4. Reports results

Example:

tsndep update

Output:

[UPDATE:my-project] Found 3 repositories to update
[UPDATE:core-lib] Updating repository (branch: main)
[UPDATE:data-lib] Updating repository (branch: develop)
[UPDATE:my-project] Update completed successfully

Query Commands

list

Display dependency tree structure.

tsndep list [--depth DEPTH]

Arguments: None

Options:

  • --depth (optional) — Maximum recursion depth (default: 10)

Behavior:

  1. Loads current directory's dependencies.json
  2. Recursively reads sub-dependencies
  3. Builds visual tree with ASCII characters
  4. Respects depth limit

Example:

tsndep list
tsndep list --depth 3
tsndep list --depth 1

Output:

[LIST:my-project] my-project/
├── core-lib/
│   ├── logger/
│   └── config/
└── data-processor/
    └── ml-models/

check

Verify that all dependencies are properly cloned.

tsndep check

Arguments: None

Options: None

Behavior:

  1. Reads dependencies.json
  2. Checks each repository exists locally
  3. Validates Git folder structure
  4. Reports OK/FAIL for each
  5. Shows summary statistics

Example:

tsndep check

Output:

[CHECK:my-project] Starting verification
[CHECK:my-project] Verifying 5 repositories...
[CHECK:my-project] [OK] core-lib
[CHECK:my-project] [OK] logger
[CHECK:my-project] [FAIL] data-processor (not cloned)
[CHECK:my-project] [OK] ml-models
[CHECK:my-project] [OK] utils
[CHECK:my-project] Result: 4 OK, 1 FAIL
[CHECK:my-project] Verification completed

export

Export flattened dependency list with metadata.

tsndep export [--output OUTPUT]

Arguments: None

Options:

  • --output (optional) — Output filename (default: dependencies-exported.json)

Behavior:

  1. Recursively reads all dependencies
  2. Removes duplicates
  3. Creates flat list with metadata
  4. Includes export timestamp
  5. Counts total dependencies

Example:

tsndep export
tsndep export --output all-deps.json
tsndep export --output /tmp/deps.json

Output:

[EXPORT:my-project] Exporting dependencies...
[EXPORT:my-project] Exported to: all-deps.json
[EXPORT:my-project] Total dependencies: 12

Exported File Structure:

{
  "_metadata": {
    "exported_from": "my-project",
    "exported_date": "2026-04-25T15:30:00.123456"
    "total_deps": 12
  },
  "repos": [
    {
      "name": "core-lib",
      "url": "https://github.com/org/core-lib.git",
      "rama": "main",
      "comment": "Essential library"
    },
    /* ... more repos ... */
  ]
}

Global Options

--help

Show help for any command.

tsndep --help              # Show main help
tsndep install --help      # Show install command help
tsndep add --help          # Show add command help

Tips & Tricks

Run without installation

python -m Src.CLI --help
python -m Src.CLI install <url> <branch>

Dry-run (check without modifying)

tsndep check      # Safe - only reads, doesn't modify
tsndep list       # Safe - only reads, doesn't modify

Batch operations

# Install then check
tsndep install https://github.com/org/project.git main && tsndep check

# Update then export
tsndep update && tsndep export --output latest-deps.json

# Full workflow
tsndep init && \
  # [edit dependencies.json] && \
  tsndep install <url> main && \
  tsndep list && \
  tsndep check