-
Notifications
You must be signed in to change notification settings - Fork 4
CLI Getting Started Completions Install
Writes completion scripts for the shells found on this Mac, and wires them into the shell profile.
ed completions install [--json] [--shell <zsh|bash|fish>]
Options
| Name | Type / values | Default | What it does |
|---|---|---|---|
--json |
flag | off | Emit JSON on stdout instead of one line per shell |
--shell <shell> |
zsh, bash or fish, lowercased before matching |
unset, meaning every detected shell | Install for one shell instead of all of them |
--json shape:
{
"installed": [
{
"hint": null,
"path": "/Users/pulkit/.zsh/completions/_ed",
"shell": "zsh"
},
{
"hint": "add to ~/.bashrc: source /Users/pulkit/.local/share/bash-completion/completions/ed",
"path": "/Users/pulkit/.local/share/bash-completion/completions/ed",
"shell": "bash"
}
]
}Examples
ed completions install
ed completions install --shell zsh
ed completions install --json
Detection is by evidence on disk. zsh is always included. bash is included when
~/.bashrc or ~/.bash_profile exists. fish is included when ~/.config/fish
exists.
Where each script lands:
zsh the first writable directory under $HOME in an interactive shell's
$fpath, else ~/.local/share/zsh/site-functions/_ed
bash ~/.local/share/bash-completion/completions/ed
fish ~/.config/fish/completions/ed.fish
The zsh case really does ask zsh: it runs /bin/zsh -ic 'print -l -- $fpath'
and takes the first entry under your home directory that exists, is a directory
and is writable, which is why a machine with ~/.zsh/completions on $fpath
gets the script there instead of in the fallback location.
Installing does three things beyond writing the file. It records the path in the
shared defaults under completionScriptPaths, which is what lets the app
rewrite an out-of-date script on launch when completionsAutoRefresh is on, and
that refresh only ever overwrites a file that already contains __complete. It
adds a managed block to ~/.zshrc for zsh and ~/.bashrc for bash, with
$HOME substituted back into the path:
# >>> edith completions >>>
source $HOME/.zsh/completions/_ed
# <<< edith completions <<<
And it prints the one line you may still need to add yourself, as hint. zsh
gets add to ~/.zshrc, before compinit: fpath=(<directory> $fpath) unless the
script went into a directory zsh already searches, in which case the hint is
null. bash gets add to ~/.bashrc: source <directory>/ed. fish never gets a
hint and never gets a profile edit, because fish loads that directory by itself.
The human output is one shell: path line per shell, with the hint indented two
spaces underneath it.
A --shell value that is not one of the three exits 3 before anything is
written:
$ ed completions install --shell nope
error: nope is not a supported shell
The shell is an option, not a positional, and completion offers the three names
in the positional slot as well. ed completions install zsh is rejected by the
parser and exits 2; write --shell zsh.
-
Getting started with
ed, the rest of this group - All
edcommands
Auto-generated from docs/, edit the docs in the repo, not the wiki.
CLI reference
Companion
- Deploy
- Concepts
- Concepts Memory
- Concepts Ingestion
- Concepts Search
- Concepts Chat
- Concepts Learning
- Concepts Brain
- Concepts Friend
- Hosts
- Stack
- Status
- Doctor
- Search
- Index
- Ingest
- Episodes
- Sync
- Observations
- Reflect
- Beliefs
- Ask
- Extract
- Claims
- Corroborate
- Runs
- Chat
- Conversations
- Forget
- Export
- Import
- Erase
- Wipe
- Episode
- Nightly
- Reason
- Personas
- Council
- Lenses
- Core
- Why
- Hypotheses
- Predictions
- Commitments
- Discrepancies
- Calibration
- Inquire
- Entities
- Eval
- Standup
- Machines
- Baselines
- Connectors
- Facts
- Correct
- Weekly
- Db
Guides