{"id":23219627,"url":"https://github.com/barcek/deye","last_synced_at":"2026-04-05T21:02:04.561Z","repository":{"id":48826851,"uuid":"455660720","full_name":"barcek/deye","owner":"barcek","description":"say yes to Deno | shorthand permission passing | command-line tool | Bash","archived":false,"fork":false,"pushed_at":"2025-01-16T15:06:25.000Z","size":52,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-11T11:53:03.933Z","etag":null,"topics":["bash","command-line-tool","deno","dx","javascript","shell"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/barcek.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2022-02-04T18:49:14.000Z","updated_at":"2025-01-16T15:06:27.000Z","dependencies_parsed_at":"2024-12-30T22:20:47.999Z","dependency_job_id":"aeb486aa-d2fe-4ffc-8f50-8dae303a9a1d","html_url":"https://github.com/barcek/deye","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barcek%2Fdeye","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barcek%2Fdeye/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barcek%2Fdeye/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barcek%2Fdeye/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/barcek","download_url":"https://codeload.github.com/barcek/deye/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247353742,"owners_count":20925329,"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":["bash","command-line-tool","deno","dx","javascript","shell"],"created_at":"2024-12-18T21:36:09.515Z","updated_at":"2025-09-15T20:30:27.799Z","avatar_url":"https://github.com/barcek.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# deye\n\nPass permissions to `deno run` more easily.\n\nGenerates and runs a long-form command via shorthands, with a preview option and self-test.\n\nAvailable over a Deno base image via the Dockerfile in [shipping](https://github.com/barcek/shipping).\n\n## Why?\n\nThe permissions flags are reasonably long and several might be needed to run a project. This can be a relatively large overhead when prototyping or running occasional scripts.\n\n## How?\n\nThe `deye` command takes as its first argument a shorthand string. This is a set of characters identifying the permissions or other options required, e.g. `rwx` represents `--allow-read`, `--allow-write` and `--allow-run`.\n\nAdditional arguments usually passed directly to `deno run`, e.g. the file path and any arguments to the file, are passed to `deye` immediately after the shorthand string.\n\n```\ndeye \u003cshorthand_string\u003e [\u003cadditional_arg\u003e[ ...]]\n```\n\nThe shorthand string either:\n\n- has one character per permission or other option, e.g. as above `r` to allow read, or\n- is three characters long - `all` - to apply every permission at once\n\nFor the full set of shorthands available, see [Mapping](#mapping) below.\n\n### Examples\n\nFor the `--allow-read`, `--allow-write` and `--allow-run` flags the corresponding characters are `r`, `w` and `x`:\n\n```shell\ndeye rwx script.js\n```\n\nFlags taking values are simply passed after the string:\n\n```shell\ndeye rw --allow-run=\"util\" script.js\n```\n\nFor `--allow-all` use `all`:\n\n```shell\ndeye all script.js\n```\n\n#### Other options\n\nThe `--no-prompt`, `--no-npm`, `--no-remote`, `--config`, `--import-map`, `--check` and `--watch` options are also available, as are `--compat` and `--unstable`, since removed from Deno but retained here for backward compatibility. The former:\n\n```shell\ndeye tNRCITW script.js\n```\n\nThe default path for `--config` is 'deno.json', and for `--import-map` 'import_map.json', per the Deno docs. For the removed `--unstable`, a range of granular instability options exist with `--unstable`-prefixed flags.\n\n### Preview\n\nTo see the full command generated, without running it, the `--preview` or `-p` flag can be used (see [Options](#options) below).\n\n## Mapping\n\n### Permissions - individual\n\n- `e` --allow-env\n- `f` --allow-ffi\n- `n` --allow-net\n- `i` --allow-import\n- `s` --allow-sys\n- `r` --allow-read\n- `w` --allow-write\n- `x` --allow-run\n- `h` --allow-hrtime (cf. note below)\n\n### Permissions - combined\n\n- `all` --allow-all\n\n### Other options\n\n- `t` --no-prompt ('throw')\n- `N` --no-npm\n- `R` --no-remote\n- `C` --config deno.json\n- `I` --import-map=import_map.json\n- `T` --check ('types')\n- `W` --watch\n- `c` --compat (cf. note below)\n- `u` --unstable (cf. note below)\n\n**NB** Retained for backward compatibility: `--compat` (mode removed in Deno v1.25.2); `--allow-hrtime` (removed v2.0.0); `--unstable` (removed v2.0.0).\n\n## Source\n\nThe script can be run with the command `./deye` while in the same directory, and from elsewhere using the pattern `path/to/deye`, by first making it executable, if not already, with `chmod +x deye`. Once executable, it can be run from any directory with the simpler `deye` by placing it in a directory listed on the `$PATH` environment variable, e.g. '/bin' or '/usr/bin'.\n\nThe hashbang at the top of the file assumes the presence of Bash in '/bin', the source code that several utils and Deno itself are installed and can be invoked directly, e.g. Deno with `deno`. A list can be found close to the top of the file, and is printed also in the help text. In the event of any absence, the script will print the fact then exit.\n\n### Defaults\n\nThe mapping is defined close to the top of the source file.\n\n### Making changes\n\nRunning the self-test after making changes plus extending or adding test cases to cover new behaviour is recommended. The self-test is run with the `--test` or `-T` flag (see [Options](#options) below). The test cases are set in the `perform_self_test` function, which is defined with the other option handlers.\n\n## Options\n\nThe following can be passed to `deye` before the shorthand string:\n\n- `--preview` / `-p`, to show but not run the full command generated then exit\n\nThe following can be passed to `deye` in place of the shorthand string:\n\n- `--show` / `-s`, to grep the `deno run` help text for the flag mapped to the next argument, e.g. for '--allow-read' with `-s r`, then exit\n- `--version` / `-v`, to show name and version number then exit\n- `--help` / `-h`, to show help text, incl. the shorthands available, then exit\n- `--test` / `-T`, to perform the self-test then exit, returning an exit code of 1 on failure\n\n## Streams\n\nSets of arguments can be piped to `deye` from another process, with each complete argument set occupying a single line and each line being handled individually.\n\nIf a batch of lines consists only of the additional arguments passed to `deno run`, the same shorthand string is used for all:\n\n```shell\nls | grep .js | deye rwx\n```\n\nAlternatively, each line in a batch can include its own shorthand string:\n\n```shell\necho -e \"r read.js\\nw write.js\\nx run.js\" \u003e cmds.txt\ncat cmds.txt | deye\n```\n\n## Development plan\n\nThe following are the expected next steps in the development of the code base. The general medium-term aim is a more portable and robust implementation. Pull requests are welcome for these and other potential improvements.\n\n- modify the show option for contextual awareness\n- revise for full POSIX compatibility\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarcek%2Fdeye","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbarcek%2Fdeye","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarcek%2Fdeye/lists"}