{"id":16945250,"url":"https://github.com/offgriddev/forecast-cli","last_synced_at":"2025-03-21T08:44:05.610Z","repository":{"id":205713912,"uuid":"714885628","full_name":"offgriddev/forecast-cli","owner":"offgriddev","description":"A tool for automated estimations based on delivery of Cyclomatic Complexity, not mythical story points.","archived":false,"fork":false,"pushed_at":"2023-11-06T04:34:43.000Z","size":1227,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-26T05:24:28.143Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/offgriddev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-11-06T03:26:17.000Z","updated_at":"2023-11-06T04:37:29.000Z","dependencies_parsed_at":"2023-11-06T05:31:33.260Z","dependency_job_id":"d8f688c3-c875-4095-aa42-812ac3ef689b","html_url":"https://github.com/offgriddev/forecast-cli","commit_stats":null,"previous_names":["offgriddev/forecast-cli"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/offgriddev%2Fforecast-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/offgriddev%2Fforecast-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/offgriddev%2Fforecast-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/offgriddev%2Fforecast-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/offgriddev","download_url":"https://codeload.github.com/offgriddev/forecast-cli/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244767542,"owners_count":20507110,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T21:21:45.852Z","updated_at":"2025-03-21T08:44:05.580Z","avatar_url":"https://github.com/offgriddev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003eoffgriddev/forecast-cli\u003c/h1\u003e\n  \u003cdiv\u003e\n    \u003cimg src=\"https://github.com/offgriddev/forecast-cli/blob/main/docs/mascot.png\" style=\"width: 45%\" /\u003e\n  \u003c/div\u003e\n  \u003cdiv\u003e\u003cbr /\u003eMetrics-based tooling for predicting the future.\u003c/div\u003e\n  \u003c/br\u003e\n\u003c/div\u003e\n\nForecast CLI is a metrics-based estimation tool used to predict a deadline for roadmap items based on the affect code changes have on the complexity of a system. Code Metrics are measurements of the current state of a system in terms of volume and complexity as it grows to meet business needs.\n\nWhen we aggregate these and track them over time as code is committed, we can make realistic predictions on future development efforts based on the pace at which each member delivers code.\n\n## Installation\n\nInstalling with `npm`:\n\n`npm i -g forecast-cli`\n\nInstalling with `yarn`:\n\n`yarn global add forecast-cli`\n\n### Usage\n\n#### Languages Supported\n\nYou can use any language that can be measured for Cyclomatic Complexity, or Logical Complexity.\n\n#### Code Metric Model\n\nCode Metrics must come in with a given format. The following is an MVP report that can consumed by the forecaster.\n\n```json\n{\n  \"totalComplexity\": 3,\n  \"sha\": \"0a254a37f483dd1548f58130be3fe9f78fbad990\",\n  \"actor\": \"participant-name\",\n  \"branch\": \"refs/pull/148/merge\",\n  \"analysis\": [\n    {\n      \"source\": \".//apps/api-service/src/hello-world-lambda.ts\",\n      \"metrics\": {\n        \"functionName\": {\n          \"complexity\": 3\n        },\n        \"anotherFunctionName\": {\n          \"complexity\": 1\n        },\n        \"getOnwithIt\": {\n          \"complexity\": 1\n        }\n      }\n    }\n  ]\n}\n```\n\n##### Data Location\n\nCurrently, you must download the code metrics from an S3 bucket in a `./data/commit-metrics` folder of a given working directory. This is currently hardcoded in until an AWS account for this is created.\n\n#### Measuring Module Complexity by Module\n\nComplexity is measured on a per-module basis. A module has the complexity of its most complex function.\n\nTherefore, the `hello-world-lambda.ts` module above has a complexity of 3, not 5.\n\n### Project Delivery Config\n\nA config file must be loaded to leverage the estimate functionality in the CLI. The following is a breakdown of all the properties on the delivery config:\n\n| Property                               | Type        | Description                                                               |\n| -------------------------------------- | ----------- | ------------------------------------------------------------------------- |\n| startDate                              | Date String | The start date of the project or calculation                              |\n| jira                                   | Object      | Jira configuration                                                        |\n| jira.startSignal                       | String[]    | IDs for Jira Changelogs that represent the start of work for a given card |\n| jira.epicKeys                          | String[]    | Jira Keys for the project epics                                           |\n| jira.fields                            | Object[]    | Fields to map from Jira                                                   |\n| jira.fields.from                       | string      | Field in Jira Issue to map to the estimate                                |\n| jira.fields.to                         | string      | Field in datamodel to map to                                              |\n| jira.repositories                      | string[]    | List of all repositories used for a given project                         |\n| jira.participants                      | Object[]    | List of all participants in a given project                               |\n| jira.participants.workableHours        | number      | Amount of hours developer is expected to work on the project              |\n| jira.participants.username             | string      | GitHub username for participant                                           |\n| jira.participants.daysUnavailable      | Object[]    | List of days dev will not be available for new work                       |\n| jira.participants.daysUnavailable.from | string      | Beginning of participant unavailability                                   |\n| jira.participants.daysUnavailable.to   | string      | End of participants unavailability                                        |\n\n### Commands\n\nThe following is the primary list of supported commands:\n\n#### forecast delivery \u003cconfig-file\u003e\n\nThis command creates a delivery projection for an entire project. It is used to provide an initial estimate and throughout the project. As work gets checked in, the algorithm will no longer distribute the card. So this provides a good barometer for internal time-to-deliver.\n\n`forecast delivery ./infrastructure-initiative-config.json`\n\n#### forecast commits print --repos \u003crepos\u003e\n\nThis command prints all the commits for a given set of repositories. It allows you to observe the measured growth of complexity in a given repository. This is the basis for metrics-based estimations.\n\n`forecast commits print --repos forecast-cli`","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foffgriddev%2Fforecast-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foffgriddev%2Fforecast-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foffgriddev%2Fforecast-cli/lists"}