"use strict";(self.webpackChunktelevision_website=self.webpackChunktelevision_website||[]).push([[4816],{3239:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>o,contentTitle:()=>c,default:()=>h,frontMatter:()=>l,metadata:()=>i,toc:()=>d});const i=JSON.parse('{"id":"Users/community-channels-unix","title":"Community Channels (unix)","description":"alias","source":"@site/../docs/01-Users/10-community-channels-unix.md","sourceDirName":"01-Users","slug":"/Users/community-channels-unix","permalink":"/television/docs/Users/community-channels-unix","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":10,"frontMatter":{},"sidebar":"docSidebar","previous":{"title":"CLI Reference","permalink":"/television/docs/Users/cli"},"next":{"title":"Community Channels (windows)","permalink":"/television/docs/Users/community-channels-windows"}}');var r=s(3420),t=s(5404);const l={},c="Community Channels (unix)",o={},d=[{value:"alias",id:"alias",level:3},{value:"aws-buckets",id:"aws-buckets",level:3},{value:"aws-instances",id:"aws-instances",level:3},{value:"bash-history",id:"bash-history",level:3},{value:"dirs",id:"dirs",level:3},{value:"docker-images",id:"docker-images",level:3},{value:"dotfiles",id:"dotfiles",level:3},{value:"env",id:"env",level:3},{value:"files",id:"files",level:3},{value:"fish-history",id:"fish-history",level:3},{value:"git-branch",id:"git-branch",level:3},{value:"git-diff",id:"git-diff",level:3},{value:"git-log",id:"git-log",level:3},{value:"git-reflog",id:"git-reflog",level:3},{value:"git-repos",id:"git-repos",level:3},{value:"nu-history",id:"nu-history",level:3},{value:"text",id:"text",level:3},{value:"zsh-history",id:"zsh-history",level:3}];function a(e){const n={code:"code",em:"em",h1:"h1",h3:"h3",header:"header",hr:"hr",p:"p",pre:"pre",strong:"strong",...(0,t.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.header,{children:(0,r.jsx)(n.h1,{id:"community-channels-unix",children:"Community Channels (unix)"})}),"\n",(0,r.jsx)(n.h3,{id:"alias",children:(0,r.jsx)(n.em,{children:"alias"})}),"\n",(0,r.jsx)(n.p,{children:"A channel to select from shell aliases"}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Requirements:"})," ",(0,r.jsx)(n.em,{children:"None"})]}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Code:"})," ",(0,r.jsx)(n.em,{children:"alias.toml"})]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-toml",children:'[metadata]\nname = "alias"\ndescription = "A channel to select from shell aliases"\n\n[source]\ncommand = "alias"\ninteractive = true\noutput = "{split:=:0}"\n\n'})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h3,{id:"aws-buckets",children:(0,r.jsx)(n.em,{children:"aws-buckets"})}),"\n",(0,r.jsx)(n.p,{children:"List and preview AWS S3 Buckets"}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Requirements:"})," ",(0,r.jsx)(n.code,{children:"aws"})]}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Code:"})," ",(0,r.jsx)(n.em,{children:"aws-buckets.toml"})]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-toml",children:'[metadata]\nname = "aws-buckets"\ndescription = "List and preview AWS S3 Buckets"\nrequirements = [ "aws",]\n\n[source]\ncommand = "aws s3 ls --output text"\noutput = "{split: :3|trim}"\n\n[preview]\ncommand = "aws s3 ls s3://{split: :3|trim} --human-readable --summarize"\n\n[ui.preview_panel]\nsize = 60\n\n'})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h3,{id:"aws-instances",children:(0,r.jsx)(n.em,{children:"aws-instances"})}),"\n",(0,r.jsx)(n.p,{children:"List and preview AWS EC2 Instances"}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Requirements:"})," ",(0,r.jsx)(n.code,{children:"aws"})]}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Code:"})," ",(0,r.jsx)(n.em,{children:"aws-instances.toml"})]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-toml",children:'[metadata]\nname = "aws-instances"\ndescription = "List and preview AWS EC2 Instances"\nrequirements = [ "aws",]\n\n[source]\ncommand = "aws ec2 describe-instances --output text --query \\"Reservations[*].Instances[*].[InstanceId,Tags[?Key==\'Name\']|[0].Value]\\""\n\n[preview]\ncommand = "aws ec2 describe-instances --output json --instance-ids {split:\\t:0} --query \'Reservations[*].Instances[0]\'"\n\n[ui.preview_panel]\nsize = 60\n\n'})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h3,{id:"bash-history",children:(0,r.jsx)(n.em,{children:"bash-history"})}),"\n",(0,r.jsx)(n.p,{children:"A channel to select from your bash history"}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Requirements:"})," ",(0,r.jsx)(n.code,{children:"bash"})]}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Code:"})," ",(0,r.jsx)(n.em,{children:"bash-history.toml"})]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-toml",children:'[metadata]\nname = "bash-history"\ndescription = "A channel to select from your bash history"\nrequirements = [ "bash",]\n\n[source]\ncommand = "sed \'1!G;h;$!d\' ${HISTFILE:-${HOME}/.bash_history}"\n\n'})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h3,{id:"dirs",children:(0,r.jsx)(n.em,{children:"dirs"})}),"\n",(0,r.jsx)(n.p,{children:"A channel to select from directories"}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Requirements:"})," ",(0,r.jsx)(n.code,{children:"fd"})]}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Code:"})," ",(0,r.jsx)(n.em,{children:"dirs.toml"})]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-toml",children:'[metadata]\nname = "dirs"\ndescription = "A channel to select from directories"\nrequirements = [ "fd",]\n\n[source]\ncommand = [ "fd -t d", "fd -t d --hidden",]\n\n[preview]\ncommand = "ls -la --color=always \'{}\'"\n\n[keybindings]\nshortcut = "f2"\n\n'})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h3,{id:"docker-images",children:(0,r.jsx)(n.em,{children:"docker-images"})}),"\n",(0,r.jsx)(n.p,{children:"A channel to select from Docker images"}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Requirements:"})," ",(0,r.jsx)(n.code,{children:"docker"}),", ",(0,r.jsx)(n.code,{children:"jq"})]}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Code:"})," ",(0,r.jsx)(n.em,{children:"docker-images.toml"})]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-toml",children:'[metadata]\nname = "docker-images"\ndescription = "A channel to select from Docker images"\nrequirements = [ "docker", "jq",]\n\n[source]\ncommand = "docker images --format \'{{.Repository}}:{{.Tag}} {{.ID}}\'"\noutput = "{split: :-1}"\n\n[preview]\ncommand = "docker image inspect \'{split: :-1}\' | jq -C"\n\n'})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h3,{id:"dotfiles",children:(0,r.jsx)(n.em,{children:"dotfiles"})}),"\n",(0,r.jsx)(n.p,{children:"A channel to select from your user's dotfiles"}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Requirements:"})," ",(0,r.jsx)(n.code,{children:"fd"}),", ",(0,r.jsx)(n.code,{children:"bat"})]}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Code:"})," ",(0,r.jsx)(n.em,{children:"dotfiles.toml"})]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-toml",children:'[metadata]\nname = "dotfiles"\ndescription = "A channel to select from your user\'s dotfiles"\nrequirements = [ "fd", "bat",]\n\n[source]\ncommand = "fd -t f . $HOME/.config"\n\n[preview]\ncommand = "bat -n --color=always \'{}\'"\n\n'})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h3,{id:"env",children:(0,r.jsx)(n.em,{children:"env"})}),"\n",(0,r.jsx)(n.p,{children:"A channel to select from environment variables"}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Requirements:"})," ",(0,r.jsx)(n.em,{children:"None"})]}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Code:"})," ",(0,r.jsx)(n.em,{children:"env.toml"})]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-toml",children:'[metadata]\nname = "env"\ndescription = "A channel to select from environment variables"\n\n[source]\ncommand = "printenv"\noutput = "{split:=:1..}"\n\n[preview]\ncommand = "echo \'{split:=:1..}\'"\n\n[ui]\nlayout = "portrait"\n\n[keybindings]\nshortcut = "f3"\n\n[ui.preview_panel]\nsize = 20\nheader = "{split:=:0}"\n\n'})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h3,{id:"files",children:(0,r.jsx)(n.em,{children:"files"})}),"\n",(0,r.jsx)(n.p,{children:"A channel to select files and directories"}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Requirements:"})," ",(0,r.jsx)(n.code,{children:"fd"}),", ",(0,r.jsx)(n.code,{children:"bat"})]}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Code:"})," ",(0,r.jsx)(n.em,{children:"files.toml"})]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-toml",children:'[metadata]\nname = "files"\ndescription = "A channel to select files and directories"\nrequirements = [ "fd", "bat",]\n\n[source]\ncommand = [ "fd -t f", "fd -t f -H",]\n\n[preview]\ncommand = "bat -n --color=always \'{}\'"\n\n[keybindings]\nshortcut = "f1"\n\n[preview.env]\nBAT_THEME = "ansi"\n\n'})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h3,{id:"fish-history",children:(0,r.jsx)(n.em,{children:"fish-history"})}),"\n",(0,r.jsx)(n.p,{children:"A channel to select from your fish history"}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Requirements:"})," ",(0,r.jsx)(n.code,{children:"fish"})]}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Code:"})," ",(0,r.jsx)(n.em,{children:"fish-history.toml"})]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-toml",children:'[metadata]\nname = "fish-history"\ndescription = "A channel to select from your fish history"\nrequirements = [ "fish",]\n\n[source]\ncommand = "fish -c \'history\'"\n\n'})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h3,{id:"git-branch",children:(0,r.jsx)(n.em,{children:"git-branch"})}),"\n",(0,r.jsx)(n.p,{children:"A channel to select from git branches"}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Requirements:"})," ",(0,r.jsx)(n.code,{children:"git"})]}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Code:"})," ",(0,r.jsx)(n.em,{children:"git-branch.toml"})]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-toml",children:'[metadata]\nname = "git-branch"\ndescription = "A channel to select from git branches"\nrequirements = [ "git",]\n\n[source]\ncommand = "git --no-pager branch --all --format=\\"%(refname:short)\\""\noutput = "{split: :0}"\n\n[preview]\ncommand = "git show -p --stat --pretty=fuller --color=always \'{0}\'"\n\n'})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h3,{id:"git-diff",children:(0,r.jsx)(n.em,{children:"git-diff"})}),"\n",(0,r.jsx)(n.p,{children:"A channel to select files from git diff commands"}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Requirements:"})," ",(0,r.jsx)(n.code,{children:"git"})]}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Code:"})," ",(0,r.jsx)(n.em,{children:"git-diff.toml"})]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-toml",children:'[metadata]\nname = "git-diff"\ndescription = "A channel to select files from git diff commands"\nrequirements = [ "git",]\n\n[source]\ncommand = "git diff --name-only HEAD"\n\n[preview]\ncommand = "git diff HEAD --color=always -- \'{}\'"\n\n'})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h3,{id:"git-log",children:(0,r.jsx)(n.em,{children:"git-log"})}),"\n",(0,r.jsx)(n.p,{children:"A channel to select from git log entries"}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Requirements:"})," ",(0,r.jsx)(n.code,{children:"git"})]}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Code:"})," ",(0,r.jsx)(n.em,{children:"git-log.toml"})]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-toml",children:'[metadata]\nname = "git-log"\ndescription = "A channel to select from git log entries"\nrequirements = [ "git",]\n\n[source]\ncommand = "git log --oneline --date=short --pretty=\\"format:%h %s %an %cd\\" \\"$@\\""\noutput = "{split: :0}"\n\n[preview]\ncommand = "git show -p --stat --pretty=fuller --color=always \'{0}\'"\n\n'})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h3,{id:"git-reflog",children:(0,r.jsx)(n.em,{children:"git-reflog"})}),"\n",(0,r.jsx)(n.p,{children:"A channel to select from git reflog entries"}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Requirements:"})," ",(0,r.jsx)(n.code,{children:"git"})]}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Code:"})," ",(0,r.jsx)(n.em,{children:"git-reflog.toml"})]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-toml",children:'[metadata]\nname = "git-reflog"\ndescription = "A channel to select from git reflog entries"\nrequirements = [ "git",]\n\n[source]\ncommand = "git reflog"\noutput = "{split: :0}"\n\n[preview]\ncommand = "git show -p --stat --pretty=fuller --color=always \'{0}\'"\n\n'})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h3,{id:"git-repos",children:(0,r.jsx)(n.em,{children:"git-repos"})}),"\n",(0,r.jsx)(n.p,{children:"A channel to select from git repositories on your local machine."}),"\n",(0,r.jsxs)(n.p,{children:["This channel uses ",(0,r.jsx)(n.code,{children:"fd"})," to find directories that contain a ",(0,r.jsx)(n.code,{children:".git"})," subdirectory, and then allows you to preview the git log of the selected repository."]}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Requirements:"})," ",(0,r.jsx)(n.code,{children:"fd"}),", ",(0,r.jsx)(n.code,{children:"git"})]}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Code:"})," ",(0,r.jsx)(n.em,{children:"git-repos.toml"})]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-toml",children:'[metadata]\nname = "git-repos"\nrequirements = [ "fd", "git",]\ndescription = "A channel to select from git repositories on your local machine.\\n\\nThis channel uses `fd` to find directories that contain a `.git` subdirectory, and then allows you to preview the git log of the selected repository.\\n"\n\n[source]\ncommand = "fd -g .git -HL -t d -d 10 --prune ~ -E \'Library\' -E \'Application Support\' --exec dirname \'{}\'"\ndisplay = "{split:/:-1}"\n\n[preview]\ncommand = "cd \'{}\'; git log -n 200 --pretty=medium --all --graph --color"\n\n'})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h3,{id:"nu-history",children:(0,r.jsx)(n.em,{children:"nu-history"})}),"\n",(0,r.jsx)(n.p,{children:"A channel to select from your nu history"}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Requirements:"})," ",(0,r.jsx)(n.em,{children:"None"})]}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Code:"})," ",(0,r.jsx)(n.em,{children:"nu-history.toml"})]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-toml",children:'[metadata]\nname = "nu-history"\ndescription = "A channel to select from your nu history"\n\n[source]\ncommand = "nu -c \'open $nu.history-path | lines | reverse | to text\'"\n\n'})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h3,{id:"text",children:(0,r.jsx)(n.em,{children:"text"})}),"\n",(0,r.jsx)(n.p,{children:"A channel to find and select text from files"}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Requirements:"})," ",(0,r.jsx)(n.code,{children:"rg"}),", ",(0,r.jsx)(n.code,{children:"bat"})]}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Code:"})," ",(0,r.jsx)(n.em,{children:"text.toml"})]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-toml",children:'[metadata]\nname = "text"\ndescription = "A channel to find and select text from files"\nrequirements = [ "rg", "bat",]\n\n[source]\ncommand = "rg . --no-heading --line-number"\ndisplay = "[{split:\\\\::..2}]\\t{split:\\\\::2}"\noutput = "{split:\\\\::..2}"\n\n[preview]\ncommand = "bat -n --color=always \'{split:\\\\::0}\'"\noffset = "{split:\\\\::1}"\n\n[preview.env]\nBAT_THEME = "ansi"\n\n[ui.preview_panel]\nheader = "{split:\\\\::..2}"\n\n'})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h3,{id:"zsh-history",children:(0,r.jsx)(n.em,{children:"zsh-history"})}),"\n",(0,r.jsx)(n.p,{children:"A channel to select from your zsh history"}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Requirements:"})," ",(0,r.jsx)(n.code,{children:"zsh"})]}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Code:"})," ",(0,r.jsx)(n.em,{children:"zsh-history.toml"})]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-toml",children:'[metadata]\nname = "zsh-history"\ndescription = "A channel to select from your zsh history"\nrequirements = [ "zsh",]\n\n[source]\ncommand = "sed \'1!G;h;$!d\' ${HISTFILE:-${HOME}/.zsh_history}"\ndisplay = "{split:;:1..}"\noutput = "{split:;:1..}"\n\n'})}),"\n",(0,r.jsx)(n.hr,{})]})}function h(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(a,{...e})}):a(e)}},5404:(e,n,s)=>{s.d(n,{R:()=>l,x:()=>c});var i=s(6672);const r={},t=i.createContext(r);function l(e){const n=i.useContext(t);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:l(e.components),i.createElement(t.Provider,{value:n},e.children)}}}]);