{"id":19196139,"url":"https://github.com/nsneruno/flutter_dd_cli","last_synced_at":"2026-04-12T18:57:55.233Z","repository":{"id":56829314,"uuid":"449281808","full_name":"nsNeruno/flutter_dd_cli","owner":"nsNeruno","description":"Allow simplification of building Flutter app with Dart Defines.","archived":false,"fork":false,"pushed_at":"2022-03-31T09:24:50.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-23T04:43:24.754Z","etag":null,"topics":["cli","cli-app","dart","dart-cli","dart-define","environment-variables","flutter"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/flutter_dd_cli","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nsNeruno.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-01-18T12:48:39.000Z","updated_at":"2022-06-15T10:26:52.000Z","dependencies_parsed_at":"2022-08-26T13:51:12.918Z","dependency_job_id":null,"html_url":"https://github.com/nsNeruno/flutter_dd_cli","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nsNeruno/flutter_dd_cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nsNeruno%2Fflutter_dd_cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nsNeruno%2Fflutter_dd_cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nsNeruno%2Fflutter_dd_cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nsNeruno%2Fflutter_dd_cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nsNeruno","download_url":"https://codeload.github.com/nsNeruno/flutter_dd_cli/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nsNeruno%2Fflutter_dd_cli/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259518833,"owners_count":22870302,"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":["cli","cli-app","dart","dart-cli","dart-define","environment-variables","flutter"],"created_at":"2024-11-09T12:12:46.329Z","updated_at":"2026-04-12T18:57:55.187Z","avatar_url":"https://github.com/nsNeruno.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# flutter_dd_cli [![Pub](https://img.shields.io/pub/v/flutter_dd_cli.svg)](https://pub.dartlang.org/packages/flutter_dd_cli)\nA helper CLI Utility to simplify usages of Dart Defines.\n\n## Features\n\n- Generates a string of formatted `--dart-define`s ready to be pasted into any `flutter build` and `flutter run` commands.\n- Simplify `flutter build` command by specifying an existing file containing ready-to-inject values (in json or line separated), converting them to `--dart-define` format.\n- Provides an alternative way instead of editing `.vscode/launch.json` or `.idea/workspace.xml` directly.\n\n## Getting started\n\n### Installation\n```sh\nflutter pub global activate flutter_dd_cli\n```\nIf you have direct access to pub in your ```PATH``` then you can omit the flutter prefix.\n\nThe CLI will be available as the terminal command ```fdd```. But in order to use it everywhere, e.g on your current Flutter project directory, you have to add the [system cache](https://dart.dev/tools/pub/cmd/pub-global#running-a-script-from-your-path) bin directory to your **PATH** environment variable.\n\nAssuming the Flutter installation is located at the default location, here are some known possible ```PATH```s:\n- #### MacOS/Linux Path:\n```sh\n$HOME/.pub-cache/bin\n```\n- #### Windows Path:\n```console\n%LOCALAPPDATA%\\Pub\\Cache\\bin\n```\n\n## Usage\n\n### Generate Dart Defines\n#### From JSON File\nGiven the sample JSON File below with name ```env.json```\n```json\n{\n  \"log\": true,\n  \"apiKeyA\": \"NeverGonnaGiveYouUp\",\n  \"apiKeyB\": \"NeverGonnaLetYouDown\",\n  \"apiKeyC\": \"NeverGonnaRunAround\",\n  \"protocol\": \"and\",\n  \"baseUrl\": \"Deserts.You\",\n  \"port\": 420\n}\n```\nAssuming ```env.json``` is currently located at current working directory\n```sh\nfdd generate json env.json\n\n# or if the file is located somewhere else\nfdd generate json /path/to/env.json\n```\n#### From Formatted Env File\nFor this method, the `env` file is expected to be in this format, read line by line:\n```\nlog=true\napiKeyA=NeverGonnaGiveYouUp\napiKeyB=NeverGonnaLetYouDown\napiKeyC=NeverGonnaRunAround\nprotocol=and\nbaseUrl=Deserts.You\nport=420\n```\nWhere `key` consists of alphanumeric and underscores and `value` consists of String-likes.\n```sh\n# assuming the file name is config\nfdd generate env config\n\n# or named debug.old\nfdd generate env debug.old\n\n# from somewhere else\nfdd generate env /path/to/env\n```\n### Generated Result\nThe result is expected to look like this\n```\n--dart-define=log=true --dart-define=apiKeyA=NeverGonnaGiveYouUp ...\n```\nYou may copy/pipe the result from your terminal and use it directly on your `flutter build`/`flutter run` script or add it into Run/Build Configuration section on **Android Studio**.\n\n### Build with Dart Defines\nThe `build` command will delegate the arguments into `flutter build` command.\n```sh\n# This will delegate the dart defines into flutter build appbundle --release command\nfdd build json env.json appbundle --release\n\n# Delegates to flutter build apk --debug\nfdd build env debug.old apk --debug\n\n# Add --clean to run flutter clean before flutter build\nfdd build json env.json appbundle --release --clean\n\n# Clean and defaults to --release\nfdd build json env.json appbundle --clean\n```\n\n#### Flutter Obfuscation\nThere is a Flutter command to obfuscate the Dart code using `--obfuscate --split-debug-info=...` which is optionally available by adding the parameter below.\n```\n--obfuscateSplitPath=\u003c/path_to/project_name/directory\u003e\n```\n\n#### Outputs\nThe generated build files are located at the same location defined by `flutter build` command.\n\nExtra: it also pipes the `stdout` and `stderr` from the `flutter` commands.\n\n## Additional information\n\n### Constraints\n- Values with spaces are not allowed\n- Invalid entries are skipped\n- For referencing an `env` file, avoid naming the file as `env`\n\n## TODOs\n- Integrate **flutter run**\n- Add contents for **--help** / **-h** arguments\n- Add more textual Error Messages\n- Add more Error classes\n- Code breakdown into smaller classes\n- Localizations","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnsneruno%2Fflutter_dd_cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnsneruno%2Fflutter_dd_cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnsneruno%2Fflutter_dd_cli/lists"}