{"id":22632307,"url":"https://github.com/budgielang/budgie-cli","last_synced_at":"2026-04-07T20:31:59.492Z","repository":{"id":90034457,"uuid":"98626316","full_name":"budgielang/budgie-cli","owner":"budgielang","description":"Node CLI for Budgie. 🦜","archived":false,"fork":false,"pushed_at":"2020-06-02T00:35:47.000Z","size":1940,"stargazers_count":1,"open_issues_count":17,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-14T13:41:46.838Z","etag":null,"topics":["csharp","gls","java","javascript","metaprogramming","node","npm","oop-languages","python","ruby","typescript"],"latest_commit_sha":null,"homepage":"https://budgielang.org","language":"TypeScript","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/budgielang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-07-28T08:15:55.000Z","updated_at":"2019-10-26T04:25:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"ed2e7ece-8669-484e-8abe-14fbbe67eb26","html_url":"https://github.com/budgielang/budgie-cli","commit_stats":null,"previous_names":["highschoolhacking/gls-cli"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/budgielang/budgie-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/budgielang%2Fbudgie-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/budgielang%2Fbudgie-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/budgielang%2Fbudgie-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/budgielang%2Fbudgie-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/budgielang","download_url":"https://codeload.github.com/budgielang/budgie-cli/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/budgielang%2Fbudgie-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31528339,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T16:28:08.000Z","status":"ssl_error","status_checked_at":"2026-04-07T16:28:06.951Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["csharp","gls","java","javascript","metaprogramming","node","npm","oop-languages","python","ruby","typescript"],"created_at":"2024-12-09T02:17:03.395Z","updated_at":"2026-04-07T20:31:59.470Z","avatar_url":"https://github.com/budgielang.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `budgie-cli` 🦜\n\n[![Build Status](https://travis-ci.org/budgielang/budgie-cli.svg?)](https://travis-ci.org/budgielang/budgie-cli)\n[![NPM version](https://badge.fury.io/js/budgie-cli.svg)](http://badge.fury.io/js/budgie-cli)\n\nNode CLI for [General Language Syntax (Budgie)](https://github.com/budgielang/Budgie).\n\n## Usage\n\n```cmd\nnpm install budgie-cli --global\n\nbudgie --help\n```\n\nPass any number of filenames and/or globs _(matched with [glob](http://npmjs.com/package/glob))_ to the CLI to convert those files to an output `-l`/`--language`.\n\nInput files to convert from Budgie to the output language must have a `.bg` extension.\n\n`.ts` files may also be given with `-t`/`--tsconfig` to compile to `.bg` files before output language conversion.\n\n\u003ctable\u003e\n    \u003cthead\u003e\n        \u003cth\u003eOption\u003c/th\u003e\n        \u003cth\u003ePurpose\u003c/th\u003e\n    \u003c/thead\u003e\n    \u003ctbody\u003e\n        \u003ctr\u003e\n            \u003cth\u003e\u003ccode\u003e-e\u003c/code\u003e/\u003ccode\u003e--exclude\u003c/code\u003e\u003c/th\u003e\n            \u003ctd\u003eGlob(s) of file(s) to exclude from conversion.\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003cth\u003e\u003ccode\u003e-l\u003c/code\u003e/\u003ccode\u003e--language\u003c/code\u003e\u003c/th\u003e\n            \u003ctd\u003e\n                Output language to convert to.\n                \u003c/br \u003e\n                \u003cem\u003e\u003cstrong\u003e(Required)\u003c/strong\u003e\u003c/em\u003e\n            \u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003cth\u003e\u003ccode\u003e-n\u003c/code\u003e/\u003ccode\u003e--namespace\u003c/code\u003e\u003c/th\u003e\n            \u003ctd\u003e\n                Namespace before path names, such as \u003ccode\u003e\"Budgie\"\u003c/code\u003e.\n            \u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003cth\u003e\u003ccode\u003e-p\u003c/code\u003e/\u003ccode\u003e--project\u003c/code\u003e\u003c/th\u003e\n            \u003ctd\u003e\n                Path to a \u003ccode\u003ebudgie.json\u003c/code\u003e project file to indicate to create project root-level exports and metadata files.\n                Will default to a \u003ccode\u003ebudgie.json\u003c/code\u003e file detected in the current directory if one exists and \u003ccode\u003e-p\u003c/code\u003e/\u003ccode\u003e--project\u003c/code\u003e is not provided as \u003ccode\u003efalse\u003c/code\u003e.\n            \u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003cth\u003e\u003ccode\u003e-t\u003c/code\u003e/\u003ccode\u003e--tsconfig\u003c/code\u003e\u003c/th\u003e\n            \u003ctd\u003e\n                TypeScript project configuration file.\n                \u003cem\u003e(Required if \u003ccode\u003e.ts\u003c/code\u003e file(s) given)\u003c/em\u003e\n            \u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003cth\u003e\u003ccode\u003e-v\u003c/code\u003e/\u003ccode\u003e--version\u003c/code\u003e\u003c/th\u003e\n            \u003ctd\u003ePrints the Budgie, budgie-cli, and TS-Budgie versions.\u003c/td\u003e\n        \u003c/tr\u003e\n    \u003c/tbody\u003e\n\u003c/table\u003e\n\n### Example Usage\n\nTo convert `file.bg` to `file.py`:\n\n```cmd\nbudgie --language Python file.bg\n```\n\nTo convert `*.ts` to `*.bg`, then to `*.java`:\n\n```cmd\nbudgie --language Java --tsconfig ./tsconfig *.ts\n```\n\n_Requires Node \u003e=8_\n\n## Development\n\nTo build from scratch, install Node.js and run the following commands:\n\n```\nnpm install\nnpm install budgielang ts-budgie typescript --no-save\nnpm run verify\n```\n\nCheck `package.json` for the full list of commands.\nTo set up source file compiling in watch mode, use `tsc -w`.\n\n### Tests\n\nRun `tsc -p test` to build tests, or `tsc -p test -w` to rebuild the files in watch mode.\nRun `npm run test:run` to run tests. \n\n### Internals\n\nWhen the CLI is called, the following code paths are used in order:\n\n1. `Cli`\n2. `Main`\n3. `Preprocessing`\n4. `Conversions`\n5. `Postprocessing`\n\n#### `Cli`\n\nParses raw string arguments using `commander`.\nIf the args are valid, it calls to the `Main` method.\n\nSystem dependencies such as the [`IFileSystem`](./src/files.ts) and globber may be dependency-injected to override the defaults.\n\nSee [`cli.ts`](./src/cli/cli.ts).\n\n#### `Main`\n\nValidates Budgie settings, sets up the conversion's `Preprocess`, `Runner`, and `Postprocess`, then runs them in that order.\nThere are two real behaviors here not covered by the `Cli`:\n\n* Globbing file paths passed as glob args and reading them the file system.\n* Validating the provided language is known by Budgie.\n\nSee [`main.ts`](./src/main.ts).\n\n#### `Preprocessing`\n\nIf any files are passed in with native language extensions, namely `.ts` for TypeScript, they are converted here using that langauge's converter to their `.bg` equivalent.\n\nFor example, if a `.ts` file is provided, it will attempt to convert it using [TS-Budgie](https://github.com/budgielang/ts-budgie) and return the generated `.bg` file path.\nIf a `.bg` file path is provided, it will do nothing and pass that path through.\n\nAny language-specific files that are used as metadata files for that language, such as `src/index.js` for JavaScript, will be removed from the files list.\n\nSee [`preprocessFiles.ts`](./src/preprocessing/preprocessFiles.ts).\n\n#### `Conversions`\n\nConverts each `.bg` file to the output language(s).\n\n`convertFiles` uses an async queue to throttle the number of files that are attempted to be converted via `convertFile` at once, as some conversions may need asynchronous operations.\nCreates a `BudgieConverter` per output language and has each file run through them.\n\nSee [`convertFiles.ts`](./src/conversions/convertFiles.ts) and [`convertFile.ts`](./src/conversions/convertFile).\n\n#### `Postprocess`\n\nRuns tasks on the converted `.bg` files as a project group after they've been successfully created.\n\nIf a `.budgie.json` is not provided or detected, this does nothing.\nOtherwise, it creates a root metadata file(s) as specified by each output language.\nThese are typically one or both of:\n\n* Metadata file describing the output project.\n* Exports file exporting publicaly exportable objects for languages that need them.\n\nSee [`postprocess.ts`](./src/postprocessing/postprocess.ts).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbudgielang%2Fbudgie-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbudgielang%2Fbudgie-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbudgielang%2Fbudgie-cli/lists"}