Feel free to use it experimentally.
Completions should be working now. You should see completions in your active workspace, which is the value of `cody–workspace-root’, typically the repo root for that workspace.
Cody currently supports one active workspace at a time. Files in the currently active workspace have a color Cody icon, and others are monochrome. You can also see the active workspace in `M-x cody-dashboard’.
Cody uses a distributed copy of the Cody agent as compressed javascript, but you can override this by specifying the location of the agent binary, e.g.:
(setq cody--agent-binary "/path/to/eg/cody/agent/dist/agent-macos-arm64")
Add to your ~/.authinfo.gpg something that looks like
machine `cody--sourcegraph-host' login apikey password sgp_SECRET
You can bypass this check by setting your access token directly, though this is less secure
(setq cody--access-token "sgp_etc")
To try it out, evaluate the buffer and `M-x cody-login`.
You can create a Sourcegraph access token at https://sourcegraph.com/users/yourname/settings/tokens.
;; Tell `use-package' where to find your clone of `cody.el'.
(add-to-list 'load-path (expand-file-name "~/my/path/to/emacs-cody"))
(use-package cody
:commands (cody-login cody-restart cody-chat cody-mode)
;; Some common key bindings.
:bind (("C-M-n" . cody-completion-cycle-next-key-dispatch)
("C-M-p" . cody-completion-cycle-prev-key-dispatch)
("M-TAB" . cody-completion-accept-key-dispatch)
("C-M-g" . cody-quit-key-dispatch))
:init
(setq cody--sourcegraph-host "sourcegraph.com") ; for clarity; this is the default.
(setq cody--access-token "sgp_asldkfjalsdkjfaslkdjfalsdkfj")
(setopt cody-workspace-root "/your/path/to/some/project/dir") ; optional
:config
(defalias 'cody-start 'cody-login))
Autocompletion is the main use case for now. Chat is just a stub.
- `M-x cody-login` will start Cody up and apply it to applicable buffers.
- `M-x cody-logout` shuts Cody down.
- `M-x cody-mode` toggles Cody on and off in a given buffer.