{"id":13801784,"url":"https://github.com/littletof/kopo-cli","last_synced_at":"2025-05-05T23:25:10.573Z","repository":{"id":45219307,"uuid":"306687063","full_name":"littletof/kopo-cli","owner":"littletof","description":"🐶 A Deno registry browser in the terminal","archived":false,"fork":false,"pushed_at":"2021-12-30T16:13:49.000Z","size":338,"stargazers_count":17,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-09T12:04:07.271Z","etag":null,"topics":["deno","deno-registry-browser","kopo-cli","nest","repository"],"latest_commit_sha":null,"homepage":"","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/littletof.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"ko_fi":"littletof","custom":["https://www.buymeacoffee.com/littletof","https://coindrop.to/littletof"]}},"created_at":"2020-10-23T16:16:13.000Z","updated_at":"2025-01-31T02:28:10.000Z","dependencies_parsed_at":"2022-07-19T00:02:02.562Z","dependency_job_id":null,"html_url":"https://github.com/littletof/kopo-cli","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/littletof%2Fkopo-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/littletof%2Fkopo-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/littletof%2Fkopo-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/littletof%2Fkopo-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/littletof","download_url":"https://codeload.github.com/littletof/kopo-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252591728,"owners_count":21773138,"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":["deno","deno-registry-browser","kopo-cli","nest","repository"],"created_at":"2024-08-04T00:01:27.356Z","updated_at":"2025-05-05T23:25:10.545Z","avatar_url":"https://github.com/littletof.png","language":"TypeScript","funding_links":["https://ko-fi.com/littletof","https://www.buymeacoffee.com/littletof","https://coindrop.to/littletof"],"categories":["TypeScript","Tools"],"sub_categories":["XML"],"readme":"# Kopo Cli 🐶\n\n*A Deno registry browser in the terminal*\n\n[![deno badge](https://img.shields.io/badge/deno.land/x-success?logo=deno\u0026logoColor=black\u0026labelColor=white\u0026color=black)](https://deno.land/x/kopo)\n[![nest badge](https://nest.land/badge.svg)](https://nest.land/package/kopo)\n\n![showcase](docs/browse.png)\n\n## Description\n\n`kopo` is a cli tool, which helps you browse the Deno registries in your terminal in an easy, nicely presented way.\n\nIt supports `deno.land/x` and `x.nest.land` by default, but also enables you to use [addons](#registries-and-addons), to access different registries.\n\n## Usage\n\n`kopo` is intended to be as an installed user script. For that, run:\n\n```bash\ndeno install --unstable --allow-net -f --name kopo --location https://kopo.mod.land https://deno.land/x/kopo@v0.1.1/mod.ts\n```\n\nTo just try it out, run the following command:\n\n```bash\ndeno run --unstable --allow-net --location https://kopo.mod.land https://deno.land/x/kopo@v0.1.1/mod.ts\n```\n\n## Features\n\n- browse the registries\n- search through registries for a keyword/specific module\n- get a specific module's info, eg: description, stars, repo, versions, readme\n- print a module's readme as a formatted markdown text with [charmd](https://deno.land/x/charmd)\n- show what [flags](#-flags) a module requires\n- An addon system, to access private or not yet added registries.\n- Persisted settings, like theme, disabled registries, other preferences + export, import of it\n\n`kopo`'s features can be accessed in two may separate ways.\n\n- Use it as an interactive application with a menu system\n- Issue simple commands and get only what you need in the cli\n\n## As an app\n\nIf installed with the command above, you simply need to issue the `kopo` command in your terminal, than the main menu should appear:\n\n![home](./docs/home.png)\n\nAfter that, you can navigate the menu using the \u003ckbd\u003e\u0026#8593;\u003c/kbd\u003e \u003ckbd\u003e\u0026#8595;\u003c/kbd\u003e or \u003ckbd\u003ew\u003c/kbd\u003e \u003ckbd\u003es\u003c/kbd\u003e buttons. (On windows you can't use the arrows currently :/ [issue](https://github.com/denoland/deno/issues/5945))\n\n### Browse\n\nSelect one from the enabled registries, than browse the paginated modules list or search for a term.\n\n![browse](./docs/browse.png)\n\n### Search\n\nIssue a global search in all registries.\n\n![search](docs/search.png)\n\nUse the `@` and a version to search for a specific version, like `kopo@v0.0.2`.\nIf the search term isn't a modules name, you can search the registries for that term with the options at the bottom.\n\n### Module info\n\nAfter you select a module, you will see it's info:\n\n![module_info](docs/module_info.png)\n\nFrom here, you can print it's README as a formatted MarkDown(using [charmd](https://github.com/littletof/charmd)) if one was found for it, get details about its [flags](#-flags), see other versions of it or see which other registries have this module registered.\n\n### Settings\nIf the `--location` flag was provided, you can access the settings, where you can tailor some features to your likings:\n\n![settings](docs/settings.png)\n\n## As a `CLI` tool\n\n\u003e 🚧 The API needs work, so it's bound to be changed 🚧\n\n### Search\n\nYour starting point is:\n```bash\nkopo search\n```\nWithout any following parameters, the search menu will pop up for you.\n\nIf you want to search for a specific search term eg `charmd` issue:\n```bash\nkopo search charmd\n```\n\nIf you know the module's name you are searching for add `--exact` or `-e` flag.\n```bash\nkopo search kopo -e\n```\nThis will get the first exact match from the first registry and display the modules info for you. Also, you can add `-v [exact version]` to get a specific version of the module.\n\nIf you have `-e` you can add `--readme` or `--read-raw` so the modules **README** will be printed instead.\n```bash\nkopo search charmd -e --readme\n```\nAdding `--flags` will print the module's [flags](#-flags) described in the readme if found.\n```bash\nkopo search kopo -e --flags\n```\n\nAdding `--json` flag for any of the above commands, will result in a formatted json output, instead of formatted text.\n```bash\nkopo search charmd -e --json\n```\n\n### Settings\nYou can export or import your settings which are stored in localStorage.\n\u003e If `--allow-read` and `--allow-write` flags are not provided at install, the script will request it in runtime.\n\n```bash\nkopo settings export settings.json\nkopo settings import settings.json\n```\n\n## Registries and Addons\n\nCurrently `deno.land/x` and `x.nest.land` is supported by default. However, you can use addons to integrate with other, not yet supported or private registries.\n\nFor this, first you need to have path (remote or local) to the registry addon, which should `extend` the [`Registry`](./registries/registry.ts) class. ([example](./examples/example_registry_addon.ts))\n\nWith that, you can add this path to your exported settings json and import it back into the app or use the `-r` flag for any of the commands.\n\u003cdetails\u003e\n\u003csummary\u003esettings.json\u003c/summary\u003e\n\n```json\n[\n    {\n        \"key\": \"registry_addons\",\n        \"value\": [\n            \"https://raw.githubusercontent.com/littletof/kopo-cli/remaster/examples/example_registry_addon.ts\"\n        ]\n    }\n]\n```\n\n\u003c/details\u003e\n\nThis flag will override which registries `kopo` will use during its runtime.\n```bash\nkopo -r deno,nest,https://raw.githubusercontent.com/littletof/kopo-cli/remaster/examples/example_registry_addon.ts\n```\n\u003e Use `file:///` prefix for any local files: `file:///C:/example.ts`\n\nIf the `-r` flag is used, no registry, that is not defined will be accessible.\nAlso, if `-r` is not used, you can enable/disable your builtin and through settings added registries in the application.\n\nFor example, if you want to search only the `nest` registry you can use:\n```bash\nkopo search kopo -e -r nest --readme\n```\n\n### 🚩 Flags\n\n\u003e 🚧 This is just an experimental feature currently 🚧\n\nThis proposes a concept, where each module describes what its required and optional flags are in a parseable way.\n\n#### How it works\n\nThe parser is [here](./flag_parser.ts)\n\nCurrently it searches for markdown table rows, which contain 2 or 3 columns.\n\n- The first column needs to contain the flag inside backticks like ( `--unstable` ). Things can be before it in the column, but only spaces are allowed after it.\n- The second column indicates, whether the flag is required (`*`, `Yes` or `yes`) or optional (empty). Putting `_` in this column tells the parser to ignore the row.\n- The optional third column can serve as a description why the flag is needed.\n\nA table could look something like this:\n\n\u003c!-- #DENO_FLAGS_TABLE --\u003e\n|Flag| Required |Reason|\n|:--|:-:|:--|\n| 🚧 `--unstable`  | * | Needed for [Cliffy](https://github.com/c4spar/deno-cliffy) to work |\n| 🌐 `--allow-net` | * | To fetch data from the repos |\n| 🔰 `--location` |   | To save settings. `https://kopo.mod.land` |\n| 🔍 `--allow-read` | _ | Needed for cache info |\n| 💾 `--allow-write` | _ | Save favourites |\n| ⏱ `--allow-hrtime` | _ | Allows precise benchmarking |\n| ⚠ `--allow-run` | _ | Needed for feature x |\n| 🧭 `--allow-env` | _ | Needed to access your ENV |\n| 🧩 `--allow-plugin` | _ | **`Deprecated`** Old plugin system |\n| 🧩 `--allow-ffi` | _ | For Deno plugin system |\n| 🔮 `--allow-all` | _ | It should never be required |\n\n\u003e Also keep in mind, that you can hide this inside a comment if you dont find a proper place for it in your readme, inside the `\u003c!--` `--\u003e` tags, but than only the tools processing your readme can see it.\n\n#### Testing your file for flags\n\nThere is a small util that you can use to test your file for the flags. It can be found [here](./flag_checker.ts).\n\nTo use it simply run:\n\n```bash\ndeno run --allow-read https://deno.land/x/kopo@v0.1.1/flag_checker.ts ./README.md\n```\n\nor for remote files:\n\n```bash\ndeno run --allow-net https://deno.land/x/kopo@v0.1.1/flag_checker.ts https://raw.githubusercontent.com/littletof/kopo-cli/master/README.md\n```\n\n## Contribution\n\nIssues, pull requests and feedback are always welcome.\n\n\n## TODOs\n\n- [ ] add module import url processing for search, etc..\n- [ ] more tests\n## Licence\n\nCopyright 2020- Szalay Kristóf. All rights reserved. MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flittletof%2Fkopo-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flittletof%2Fkopo-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flittletof%2Fkopo-cli/lists"}