Skip to main content

soon

The next command, before you type it.

A local-first personal terminal agent that learns recurring workflows and predicts the next full command.

crates.io CI License: MIT

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

  1. Detect the active shell and read its history file.
  2. Reduce recent commands to executable names only for matching workflow context.
  3. Keep each candidate as the complete historical command, including arguments.
  4. Accumulate repeated transition evidence and weight newer evidence more heavily.
  5. 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

soon_bin-0.4.0.tar.gz (109.0 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

soon_bin-0.4.0-py3-none-win_amd64.whl (2.5 MB view details)

Uploaded Python 3Windows x86-64

soon_bin-0.4.0-py3-none-win32.whl (2.1 MB view details)

Uploaded Python 3Windows x86

soon_bin-0.4.0-py3-none-musllinux_1_2_x86_64.whl (3.1 MB view details)

Uploaded Python 3musllinux: musl 1.2+ x86-64

soon_bin-0.4.0-py3-none-musllinux_1_2_i686.whl (2.9 MB view details)

Uploaded Python 3musllinux: musl 1.2+ i686

soon_bin-0.4.0-py3-none-musllinux_1_2_armv7l.whl (2.7 MB view details)

Uploaded Python 3musllinux: musl 1.2+ ARMv7l

soon_bin-0.4.0-py3-none-musllinux_1_2_aarch64.whl (2.9 MB view details)

Uploaded Python 3musllinux: musl 1.2+ ARM64

soon_bin-0.4.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.9 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

soon_bin-0.4.0-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl (2.9 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ s390x

soon_bin-0.4.0-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (3.3 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ppc64le

soon_bin-0.4.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl (3.0 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ i686

soon_bin-0.4.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (2.7 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARMv7l

soon_bin-0.4.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.9 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

soon_bin-0.4.0-py3-none-macosx_11_0_arm64.whl (2.7 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

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

Hashes for soon_bin-0.4.0.tar.gz
Algorithm Hash digest
SHA256 d61cf6fc43b088c9337b3ae6455dffbd0419ebe0f5e442fd3237dba1060854d4
MD5 ff3985a54e9bf576e7a8a4026b7dfa4b
BLAKE2b-256 ee7330e36cef0a902e768b4b10371078674a76a6949a310f4fac18f5f2d001c4

See more details on using hashes here.

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

Hashes for soon_bin-0.4.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 830d6b447f35628cd0158046757a64981f03e6cab21a0591c6404f04e08c5443
MD5 7a746cba9ee1b970ce6b66a9ff29138d
BLAKE2b-256 2e84a99af0131a3409a7dcb2431948c0eed2e287f5b7dfeb80d6a47e5135d158

See more details on using hashes here.

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

Hashes for soon_bin-0.4.0-py3-none-win32.whl
Algorithm Hash digest
SHA256 d83d40939a1e26ec1039c9290bd45648ec4d74deb4c1ac0e655fb54957a79ae9
MD5 d883db8bd8659f7c0bee102836a4c5ba
BLAKE2b-256 3b461c07e12456fc0da8e7b2087c6a153174afa1ba5aa5cd39c0d9a331bc7fad

See more details on using hashes here.

File details

Details for the file soon_bin-0.4.0-py3-none-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for soon_bin-0.4.0-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 dfc2f3328eb920debf2cc41833539c21d9c4a9dee8da3170ad85911e769169bd
MD5 7cc0a01ed3dc800956da2045debc0535
BLAKE2b-256 b3c412abda71500cfe31b45c366ddf815d6f3856253b6cd8f25f0092d6cbadff

See more details on using hashes here.

File details

Details for the file soon_bin-0.4.0-py3-none-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for soon_bin-0.4.0-py3-none-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 6760b7fddf8510b56b7ad6a10da2212853b1b217be3a40e27492e7212c76a8cd
MD5 c4fe14fa15fceaf247d36cbeeaa89bd2
BLAKE2b-256 4434cf05466233ba1811a0031c813556442d6c2516d1be0e8bb2a1707033b16d

See more details on using hashes here.

File details

Details for the file soon_bin-0.4.0-py3-none-musllinux_1_2_armv7l.whl.

File metadata

File hashes

Hashes for soon_bin-0.4.0-py3-none-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 1d346f0da9598ba3ba35ae334ae4ed2f95c80840430c2a7e2cab5acd4f0f45c2
MD5 0be8982ff85a4f205385a4d7f6cfebca
BLAKE2b-256 269d06ef7802da9e1ebfdc1c13d7f3c82a80f2efe3076ed6cbdec135935ae0cb

See more details on using hashes here.

File details

Details for the file soon_bin-0.4.0-py3-none-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for soon_bin-0.4.0-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 c0aa6b98e7b0deec7cdfe206039eada1096dc665d29ae207ae21b2501907a6a6
MD5 fe45d8904bc09b6272ffac6ce7084200
BLAKE2b-256 775a006f2e8a5c3bb18c57f85e8d692671958dd764af44ab4f06fa7a3529d6cf

See more details on using hashes here.

File details

Details for the file soon_bin-0.4.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for soon_bin-0.4.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8c611fd51fd7b0997e60094009f6943e429544d477971667edf5155efef4518d
MD5 9ca38c1ca2c2f7df03259412eb283439
BLAKE2b-256 eb7933fef9a1ec53933e662201066daa845a81875297597d87c2c98d4262f8e5

See more details on using hashes here.

File details

Details for the file soon_bin-0.4.0-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl.

File metadata

File hashes

Hashes for soon_bin-0.4.0-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 fa28253db1a0eebdb213c073262b66ea6042fbbebd59961980d199025eb0fc34
MD5 1facc2f61f2c7dc0de517e2bb72a8a01
BLAKE2b-256 df79b08fe8df89a2a499dec8e9e9c3d3a045c3e925178432986539af512e26bb

See more details on using hashes here.

File details

Details for the file soon_bin-0.4.0-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl.

File metadata

File hashes

Hashes for soon_bin-0.4.0-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 2764a5a436ff9dbcf8b47f5e9a7aab4c7dd9e312f567da2dacd5865fc25746eb
MD5 917e544e8c8c3433039688b1ca24da02
BLAKE2b-256 5741330309eca80f435d901b2caeb92fbd3d89b941dfbe8832dadc18bdf5ee50

See more details on using hashes here.

File details

Details for the file soon_bin-0.4.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for soon_bin-0.4.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 23e8ee3b7400e28c56d10d0d70aea8b7b505c637151dafa841d9b44ebdb18ed5
MD5 e58c0891526618158a5266645e98c534
BLAKE2b-256 029c544cc68a58d0f14b5a901ac8a555df4fe05bec8017c67be8106459b51fbe

See more details on using hashes here.

File details

Details for the file soon_bin-0.4.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for soon_bin-0.4.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 c7276da9b38c39a7235a5e77fc9e342b53cc2114ee73ef780b1d0f9ae069a5b4
MD5 112d4cc704be94525cbe380f163250c8
BLAKE2b-256 fa6c8f2431c152126d6316460c0f952b81a0af16929f59ffbf3aeba6983c494a

See more details on using hashes here.

File details

Details for the file soon_bin-0.4.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for soon_bin-0.4.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 ce1efeb4ecf0364f4bc5a9ab8c0bb2342c85760e3d65c50d1020fa608a9a1047
MD5 2ed10f6918bc73ca7ca2822346f49223
BLAKE2b-256 f96deabea64f529bb722ae16d7000683c89c89d6d5ecb263920b9b021f25ad05

See more details on using hashes here.

File details

Details for the file soon_bin-0.4.0-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for soon_bin-0.4.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c5b069eda15e2d4c9b7e3f5caf49e38acf65ac05a2a2654f7f4504e435af0eef
MD5 e201307255627f790e9a82d9f11414fe
BLAKE2b-256 79b7223cf6c4f9d4f55dae5bf94dceff84ee5eba32caff4423624074c1b0ad45

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page