{"id":29093110,"url":"https://github.com/alexandersisco/kubun","last_synced_at":"2026-04-28T01:30:56.791Z","repository":{"id":301289513,"uuid":"999354314","full_name":"alexandersisco/kubun","owner":"alexandersisco","description":"Python-style slicing for paths and delimiter-separated strings, from your terminal.","archived":false,"fork":false,"pushed_at":"2025-06-26T04:32:01.000Z","size":30,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-26T05:28:11.345Z","etag":null,"topics":["cli","command-line","devtools","shell","text-processing"],"latest_commit_sha":null,"homepage":"","language":"Go","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/alexandersisco.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2025-06-10T06:07:58.000Z","updated_at":"2025-06-26T05:03:19.000Z","dependencies_parsed_at":"2025-06-26T05:38:20.498Z","dependency_job_id":null,"html_url":"https://github.com/alexandersisco/kubun","commit_stats":null,"previous_names":["alexandersisco/kubun"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alexandersisco/kubun","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexandersisco%2Fkubun","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexandersisco%2Fkubun/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexandersisco%2Fkubun/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexandersisco%2Fkubun/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexandersisco","download_url":"https://codeload.github.com/alexandersisco/kubun/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexandersisco%2Fkubun/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32362780,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"ssl_error","status_checked_at":"2026-04-27T20:07:00.910Z","response_time":128,"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":["cli","command-line","devtools","shell","text-processing"],"created_at":"2025-06-28T08:05:59.162Z","updated_at":"2026-04-28T01:30:56.786Z","avatar_url":"https://github.com/alexandersisco.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kubun  くぶん \n\nA CLI for slicing and indexing delimiter-separated text\n\nKubun draws inspiration from Python's simple yet powerful slice syntax. My aim is for it to be a more intuitive solution for slicing fields and segments of text on the command line than tools like `cut`, `awk`, and `sed`.\n\n## Install\n```\ngo install github.com/alexandersisco/kubun@latest\n```\n\n## Usage\nKubun takes up to two positional arguments: the SLICE pattern followed by the optional INPUT. \n\nPython-like syntax:\n\nThe syntax for Kubun's slice pattern follows that of Python which includes the following components `[start:stop:step]`. Each is a zero-based index into the delimited fields being sliced. The stop index is exclusive, meaning Kubun will stop before the field that the index points to, excluding it from the output. A negative start or stop index is measured from the end of the input with a -1 representing the last field. For brevity, the step may be omitted: like this: `[start:stop]`.\n\nHere are some basic examples:\n```bash\nkubun '[:]' /usr/bin/sort             # -\u003e /usr/bin/sort\nkubun '[:-1]' /usr/bin/sort           # -\u003e /usr/bin\nkubun '[-1:]' /usr/bin/sort           # -\u003e sort\nkubun '[-2:]' /usr/bin/sort           # -\u003e bin/sort\n```\nSelect a single field by placing the field's index between the brackets. Here are some examples:\n```bash\nkubun '[0]' /usr/bin/sort             # -\u003e '' (Blank since there is nothing before the first delimiter)\nkubun '[1]' /usr/bin/sort             # -\u003e usr\nkubun '[-1]' /usr/bin/sort            # -\u003e sort\n```\nYou can also pipe text into Kubun:\n```bash\necho \"/usr/bin/sort\" | kubun '[-3:]'  # -\u003e usr/bin/sort\n```\nKubun supports reversing fields by passing in a negative step. Indexing and slicing in reverse work the same way as they do in Python, meaning, that a reverse slice walks backward through the fields from right to left. So remember, your start index must be greater than your stop index and the field pointed to by your stop index is not included in the resulting slice.\n```bash\nkubun '[::-1]' /usr/bin/sort          # -\u003e sort/bin/usr/\nkubun '[2:0:-1]' /usr/bin/sort        # -\u003e bin/usr\nkubun '[:0:-1]' /usr/bin/sort         # -\u003e sort/bin/usr\n```\n### Delimiters\nBy default, Kubun looks for the \"/\" forward slash delimiter. To slice based on a different delimiter, place the delimiter that you want to use immediately before the slice pattern as in the following example:\n```bash\nkubun ':[0:2]' $PATH                  # -\u003e /bin:/usr/bin\n```\nKubun makes it easy to replace delimiters.\n\nTo replace the delimiters in a string of text, include the old and new delimiters on either side of the slice pattern like so: `'\u003cold\u003e[:]\u003cnew\u003e'`.\n```bash\nkubun '/[:]\\' /usr/bin/sort           # -\u003e \\usr\\bin\\sort\nkubun '/[1:], ' /usr/bin/sort         # -\u003e usr, bin, sort\nkubun ':[:]\\n' $PATH                  # -\u003e /bin\n                                      #    /usr/local/bin\n                                      #    /usr/bin\n                                      #    ...\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexandersisco%2Fkubun","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexandersisco%2Fkubun","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexandersisco%2Fkubun/lists"}