Skip to content

Repository files navigation

codelex

Terminal-native syntax recall for developers who switch languages daily.

Fuzzy-search a local SQLite database of curated, idiomatic code snippets -- codelex rs match prints Rust's match in two keystrokes. Compares how the same concept is expressed across languages, and keeps per-language session scratchpads with bookmarks and pins.

Single Rust binary. No network, no account, no telemetry.

Install

cargo install --git https://github.com/yugaaank/lexcode

Or build from source:

git clone https://github.com/yugaaank/lexcode
cd lexcode
cargo build --release

Requires a Rust toolchain (edition 2024).

Usage

codelex rs match              # Rust match syntax
codelex py "list comprehension"
codelex go error-handling

Flags:

codelex rs match --more       # topic metadata + related concepts
codelex rs match --raw        # snippets only, no chrome
codelex rs match --json       # machine-readable output

Compare across languages:

codelex compare "error handling" --raw
codelex compare "async await" --json

Interactive TUI (default when run with no arguments):

codelex

Snippet pack management:

codelex sync                  # load packs from disk into the DB
codelex validate              # check pack/store integrity
codelex paths                 # print config / data / packs directories

Sessions (per-language scratchpads):

codelex session create rust-week -l rust
codelex session switch rust-week
codelex session bookmarks
codelex session pins

License

MIT

About

Codelex is a terminal-native syntax recall system for polyglot developers, retrieving curated, idiomatic code snippets from a local SQLite database instantly.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages