soon
The next command, before you type it.
A local-first personal terminal agent that learns recurring workflows and predicts the next full command.
Beta status: v0.4 ships the first opt-in Zsh ghost-suggestion loop. Interactive integration is supported on native Linux and macOS; other shells and packaged platforms remain experimental unless listed in the release contract.
The idea
Your shell already knows what you typed. soon is exploring 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 command events, remember useful context, rank safe candidates, render one suggestion, and learn when it is accepted or ignored. It proposes editable commands; it never executes them automatically.
# After this transition has appeared in your local history more than once:
$ git pull --rebase
$ cargo test --workspace
# The next time the same context appears:
$ git pull --rebase
$ soon
You might run next:
> cargo test --workspace
The current suggestion is selected from local history. It is not generated by a model, and the default prediction path does not use the network. Future model-backed candidates remain optional and must pass through the same ranking and safety gates.
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.
Install
Install the same release through Cargo or PyPI:
cargo install soon
python -m pip install soon-bin
Cargo and PyPI are published together from one versioned tag. AUR and standalone binaries remain explicitly unsupported until they have their own tested artifact workflows.
To install the current development branch instead:
cargo install --git https://github.com/HsiangNianian/soon
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, or start typing to ignore it. Ctrl-F keeps its previous behavior when no suggestion is visible.
To enable it in future sessions, add the same eval line to ~/.zshrc. To remove the hooks and restore the previous Ctrl-F 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"
The supported interactive beta surface is Zsh on Linux and macOS. Other history parsers and packaged platforms remain on-demand or experimental surfaces rather than a claim of complete shell integration. Maintainer release 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
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.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 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.
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 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.5 milestone. Each issue is a small end-to-end behavior with explicit acceptance criteria and blockers.
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.0.tar.gz.
File metadata
- Download URL: soon_bin-0.4.0.tar.gz
- Upload date:
- Size: 109.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.14.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d61cf6fc43b088c9337b3ae6455dffbd0419ebe0f5e442fd3237dba1060854d4
|
|
| MD5 |
ff3985a54e9bf576e7a8a4026b7dfa4b
|
|
| BLAKE2b-256 |
ee7330e36cef0a902e768b4b10371078674a76a6949a310f4fac18f5f2d001c4
|
File details
Details for the file soon_bin-0.4.0-py3-none-win_amd64.whl.
File metadata
- Download URL: soon_bin-0.4.0-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 |
830d6b447f35628cd0158046757a64981f03e6cab21a0591c6404f04e08c5443
|
|
| MD5 |
7a746cba9ee1b970ce6b66a9ff29138d
|
|
| BLAKE2b-256 |
2e84a99af0131a3409a7dcb2431948c0eed2e287f5b7dfeb80d6a47e5135d158
|
File details
Details for the file soon_bin-0.4.0-py3-none-win32.whl.
File metadata
- Download URL: soon_bin-0.4.0-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 |
d83d40939a1e26ec1039c9290bd45648ec4d74deb4c1ac0e655fb54957a79ae9
|
|
| MD5 |
d883db8bd8659f7c0bee102836a4c5ba
|
|
| BLAKE2b-256 |
3b461c07e12456fc0da8e7b2087c6a153174afa1ba5aa5cd39c0d9a331bc7fad
|
File details
Details for the file soon_bin-0.4.0-py3-none-musllinux_1_2_x86_64.whl.
File metadata
- Download URL: soon_bin-0.4.0-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 |
dfc2f3328eb920debf2cc41833539c21d9c4a9dee8da3170ad85911e769169bd
|
|
| MD5 |
7cc0a01ed3dc800956da2045debc0535
|
|
| BLAKE2b-256 |
b3c412abda71500cfe31b45c366ddf815d6f3856253b6cd8f25f0092d6cbadff
|
File details
Details for the file soon_bin-0.4.0-py3-none-musllinux_1_2_i686.whl.
File metadata
- Download URL: soon_bin-0.4.0-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 |
6760b7fddf8510b56b7ad6a10da2212853b1b217be3a40e27492e7212c76a8cd
|
|
| MD5 |
c4fe14fa15fceaf247d36cbeeaa89bd2
|
|
| BLAKE2b-256 |
4434cf05466233ba1811a0031c813556442d6c2516d1be0e8bb2a1707033b16d
|
File details
Details for the file soon_bin-0.4.0-py3-none-musllinux_1_2_armv7l.whl.
File metadata
- Download URL: soon_bin-0.4.0-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 |
1d346f0da9598ba3ba35ae334ae4ed2f95c80840430c2a7e2cab5acd4f0f45c2
|
|
| MD5 |
0be8982ff85a4f205385a4d7f6cfebca
|
|
| BLAKE2b-256 |
269d06ef7802da9e1ebfdc1c13d7f3c82a80f2efe3076ed6cbdec135935ae0cb
|
File details
Details for the file soon_bin-0.4.0-py3-none-musllinux_1_2_aarch64.whl.
File metadata
- Download URL: soon_bin-0.4.0-py3-none-musllinux_1_2_aarch64.whl
- Upload date:
- Size: 2.9 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 |
c0aa6b98e7b0deec7cdfe206039eada1096dc665d29ae207ae21b2501907a6a6
|
|
| MD5 |
fe45d8904bc09b6272ffac6ce7084200
|
|
| BLAKE2b-256 |
775a006f2e8a5c3bb18c57f85e8d692671958dd764af44ab4f06fa7a3529d6cf
|
File details
Details for the file soon_bin-0.4.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: soon_bin-0.4.0-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 |
8c611fd51fd7b0997e60094009f6943e429544d477971667edf5155efef4518d
|
|
| MD5 |
9ca38c1ca2c2f7df03259412eb283439
|
|
| BLAKE2b-256 |
eb7933fef9a1ec53933e662201066daa845a81875297597d87c2c98d4262f8e5
|
File details
Details for the file soon_bin-0.4.0-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl.
File metadata
- Download URL: soon_bin-0.4.0-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 |
fa28253db1a0eebdb213c073262b66ea6042fbbebd59961980d199025eb0fc34
|
|
| MD5 |
1facc2f61f2c7dc0de517e2bb72a8a01
|
|
| BLAKE2b-256 |
df79b08fe8df89a2a499dec8e9e9c3d3a045c3e925178432986539af512e26bb
|
File details
Details for the file soon_bin-0.4.0-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl.
File metadata
- Download URL: soon_bin-0.4.0-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 |
2764a5a436ff9dbcf8b47f5e9a7aab4c7dd9e312f567da2dacd5865fc25746eb
|
|
| MD5 |
917e544e8c8c3433039688b1ca24da02
|
|
| BLAKE2b-256 |
5741330309eca80f435d901b2caeb92fbd3d89b941dfbe8832dadc18bdf5ee50
|
File details
Details for the file soon_bin-0.4.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl.
File metadata
- Download URL: soon_bin-0.4.0-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 |
23e8ee3b7400e28c56d10d0d70aea8b7b505c637151dafa841d9b44ebdb18ed5
|
|
| MD5 |
e58c0891526618158a5266645e98c534
|
|
| BLAKE2b-256 |
029c544cc68a58d0f14b5a901ac8a555df4fe05bec8017c67be8106459b51fbe
|
File details
Details for the file soon_bin-0.4.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.
File metadata
- Download URL: soon_bin-0.4.0-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 |
c7276da9b38c39a7235a5e77fc9e342b53cc2114ee73ef780b1d0f9ae069a5b4
|
|
| MD5 |
112d4cc704be94525cbe380f163250c8
|
|
| BLAKE2b-256 |
fa6c8f2431c152126d6316460c0f952b81a0af16929f59ffbf3aeba6983c494a
|
File details
Details for the file soon_bin-0.4.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: soon_bin-0.4.0-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 |
ce1efeb4ecf0364f4bc5a9ab8c0bb2342c85760e3d65c50d1020fa608a9a1047
|
|
| MD5 |
2ed10f6918bc73ca7ca2822346f49223
|
|
| BLAKE2b-256 |
f96deabea64f529bb722ae16d7000683c89c89d6d5ecb263920b9b021f25ad05
|
File details
Details for the file soon_bin-0.4.0-py3-none-macosx_11_0_arm64.whl.
File metadata
- Download URL: soon_bin-0.4.0-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 |
c5b069eda15e2d4c9b7e3f5caf49e38acf65ac05a2a2654f7f4504e435af0eef
|
|
| MD5 |
e201307255627f790e9a82d9f11414fe
|
|
| BLAKE2b-256 |
79b7223cf6c4f9d4f55dae5bf94dceff84ee5eba32caff4423624074c1b0ad45
|