# Dependency Mapper CLI
DepMap CLI is a command-line interface tool for managing and analyzing software dependencies across repositories. It provides functionality for cloning repositories, managing actions, and running analyses.
## Table of Contents
1. [Installation](#installation)
2. [Configuration](#configuration)
3. [Initial Setup](#initial-setup)
4. [Usage](#usage)
- [Authentication](#authentication)
- [Clone Commands](#clone-commands)
- [Action Commands](#action-commands)
- [Analysis Commands](#analysis-commands)
6. [Error Handling](#error-handling)
7. [Security Considerations](#security-considerations)
8. [Troubleshooting](#troubleshooting)
## Installation
1. Ensure you have Python 3.9+ installed on your system.
2. Download the CLI zip file from:
```
https://github.com/trilogy-group/central-product-tpm/edit/master/POC/cc/repo/depmap/cli/depmap.zip
```
3. Extract the contents of the zip file to a directory of your choice.
4. Navigate to the extracted directory:
```
cd path/to/extracted/directory
```
5. Create a virtual environment:
```
python -m venv venv
```
6. Activate the virtual environment:
- On Windows:
```
venv\Scripts\activate
```
- On macOS and Linux:
```
source venv/bin/activate
```
7. Install the required dependencies:
```
pip install -r requirements.txt
```
## Configuration
Add your API authentication token to the `.env` file:
```
AUTH_TOKEN=your_auth_token_here
```
## Initial Setup
Before using the CLI for analysis, you must set up the necessary actions:
1. Store the dependency action:
```
python cli.py action store dep -f actions/dep.json
```
This command loads the action details from the `dep.json` file in the `actions` folder.
2. Activate the dependency action:
```
python cli.py action update dep -a True
```
This sets the 'active' attribute of the 'dep' action to True.
## Usage
The general syntax for using the DepMap CLI is:
```
python cli.py <command> <subcommand> [options]
```
### Authentication
The CLI uses an authentication token stored in the `.env` file. Ensure this file is present and contains a valid `AUTH_TOKEN` before running any commands.
### Clone Commands
Before running an analysis, you must first clone the target repository:
- Clone and upload a single repository:
```
python cli.py clone -l <label> -u <url>
```
- Clone and upload multiple repositories under a single label:
```
python cli.py clone -l <label> -f <file>
```
The file should contain one repository URL per line, for example:
```
https://github.com/trilogy-group/influitive-advocatehub-Influitive-Advocate
https://github.com/trilogy-group/influitive-advocatehub-influitive
...
```
The CLI will clone all repositories listed in the file and upload them together.
Examples:
1. Clone a single repo:
```
python cli.py clone -l worksmart -u https://github.com/trilogy-group/worksmart-ts
```
2. Clone multiple repos at once:
```
python cli.py clone -l influitive -f influitive.txt
```
This will clone both repositories and group them under the 'influitive' label.
After cloning, you can analyze all the repositories under this label together using the analysis commands.
### Action Commands
Next, you must make sure that you have at least one action defined. Actions are prompts + scaffolding that are run against the files. For the time being - only one action is defined. You will find it in the 'actions' sub folder.
- List all actions:
```
python cli.py action list [-n] [-s]
```
- Get a specific action:
```
python cli.py action get <action> [-q <query>]
```
- Store a new action:
```
python cli.py action store <action> <prompt> <include> <schema> [-a] [-f <file>]
```
- Update an action:
```
python cli.py action update <action> [-p <prompt>] [-i <include>] [-s <schema>] [-a <active>]
```
- Delete an action:
```
python cli.py action delete <action>
```
- Delete all actions:
```
python cli.py action delete_all
```
- Add actions from a directory:
```
python cli.py action add_all [-d <directory>]
```
### Analysis Commands
#### start
Starts a new analysis for the specified label using the given model.
- `-l, --label`: Required. Label for the analysis.
- `-m, --model`: Model to use for analysis (default: "haiku").
- `-p, --poll`: Optional. Poll until the analysis is complete.
#### status
Retrieves the status of an ongoing or completed analysis.
- `-l, --label`: Required. Label of the analysis to check.
#### get
Retrieves the results of a completed analysis.
- `-l, --label`: Required. Label of the analysis.
- `-d, --details`: Optional. Include detailed results.
- `-c, --combine`: Optional. Combine all dependencies into a single list.
- `-f, --file`: Optional. Specific file to retrieve results for.
- `-a, --action`: Optional. Specific action to retrieve results for.
#### delete
Deletes the results of an analysis.
- `-l, --label`: Required. Label of the analysis to delete.
- `-a, --action`: Optional. Specific action to delete results for.
## Error Handling
The CLI provides detailed error messages for various scenarios:
- HTTP errors (e.g., 401 Unauthorized)
- Network connectivity issues
- Invalid input parameters
- File I/O errors
If you encounter an error, the CLI will display a message describing the issue.
## Security Considerations
- The authentication token is stored in a `.env` file, which should be kept secure and not shared or committed to version control.
- All API requests are made over HTTPS, ensuring that data (including headers) is encrypted in transit.
- Avoid logging or displaying the authentication token in any output.
## Troubleshooting
1. **Authentication Issues**: Ensure your `AUTH_TOKEN` in the `.env` file is correct and up to date.
2. **Network Problems**: Check your internet connection and verify that you can reach the API endpoint.
3. **Invalid Commands**: Double-check the command syntax and required parameters.
4. **File Permissions**: Ensure you have the necessary permissions to read/write files in the working directory.
Raw data
{
"_id": null,
"home_page": "https://github.com/trilogy-group/central-product-tpm/tree/master/POC/cc/repo/depmap/cli",
"name": "dpmap",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": null,
"author": "David Schwartz",
"author_email": "david.schwartz@devfactory.com",
"download_url": "https://files.pythonhosted.org/packages/dd/4b/cdaf5a505d0f757becb97aaba30519b02153db1741bf389164c932ac5599/dpmap-0.0.4.tar.gz",
"platform": null,
"description": "# Dependency Mapper CLI\n\nDepMap CLI is a command-line interface tool for managing and analyzing software dependencies across repositories. It provides functionality for cloning repositories, managing actions, and running analyses.\n\n## Table of Contents\n\n1. [Installation](#installation)\n2. [Configuration](#configuration)\n3. [Initial Setup](#initial-setup)\n4. [Usage](#usage)\n - [Authentication](#authentication)\n - [Clone Commands](#clone-commands)\n - [Action Commands](#action-commands)\n - [Analysis Commands](#analysis-commands)\n6. [Error Handling](#error-handling)\n7. [Security Considerations](#security-considerations)\n8. [Troubleshooting](#troubleshooting)\n\n## Installation\n\n1. Ensure you have Python 3.9+ installed on your system.\n2. Download the CLI zip file from:\n ```\n https://github.com/trilogy-group/central-product-tpm/edit/master/POC/cc/repo/depmap/cli/depmap.zip\n ```\n3. Extract the contents of the zip file to a directory of your choice.\n4. Navigate to the extracted directory:\n ```\n cd path/to/extracted/directory\n ```\n5. Create a virtual environment:\n ```\n python -m venv venv\n ```\n6. Activate the virtual environment:\n - On Windows:\n ```\n venv\\Scripts\\activate\n ```\n - On macOS and Linux:\n ```\n source venv/bin/activate\n ```\n7. Install the required dependencies:\n ```\n pip install -r requirements.txt\n ```\n\n## Configuration\n\nAdd your API authentication token to the `.env` file:\n ```\n AUTH_TOKEN=your_auth_token_here\n ```\n\n## Initial Setup\n\nBefore using the CLI for analysis, you must set up the necessary actions:\n\n1. Store the dependency action:\n ```\n python cli.py action store dep -f actions/dep.json\n ```\n This command loads the action details from the `dep.json` file in the `actions` folder.\n\n2. Activate the dependency action:\n ```\n python cli.py action update dep -a True\n ```\n This sets the 'active' attribute of the 'dep' action to True.\n\n## Usage\n\nThe general syntax for using the DepMap CLI is:\n\n```\npython cli.py <command> <subcommand> [options]\n```\n\n### Authentication\n\nThe CLI uses an authentication token stored in the `.env` file. Ensure this file is present and contains a valid `AUTH_TOKEN` before running any commands.\n\n### Clone Commands\n\nBefore running an analysis, you must first clone the target repository:\n\n- Clone and upload a single repository:\n ```\n python cli.py clone -l <label> -u <url>\n ```\n\n- Clone and upload multiple repositories under a single label:\n ```\n python cli.py clone -l <label> -f <file>\n ```\n \n The file should contain one repository URL per line, for example:\n ```\n https://github.com/trilogy-group/influitive-advocatehub-Influitive-Advocate\n https://github.com/trilogy-group/influitive-advocatehub-influitive\n ...\n ```\n\n The CLI will clone all repositories listed in the file and upload them together.\n\nExamples:\n1. Clone a single repo:\n```\n python cli.py clone -l worksmart -u https://github.com/trilogy-group/worksmart-ts\n ```\n2. Clone multiple repos at once:\n ```\n python cli.py clone -l influitive -f influitive.txt\n ```\n This will clone both repositories and group them under the 'influitive' label.\n\nAfter cloning, you can analyze all the repositories under this label together using the analysis commands.\n\n### Action Commands\n\nNext, you must make sure that you have at least one action defined. Actions are prompts + scaffolding that are run against the files. For the time being - only one action is defined. You will find it in the 'actions' sub folder.\n\n- List all actions:\n ```\n python cli.py action list [-n] [-s]\n ```\n\n- Get a specific action:\n ```\n python cli.py action get <action> [-q <query>]\n ```\n\n- Store a new action:\n ```\n python cli.py action store <action> <prompt> <include> <schema> [-a] [-f <file>]\n ```\n\n- Update an action:\n ```\n python cli.py action update <action> [-p <prompt>] [-i <include>] [-s <schema>] [-a <active>]\n ```\n\n- Delete an action:\n ```\n python cli.py action delete <action>\n ```\n\n- Delete all actions:\n ```\n python cli.py action delete_all\n ```\n\n- Add actions from a directory:\n ```\n python cli.py action add_all [-d <directory>]\n ```\n### Analysis Commands\n\n#### start\nStarts a new analysis for the specified label using the given model.\n- `-l, --label`: Required. Label for the analysis.\n- `-m, --model`: Model to use for analysis (default: \"haiku\").\n- `-p, --poll`: Optional. Poll until the analysis is complete.\n\n#### status\nRetrieves the status of an ongoing or completed analysis.\n- `-l, --label`: Required. Label of the analysis to check.\n\n#### get\nRetrieves the results of a completed analysis.\n- `-l, --label`: Required. Label of the analysis.\n- `-d, --details`: Optional. Include detailed results.\n- `-c, --combine`: Optional. Combine all dependencies into a single list.\n- `-f, --file`: Optional. Specific file to retrieve results for.\n- `-a, --action`: Optional. Specific action to retrieve results for.\n\n#### delete\nDeletes the results of an analysis.\n- `-l, --label`: Required. Label of the analysis to delete.\n- `-a, --action`: Optional. Specific action to delete results for.\n\n## Error Handling\n\nThe CLI provides detailed error messages for various scenarios:\n- HTTP errors (e.g., 401 Unauthorized)\n- Network connectivity issues\n- Invalid input parameters\n- File I/O errors\n\nIf you encounter an error, the CLI will display a message describing the issue.\n\n## Security Considerations\n\n- The authentication token is stored in a `.env` file, which should be kept secure and not shared or committed to version control.\n- All API requests are made over HTTPS, ensuring that data (including headers) is encrypted in transit.\n- Avoid logging or displaying the authentication token in any output.\n\n## Troubleshooting\n\n1. **Authentication Issues**: Ensure your `AUTH_TOKEN` in the `.env` file is correct and up to date.\n2. **Network Problems**: Check your internet connection and verify that you can reach the API endpoint.\n3. **Invalid Commands**: Double-check the command syntax and required parameters.\n4. **File Permissions**: Ensure you have the necessary permissions to read/write files in the working directory.\n\n",
"bugtrack_url": null,
"license": null,
"summary": "Dependency Mapper CLI for managing and analyzing software dependencies across repositories.",
"version": "0.0.4",
"project_urls": {
"Homepage": "https://github.com/trilogy-group/central-product-tpm/tree/master/POC/cc/repo/depmap/cli"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "94aa1f8fc0325e31498539cd700fe643f8828b5355f216aa724b8583a29f9096",
"md5": "803a341e771eaa0e9e86b0da9225aa0c",
"sha256": "8a454ad94a00960819609ab386634125f53c25d4e8edd1526799ca8d2ed78acd"
},
"downloads": -1,
"filename": "dpmap-0.0.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "803a341e771eaa0e9e86b0da9225aa0c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 12140,
"upload_time": "2024-07-26T11:24:12",
"upload_time_iso_8601": "2024-07-26T11:24:12.486367Z",
"url": "https://files.pythonhosted.org/packages/94/aa/1f8fc0325e31498539cd700fe643f8828b5355f216aa724b8583a29f9096/dpmap-0.0.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "dd4bcdaf5a505d0f757becb97aaba30519b02153db1741bf389164c932ac5599",
"md5": "c1d1bab49f971e940ba98e5d68e80768",
"sha256": "3bc4d87c44719c0b6b24c26681f398e7f297fcffc6331913b75f709b4d371cf0"
},
"downloads": -1,
"filename": "dpmap-0.0.4.tar.gz",
"has_sig": false,
"md5_digest": "c1d1bab49f971e940ba98e5d68e80768",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 12561,
"upload_time": "2024-07-26T11:24:13",
"upload_time_iso_8601": "2024-07-26T11:24:13.920637Z",
"url": "https://files.pythonhosted.org/packages/dd/4b/cdaf5a505d0f757becb97aaba30519b02153db1741bf389164c932ac5599/dpmap-0.0.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-26 11:24:13",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "trilogy-group",
"github_project": "central-product-tpm",
"github_not_found": true,
"lcname": "dpmap"
}