PageSourceSearch

https://noir-lang.org/docs/assets/js/68e652ae.33c64dfe.js

js noir-lang.org collected 2026-10-03 22:53:50 UTC 6,587 bytes, 1 lines download raw bytes

1"use strict";(globalThis.webpackChunkdocs=globalThis.webpackChunkdocs||[]).push([[2995],{17648(e,n,s){s.r(n),s.d(n,{assets:()=>r,contentTitle:()=>c,default:()=>d,frontMatter:()=>t,metadata:()=>o,toc:()=>a});const o=JSON.parse('{"id":"tooling/shell_completions","title":"Setting up shell completions","description":"Generate and install shell completion scripts for the nargo CLI in zsh, bash, fish, powershell, and elvish.","source":"@site/versioned_docs/version-v1.0.0-rc.2/tooling/shell_completions.md","sourceDirName":"tooling","slug":"/tooling/shell_completions","permalink":"/docs/tooling/shell_completions","draft":false,"unlisted":false,"editUrl":"https://github.com/noir-lang/noir/edit/master/docs/versioned_docs/version-v1.0.0-rc.2/tooling/shell_completions.md","tags":[],"version":"v1.0.0-rc.2","frontMatter":{"title":"Setting up shell completions","description":"Generate and install shell completion scripts for the nargo CLI in zsh, bash, fish, powershell, and elvish.","tags":[]},"sidebar":"sidebar","previous":{"title":"Fuzzer","permalink":"/docs/tooling/fuzzer"},"next":{"title":"Profiler","permalink":"/docs/tooling/profiler"}}');var i=s(74848),l=s(28453);const t={title:"Setting up shell completions",description:"Generate and install shell completion scripts for the nargo CLI in zsh, bash, fish, powershell, and elvish.",tags:[]},c=void 0,r={},a=[{value:"Installing Zsh Completions",id:"installing-zsh-completions",level:2},{value:"Installing Bash Completions",id:"installing-bash-completions",level:2},{value:"Installing Fish Completions",id:"installing-fish-completions",level:2}];function h(e){const n={a:"a",code:"code",h2:"h2",p:"p",pre:"pre",...(0,l.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.code,{children:"nargo"})," binary provides a command to generate shell completions:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"nargo generate-completion-script [shell]\n"})}),"\n",(0,i.jsxs)(n.p,{children:["where ",(0,i.jsx)(n.code,{children:"shell"})," must be one of ",(0,i.jsx)(n.code,{children:"bash"}),", ",(0,i.jsx)(n.code,{children:"elvish"}),", ",(0,i.jsx)(n.code,{children:"fish"}),", ",(0,i.jsx)(n.code,{children:"powershell"}),", and ",(0,i.jsx)(n.code,{children:"zsh"}),"."]}),"\n",(0,i.jsx)(n.p,{children:"Below we explain how to install them in some popular shells."}),"\n",(0,i.jsx)(n.h2,{id:"installing-zsh-completions",children:"Installing Zsh Completions"}),"\n",(0,i.jsxs)(n.p,{children:["If you have ",(0,i.jsx)(n.code,{children:"oh-my-zsh"})," installed, you might already have a directory of automatically loading completion scripts \u2014 ",(0,i.jsx)(n.code,{children:".oh-my-zsh/completions"}),".\nIf not, first create it:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"mkdir -p ~/.oh-my-zsh/completions\n"})}),"\n",(0,i.jsx)(n.p,{children:"Then copy the completion script to that directory:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"nargo generate-completion-script zsh > ~/.oh-my-zsh/completions/_nargo\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Without ",(0,i.jsx)(n.code,{children:"oh-my-zsh"}),", you\u2019ll need to add a path for completion scripts to your function path, and turn on completion script auto-loading.\nFirst, add these lines to ",(0,i.jsx)(n.code,{children:"~/.zshrc"}),":"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"fpath=(~/.zsh/completions $fpath)\nautoload -U compinit\ncompinit\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Next, create a directory at ",(0,i.jsx)(n.code,{children:"~/.zsh/completions"}),":"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"mkdir -p ~/.zsh/completions\n"})}),"\n",(0,i.jsx)(n.p,{children:"Then copy the completion script to that directory:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"nargo generate-completion-script zsh > ~/.zsh/completions/_nargo\n"})}),"\n",(0,i.jsx)(n.h2,{id:"installing-bash-completions",children:"Installing Bash Completions"}),"\n",(0,i.jsxs)(n.p,{children:["If you have ",(0,i.jsx)(n.a,{href:"https://github.com/scop/bash-completion",children:"bash-completion"})," installed, you can just copy the completion script to the ",(0,i.jsx)(n.code,{children:"/u
1sr/local/etc/bash_completion.d"})," directory:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"nargo generate-completion-script bash > /usr/local/etc/bash_completion.d/nargo\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Without ",(0,i.jsx)(n.code,{children:"bash-completion"}),", you\u2019ll need to source the completion script directly.\nFirst create a directory such as ",(0,i.jsx)(n.code,{children:"~/.bash_completions/"}),":"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"mkdir ~/.bash_completions/\n"})}),"\n",(0,i.jsx)(n.p,{children:"Copy the completion script to that directory:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"nargo generate-completion-script bash > ~/.bash_completions/nargo.bash\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Then add the following line to ",(0,i.jsx)(n.code,{children:"~/.bash_profile"})," or ",(0,i.jsx)(n.code,{children:"~/.bashrc"}),":"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"source ~/.bash_completions/nargo.bash\n"})}),"\n",(0,i.jsx)(n.h2,{id:"installing-fish-completions",children:"Installing Fish Completions"}),"\n",(0,i.jsxs)(n.p,{children:["Copy the completion script to any path listed in the environment variable ",(0,i.jsx)(n.code,{children:"$fish_completion_path"}),". For example, a typical location is ",(0,i.jsx)(n.code,{children:"~/.config/fish/completions/nargo.fish"}),":"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"nargo generate-completion-script fish > ~/.config/fish/completions/nargo.fish\n"})})]})}function d(e={}){const{wrapper:n}={...(0,l.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(h,{...e})}):h(e)}},28453(e,n,s){s.d(n,{R:()=>t,x:()=>c});var o=s(96540);const i={},l=o.createContext(i);function t(e){const n=o.useContext(l);return o.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(i):e.components||i:t(e.components),o.createElement(l.Provider,{value:n},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.