5 releases
0.1.6 | May 29, 2025 |
---|---|
0.1.5 | May 27, 2025 |
0.1.2 | May 24, 2025 |
0.1.1 | May 24, 2025 |
#67 in Machine learning
202 downloads per month
23KB
479 lines
Soon
🤖 Predict your next shell command based on history — like shell autocomplete, but MORE stupid
- 🐚 Shell-aware (supports Bash, Zsh, Fish)
- 📊 Shows your most used commands
- 🌍 i18n support (EN/中文) (WIP)
- 💡 Designed for clarity — not an autocomplete tool, but a prediction assistant.
Install
- Archlinux
paru -Sy soon
- Cargo
cargo install soon
- Python
pip install soon-bin
Usage
»»»» soon help 0|00:00:54
Predict your next shell command based on history
Usage: soon [OPTIONS] [COMMAND]
Commands:
now Show the most likely next command
stats Show most used commands
learn Train prediction (WIP)
which Display detected current shell
version Show version information
update Update self [WIP]
show-cache Show cached main commands
show-internal-cache Show internal cache commands
cache Cache a command to soon cache (for testing)
help Print this message or the help of the given subcommand(s)
Options:
--shell <SHELL>
--ngram <NGRAM> [default: 3]
--debug Enable debug output
-h, --help Print help
-V, --version Print version
Main Commands
Command | Description |
---|---|
now |
Show the most likely next command |
stats |
Show most used commands |
learn |
Train prediction (WIP) |
which |
Display detected current shell |
version |
Show version information |
update |
Update self (WIP) |
show-cache |
Show cached main commands |
show-internal-cache |
Show internal cache commands |
cache <NUM> |
Set cache size to <NUM> and refresh cache |
help |
Print this message or the help of subcommands |
Options
Option | Description |
---|---|
--shell <SHELL> |
Specify shell type (bash, zsh, fish, etc.) |
--ngram <NGRAM> |
Set n-gram length for prediction (default: 3) |
--debug |
Enable debug output |
-h, --help |
Print help |
-V, --version |
Print version |
Examples
Predict your next command (default ngram=3)
soon now
Show your most used commands
soon stats
Show cached main commands (default ngram=3)
soon show-cache
Show cached main commands with custom cache size (e.g., 10)
soon cache 10
soon show-cache --ngram 10
Set shell type explicitly (if auto-detect fails)
soon now --shell zsh
Enable debug output
soon now --debug
How cache works
- The
.soon_cache
file always contains the latest N main commands (N = cache size). - Every time you run
soon now
,soon cache <NUM>
, orsoon show-cache
, the cache is refreshed from your shell history. - The cache size is controlled by the
<NUM>
argument insoon cache <NUM>
or by--ngram <NGRAM>
option.
Dependencies
~1.3–8MB
~68K SLoC