Skip to content

dilyorm/autocomplete

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

acomplete

Inline Tab autocomplete for the prompts you type into terminal coding agents — Claude Code, Codex, or any CLI. As you type, a grey ghost-text suggestion appears right after your cursor. Press Tab to accept, keep typing to ignore.

npm license node

acomplete demo

❯ add a dark mode toggle␣that persists the preference in localStorage
  └ you typed ──────────┘ └─ grey ghost text, press Tab ──────────────┘

Why

Terminal agents own their input box — there's no plugin hook for autocomplete. acomplete wraps the agent in a pseudo-terminal, watches what you type, and renders context-aware suggestions inline. It works with any terminal program; it's tuned for coding agents.

Features

  • Inline ghost text — dim suggestion at the cursor, not a popup.
  • Context-aware — uses your partial prompt, the recent conversation on screen, and your installed Claude Code skills.
  • One keyTab accepts the whole suggestion, accepts one word, Shift+Backspace undoes the last accept, typing dismisses.
  • Rephrase in placeCtrl+R rewrites your whole prompt to be clearer; Shift+Backspace puts the original back.
  • Zero-setup auth — reuses your existing Claude Code login by default. No API key needed.
  • Bring your own model — or plug in Anthropic / DeepSeek / OpenAI / Gemini.
  • Never in your way — on any error it degrades to a plain transparent passthrough.

Install

npm install -g acomplete

Or straight from GitHub:

npm install -g github:dilyorm/autocomplete

Requires Node ≥ 18.

Usage

Wrap any agent:

acomplete claude     # Claude Code
acomplete codex      # Codex
acomplete <anything> # any CLI

Type a prompt, pause briefly, and a grey suggestion appears. Tab to accept.

Key Action
Tab accept the whole suggestion
(Right arrow) accept one word
Ctrl+R rephrase the whole prompt in place
Shift+Backspace undo the last accept / rephrase
keep typing dismiss / refine

Configuration

acomplete config                       # show current config
acomplete config <key>=<value> ...     # set values
Key Values Default
mode auto · free · byo auto
provider anthropic · deepseek · openai · gemini anthropic
apiKey your provider key (for byo)
model model id (blank = a fast default)
debounceMs ms of idle before suggesting 400

Auth modes

  • auto (default) — reuses the Claude Code login token in ~/.claude/.credentials.json to call a fast model. Zero setup.
  • byo — your own provider key:
    acomplete config mode=byo provider=deepseek apiKey=sk-... model=deepseek-chat
  • free — a hosted, rate-limited proxy (set proxyUrl). (optional / self-host)

How it works

your keyboard ──▶ acomplete (PTY wrapper) ──▶ agent (claude / codex)
                     │  mirrors your prompt buffer from keystrokes
                     │  debounced call to a fast model for a completion
                     ▼
              grey ghost text drawn at the cursor; Tab injects it

It mirrors your input from raw keystrokes (decoding Windows win32-input-mode records), so it never has to parse the agent's screen. Suggestions come from a separate fast model call — the agent's own loop is too slow for live completion.

Limitations

  • Shift+Backspace undo needs a terminal that reports key modifiers (Windows win32-input-mode, kitty, or xterm modifyOtherKeys). On terminals that don't, it falls back to a plain backspace.
  • The ghost is truncated to the current row rather than wrapping, so it never collides with the agent's own footer.
  • auto mode reuses the Claude Code login token — convenient but undocumented; it falls back silently if the token is missing or rejected.
  • Bracketed-paste and Ctrl-modified characters are best-effort in the buffer mirror.

Roadmap

Contributing

Issues and PRs welcome. Run the tests:

npm test

Debug log (writes to ~/.acomplete/debug.log):

ACOMPLETE_DEBUG=1 acomplete claude

License

MIT © dilyorm

About

Inline Tab autocomplete (ghost text) for prompts you type into terminal coding agents — Claude Code, Codex, any CLI

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors