soon
The next command, before you type it.
A local-first terminal agent that predicts, repairs, and suggests your next full command.
Beta status: v0.4.1 ships the first opt-in Zsh ghost-suggestion loop plus a privacy-safe adoption report. Interactive integration is supported on native Linux and macOS; other shells and packaged platforms remain experimental unless listed in the release contract.
Try the beta
Install the same v0.4.1 release through Cargo or PyPI:
cargo install soon
# or: python -m pip install soon-bin
Enable the integration for the current Zsh session:
eval "$(soon init zsh)"
At an empty prompt, soon computes in the background and renders one dim full-command suggestion. Press Ctrl-F to place it in the editable buffer, then review, edit, or run it yourself. Start typing to ignore it. soon never presses Enter for you.
The default prediction path uses local history, not a model or network service. It can choose a Next-step suggestion after success, a Repair suggestion after failure, or predict on demand when you run soon.
The idea
Your shell already knows what you typed. soon asks a different question: given the workflow you just followed, what complete command are you likely to run next?
The agent is a small local feedback loop:
- Observe the completed command and its result.
- Remember only safe, useful local context.
- Rank complete commands from recurring transitions.
- Render one editable ghost suggestion without blocking the prompt.
- Learn whether it was accepted, executed, or dismissed.
Why another shell tool?
| Tool category | You provide | It returns |
|---|---|---|
| History search, including Atuin and McFly | A query or key chord | A past command matching the search |
| Prefix autosuggestions in Fish or Zsh | The beginning of a command | A completion for that prefix |
| Prompt-driven command generation | A natural-language request | A newly generated command |
| soon's target interaction | An empty prompt after a familiar workflow | One predicted full command, locally |
soon is not trying to replace search or completion. The product succeeds only if accepting a correct prediction is faster than recalling and typing the command yourself.
Keep it enabled
Add the same eval line to ~/.zshrc. When no suggestion is visible, Ctrl-F keeps its previous behavior. To remove the hooks and restore the previous binding in the current session, run:
soon-disable
The last background prediction latency is available without printing command content:
print -r -- "$SOON_LAST_LATENCY_MS ms"
Cargo and PyPI are published together from one versioned tag. AUR and standalone binaries remain unsupported until they have tested artifact workflows. To install the current development branch instead:
cargo install --git https://github.com/HsiangNianian/soon
The supported interactive beta surface is Zsh on Linux and macOS. Other history parsers and packaged platforms remain on-demand or experimental. Maintainer guarantees are documented in RELEASING.md.
Use the current prototype
# Predict one full command from the detected shell history
soon
# Inspect the matching evidence
soon --debug
# Confirm which shell and history source were detected
soon which
# Show the most common executables in local history
soon stats
# Measure the current policy against past local transitions
soon replay
# Export aggregate adoption metrics that are safe to share
soon report
soon report --json
Override shell detection when needed:
soon --shell zsh
The current source can parse Bash, Zsh, Fish, Nushell, Elvish, PowerShell, and tcsh history. Parsing a format does not mean interactive integration for that shell is complete.
What v0.4 ships
| Shipped surface | Release evidence |
|---|---|
| On-demand command plus opt-in Zsh loop | Clean-session install-to-uninstall smoke test |
| Manual, successful-command Next-step, and failed-command Repair triggers | Native Linux and macOS lifecycle regression coverage |
| Retained events plus chronological quality and latency replay | Deterministic fixture with a 20 ms Zsh p95 budget |
| Sensitive-command filters plus idempotent Zsh history import | Documented privacy behavior and aggregate-only inspection |
The implementation plan lives in RFC #4. Work is tracked in the public Personal Terminal Agent Project.
How the current predictor works
- Detect the active shell and read its history file.
- Reduce recent commands to executable names only for matching workflow context.
- Keep each candidate as the complete historical command, including arguments.
- Accumulate repeated transition evidence and weight newer evidence more heavily.
- Print the highest-ranked full command without presenting the heuristic as calibrated confidence.
This baseline is deliberately simple. A more complex ranker must beat it under soon replay before it replaces the deterministic hot path.
Agent roadmap
The v0.4 Local Agent MVP combines safe command lifecycle events, explicit soon, Next-step after success, Repair after failure, a private history-import path, and measured local replay.
The v0.4.1 Adoption Sprint makes that loop easy to discover, validates it with ten Zsh users, and adds a privacy-safe report before the prediction policy becomes more complex.
The v0.5 Hybrid Prediction Engine then measures a contextual probabilistic ranker in #16 before adding opt-in local-model and OpenAI-compatible candidate sources in #17. Model output is never required for the default hot path.
Privacy
soon, soon now, soon replay, soon report, soon init zsh, and the local learning commands read files on your machine and do not require a network service. The Zsh integration invokes the local predictor in a background process; it does not upload history or block the prompt while waiting for a result.
The current source rejects likely inline API keys, tokens, authorization headers, password flags, private-key material, and known credential prefixes before storing a command or suggestion. It applies the same filter again before ranking or rendering shell history, old event data, legacy learn data, provider context, and model output. Rejections report a category, not the command text.
Add exact case-sensitive exclusions or regular-expression exclusions without editing stored data:
soon config set privacy.excluded_literals 'company-deploy --production'
soon config set privacy.excluded_patterns '(?i)^kubectl .*--context production'
Comma-separated values configure more than one exclusion. Literal values are redacted from soon config, config get, and successful config set output. Invalid regular expressions are rejected before the configuration is saved.
soon learn ask is different: it is an optional experimental path that sends only filtered recent commands and the current directory to the OpenAI-compatible or Ollama endpoint you configure. It does not send event IDs, exit codes, feedback, stdout, or stderr. Model candidates pass through the same local filter before display.
Provider credentials are read at request time from an environment variable and are never stored or printed by soon. The default variable is SOON_LLM_API_KEY; configure a different variable name with llm.api_key_env. For example, this Zsh flow keeps the value out of shell history:
soon config set llm.provider openai
soon config set llm.api_url https://api.openai.com
read -rs 'SOON_LLM_API_KEY?API key: '
print
export SOON_LLM_API_KEY
Ollama can run without a credential. The legacy llm.api_key setting is rejected.
The Zsh lifecycle integration stores local command and suggestion events in a retained JSONL log under the operating system's application-data directory. Inspect its exact path, schema version, retention, and aggregate counts without printing command text:
soon events inspect
The default retention is 10,000 events. It is user-controlled, and clearing requires explicit confirmation:
soon config set events.retention 5000
soon events clear --yes
Give a fresh profile useful event memory by previewing a Zsh history import first:
# Uses ~/.zsh_history
soon events import-zsh --preview
soon events import-zsh
# Or pass current and rotated files explicitly, oldest first
soon events import-zsh --preview \
--path ~/.zsh_history.1 \
--path ~/.zsh_history
soon events import-zsh \
--path ~/.zsh_history.1 \
--path ~/.zsh_history
Plain command-per-line history and Zsh extended history (: <epoch>:<duration>;<command>) are supported. Extended timestamps and durations are preserved; unavailable cwd, exit status, and plain-history timestamps remain unknown. Preview and import summaries report importable, sensitive, malformed, duplicate, and already-imported counts without printing command text. Stable event IDs make repeated imports idempotent, including identical rotated files.
Measure the deterministic policy against that local event memory:
soon replay
Replay follows JSONL append order rather than event timestamps. For each linked command transition it predicts first, scores the result, and only then exposes that transition to later samples, so future observations cannot leak into training. Unknown exit status is classified as manual; exit status zero is next-step; any other status is repair.
Samples counts eligible linked transitions. Coverage is predictions divided by samples, and top-1 match is exact command matches divided by all samples. Overall and per-trigger rows include p50/p95 prediction latency. Candidate-source rows compare deterministic history with contextual policy, local model, or remote-provider suggestions when those sources have recorded a shown event before the actual next command. Model attempts aligned to a later command also report timeout, invalid-output, and deterministic-fallback rates.
The report is aggregate-only: it prints no command text and performs no upload. The deterministic CI fixture has a Zsh hot-path p95 budget of 20 ms; soon replay prints PASS or FAIL against that budget on the current local event set.
Export the smaller adoption report when sharing beta feedback:
soon report
soon report --json
This is an explicit, offline read of the same local event store. Both forms contain aggregate counters and latency distributions only—never raw commands, arguments, paths, hostnames, usernames, event IDs, timestamps, or database rows. The human form is designed for an issue or discussion; --json is suitable for scripts and uses schema version 2:
| JSON field | Meaning |
|---|---|
schema_version |
Report schema version; currently 2 |
samples.eligible_transitions |
Linked command transitions eligible for chronological replay |
samples.predictions |
Eligible transitions for which the deterministic replay produced a prediction |
samples.prediction_coverage_percent |
predictions / eligible_transitions * 100 |
suggestions.shown |
Retained suggestion events with the shown outcome |
suggestions.accepted |
Retained suggestion events with the accepted outcome |
suggestions.acceptance_percent |
accepted / shown * 100 |
suggestions.executed |
Retained suggestion events with the executed outcome |
suggestions.execution_percent |
executed / shown * 100 |
latency_ms.replay.samples |
Eligible transitions benchmarked by chronological replay |
latency_ms.replay.p50, latency_ms.replay.p95 |
Offline replay-computation percentiles in milliseconds |
latency_ms.suggestion.samples |
Valid shell-observed latency samples from shown events |
latency_ms.suggestion.p50, latency_ms.suggestion.p95 |
Shell-observed suggestion-result percentiles in milliseconds |
A percentage is null when its denominator is zero. Each latency distribution has an explicit sample count and returns null percentiles when that count is zero. Suggestion latency counts only valid non-negative shown rows, so later accepted, executed, or dismissed outcomes do not duplicate one displayed suggestion. Human output prints n/a for unavailable distributions.
Schema version 2 replaces the version 1 latency_ms.p50 and latency_ms.p95 fields with latency_ms.replay and latency_ms.suggestion. Use the suggestion distribution for user-facing adoption studies and the replay distribution for policy benchmarking.
Config lives at ~/.config/soon/config.toml:
soon config init
soon config path
soon config get general.ngram
soon config set general.ngram 5
soon config set update.channel cargo # or pip
Commands
soon Predict the next full command
soon now Run the same prediction explicitly
soon init zsh Print the opt-in Zsh integration
soon stats Show the most-used executables
soon which Show shell and history diagnostics
soon config View or change local configuration
soon events Inspect, clear, or import local agent events
soon replay Measure local prediction quality and latency
soon report Export privacy-safe aggregate adoption metrics
soon learn Use the experimental learning tools
soon update Check the configured release channel
Contributing
Start with RFC #4, then choose an unblocked issue from the v0.4.1 Adoption Sprint. The contextual ranker and optional model sources remain sequenced behind real-user validation.
For local verification:
cargo fmt --check
cargo test --locked
cargo clippy --locked --all-targets -- -D warnings
cargo run --locked -- --help
License
MIT © 2025-present HsiangNianian
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file soon_bin-0.4.1.tar.gz.
File metadata
- Download URL: soon_bin-0.4.1.tar.gz
- Upload date:
- Size: 123.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.14.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
36f2fd95f0053f51881dadb8bcb99a27fb183e2da1ceeb8db42728ec255a1024
|
|
| MD5 |
2a8a49468e22810f0e72a928b75e209d
|
|
| BLAKE2b-256 |
fc3d0713f965e10f44ec70385270b25e7ffbd49a7fac2bcd0042df1ec61610ab
|
File details
Details for the file soon_bin-0.4.1-py3-none-win_amd64.whl.
File metadata
- Download URL: soon_bin-0.4.1-py3-none-win_amd64.whl
- Upload date:
- Size: 2.5 MB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.14.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6be1584002938996773b6a0fe8b4c1f1af769eb4c0a618e497c0b4e692a330b1
|
|
| MD5 |
ddd410d09f43946e98904a515d2c1f68
|
|
| BLAKE2b-256 |
7c29615a37006a4b670eba5c134cbdf28bd9c190e7ad3c7a43ddf1f7c277afae
|
File details
Details for the file soon_bin-0.4.1-py3-none-win32.whl.
File metadata
- Download URL: soon_bin-0.4.1-py3-none-win32.whl
- Upload date:
- Size: 2.1 MB
- Tags: Python 3, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.14.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d74d655c121c20535f071f6d7d12a18c8e4e0fad5224d6d2d3693116f2395262
|
|
| MD5 |
0ea0d8e61b4565302b9ed8df25e559f8
|
|
| BLAKE2b-256 |
11f1b67cb925a306fe8591d551b6a1c61159282cedccae94628ea0fbd609d23c
|
File details
Details for the file soon_bin-0.4.1-py3-none-musllinux_1_2_x86_64.whl.
File metadata
- Download URL: soon_bin-0.4.1-py3-none-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 3.1 MB
- Tags: Python 3, musllinux: musl 1.2+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.14.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a621570cc87bf0d3ee5747a26711a088c1e44253fba519ba5a8b02a278861a0
|
|
| MD5 |
795fd0c7a03f1c394ba284f6c60a4e31
|
|
| BLAKE2b-256 |
0d4c7a2f3fb9c9743fe8fea5914e2f0c36db02d4d0544d8bc3cab4d6c990c0cc
|
File details
Details for the file soon_bin-0.4.1-py3-none-musllinux_1_2_i686.whl.
File metadata
- Download URL: soon_bin-0.4.1-py3-none-musllinux_1_2_i686.whl
- Upload date:
- Size: 2.9 MB
- Tags: Python 3, musllinux: musl 1.2+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.14.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a906134245d77e3cd84c13409045884639fc0f8143d8c3cbf1e020883ecda8e0
|
|
| MD5 |
516adc1d9d990b68a8a71dd6ba71897f
|
|
| BLAKE2b-256 |
0fcdf2f464f6bb0b16c5d5f398102e9d12f9a716b2447f5536bf70b598f243b9
|
File details
Details for the file soon_bin-0.4.1-py3-none-musllinux_1_2_armv7l.whl.
File metadata
- Download URL: soon_bin-0.4.1-py3-none-musllinux_1_2_armv7l.whl
- Upload date:
- Size: 2.7 MB
- Tags: Python 3, musllinux: musl 1.2+ ARMv7l
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.14.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ce9c182046535d8918ee2f2ae68fbaec6641a75ce01ec76640a9cb7a3fd925af
|
|
| MD5 |
310c8a7ed2e4ade1dc3961af9647b40e
|
|
| BLAKE2b-256 |
208d754995d913b9398e20dfdd26baf9e2ccf77440ae045757d9a619867004fc
|
File details
Details for the file soon_bin-0.4.1-py3-none-musllinux_1_2_aarch64.whl.
File metadata
- Download URL: soon_bin-0.4.1-py3-none-musllinux_1_2_aarch64.whl
- Upload date:
- Size: 3.0 MB
- Tags: Python 3, musllinux: musl 1.2+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.14.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
286d572d7e077c0894533247594fdd7748bedfb03cca44821412cb41e27f4320
|
|
| MD5 |
ba69ec03d5e891d4a25e32aeee17c93a
|
|
| BLAKE2b-256 |
5e54d6c6e0c6976d946c7175afef54da573543ee0560f6d84404aaf646040d78
|
File details
Details for the file soon_bin-0.4.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: soon_bin-0.4.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 2.9 MB
- Tags: Python 3, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.14.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e9c4c043f9545e40364163e8d84813b33aeed7b181fde5482533725f332dc8f0
|
|
| MD5 |
8b259afb25d7bb8e898f9d01b716c802
|
|
| BLAKE2b-256 |
3a8520ad876601aa9cd72add7174ae13c32b6cc0561d29f16a04cc985b2ef27f
|
File details
Details for the file soon_bin-0.4.1-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl.
File metadata
- Download URL: soon_bin-0.4.1-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
- Upload date:
- Size: 2.9 MB
- Tags: Python 3, manylinux: glibc 2.17+ s390x
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.14.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee66ba875cdac245711975e635eba0e525576b71ba7f4ad8596cc6026b4219b9
|
|
| MD5 |
80d860a9f3a71220d4e68cec3737b127
|
|
| BLAKE2b-256 |
e821d83124e4dcec6986cb7182b51df2062322f613760c8ee4ca430c89a4c8dd
|
File details
Details for the file soon_bin-0.4.1-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl.
File metadata
- Download URL: soon_bin-0.4.1-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
- Upload date:
- Size: 3.3 MB
- Tags: Python 3, manylinux: glibc 2.17+ ppc64le
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.14.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7b9d43837d2af4664ec1e27dbd171f9a8619e819534cb0b35f29fca4cb40042d
|
|
| MD5 |
0fbb432f481d14a6599fd412381df4f0
|
|
| BLAKE2b-256 |
cfe44b332125733d44fafc15d618fd1ed440d7f20df6db2670fdae522f554c2a
|
File details
Details for the file soon_bin-0.4.1-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl.
File metadata
- Download URL: soon_bin-0.4.1-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 3.0 MB
- Tags: Python 3, manylinux: glibc 2.17+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.14.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
926a816fd74a40a3c2f09f7e64cc1507fa1863ce737384297b983aec3e5ca235
|
|
| MD5 |
504fba72dfe30930655c3d9e75b7760d
|
|
| BLAKE2b-256 |
f85331f36addb5d612be1858c6dc28b27d844d2843421d7a04481155b64cd0b2
|
File details
Details for the file soon_bin-0.4.1-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.
File metadata
- Download URL: soon_bin-0.4.1-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
- Upload date:
- Size: 2.7 MB
- Tags: Python 3, manylinux: glibc 2.17+ ARMv7l
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.14.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f544a4c6578b3b4cfe43ed6c27ed35fadf6e1d3b39a5ababe9b85a4b1711ea9c
|
|
| MD5 |
70dbacc81e5ae28ff7436f59558c5e6f
|
|
| BLAKE2b-256 |
3b7552ae804a38860064609b51eaf3b08493009af9c81b9c8c9e456a305fc1e8
|
File details
Details for the file soon_bin-0.4.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: soon_bin-0.4.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 2.9 MB
- Tags: Python 3, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.14.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da725a5f3057e609b8990521ac368e8d807b9856d87477289a2862cca17aa379
|
|
| MD5 |
879822044316aef1987ec7a825fb9c26
|
|
| BLAKE2b-256 |
e74f652dda20e4d32ca8ea499d7e6467181be0a6a01908988892bdc3cd37c03f
|
File details
Details for the file soon_bin-0.4.1-py3-none-macosx_11_0_arm64.whl.
File metadata
- Download URL: soon_bin-0.4.1-py3-none-macosx_11_0_arm64.whl
- Upload date:
- Size: 2.7 MB
- Tags: Python 3, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.14.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
537657af73358071834844698fc090e9beefff12636f704184425393e7b42a64
|
|
| MD5 |
da289b6b0dd8437883179f7ae88a50a2
|
|
| BLAKE2b-256 |
f8b0c086c43d66d9049f433d3b9071441b0acca7f3eec1f6bd25f7d87c308b62
|