Skip to main content

soon

The next command, before you type it.

A local-first terminal agent that predicts, repairs, and suggests your next full command.

crates.io PyPI CI License: MIT

Website · v0.4.2 Zsh parser patch · Roadmap

Beta status: v0.4.2 ships the opt-in Zsh ghost-suggestion loop, a privacy-safe adoption report, and correct handling for compound commands in Zsh history. Interactive integration is supported on native Linux and macOS; other shells and packaged platforms remain experimental unless listed in the release contract.

An 18-second terminal demo: a failed Git command triggers a local Repair suggestion, Ctrl-F accepts it into the editable buffer, and the user decides when to execute it.

Try the beta

Install the same v0.4.2 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.

Help validate the beta: join the ten-user Zsh pilot. The study asks for privacy-safe aggregate counters and qualitative feedback, never raw command text.

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:

  1. Observe the completed command and its result.
  2. Remember only safe, useful local context.
  3. Rank complete commands from recurring transitions.
  4. Render one editable ghost suggestion without blocking the prompt.
  5. 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

  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.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

soon_bin-0.4.2.tar.gz (969.2 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.2-py3-none-win_amd64.whl (2.5 MB view details)

Uploaded Python 3Windows x86-64

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

Uploaded Python 3Windows x86

soon_bin-0.4.2-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.2-py3-none-musllinux_1_2_i686.whl (2.9 MB view details)

Uploaded Python 3musllinux: musl 1.2+ i686

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

Uploaded Python 3musllinux: musl 1.2+ ARMv7l

soon_bin-0.4.2-py3-none-musllinux_1_2_aarch64.whl (3.0 MB view details)

Uploaded Python 3musllinux: musl 1.2+ ARM64

soon_bin-0.4.2-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.2-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.2-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.2-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.2-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.2-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.2-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.2.tar.gz.

File metadata

  • Download URL: soon_bin-0.4.2.tar.gz
  • Upload date:
  • Size: 969.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.14.1

File hashes

Hashes for soon_bin-0.4.2.tar.gz
Algorithm Hash digest
SHA256 5acf4c6ef6e01fed7b24b8fcfbb2ca5dde22b9e2022da7d0499c45e7817b8156
MD5 c304c815c5c6ea1be8b1ae19e7378f5a
BLAKE2b-256 8efd86c9a14dfd0f7043010182b9925650a9a45845fdf51008119482b0a28fb0

See more details on using hashes here.

File details

Details for the file soon_bin-0.4.2-py3-none-win_amd64.whl.

File metadata

  • Download URL: soon_bin-0.4.2-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.2-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 9578f5cead33ef9bed7c3206324bc6c926ddbe950d172278254c4fd6f6261ad4
MD5 09ff42642262d43bb7d56079d4fd685b
BLAKE2b-256 c531a483a93fe405c98363a8b37f37c2bd18970b580e78454d36b55f3d730b17

See more details on using hashes here.

File details

Details for the file soon_bin-0.4.2-py3-none-win32.whl.

File metadata

  • Download URL: soon_bin-0.4.2-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.2-py3-none-win32.whl
Algorithm Hash digest
SHA256 f2803325297524a2d515db51b044215ed4589f0849a76db438befb9be18a3e7b
MD5 d32fa4b3b805c5fb08d422067ccd93d6
BLAKE2b-256 c7d4e814a00086e5a464a9f094288a5d4313555a57e88bfe15a79eeedcd1823c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for soon_bin-0.4.2-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 c1aa2fc0a5eb280962dcf1eb28c75e1791b7f4f0ce8ba35219d7df758f58e003
MD5 70a24a5225796065624466a2f0b5cd51
BLAKE2b-256 7f0e84580daa54723c0dc9f02a75ba7bfba5c5a99918cd7a388b93622c6a797b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for soon_bin-0.4.2-py3-none-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 38046e466d4c86f5fbf4f44e4688b2df1b61ee8f491cf34f9e34f7000fd9dcad
MD5 c970b60775f1bf7b59789c4f17d0c78a
BLAKE2b-256 86ae5651e20eb07c785990b650f7e64c1263b33bfb1d4ccdd8c90b197ee4da2e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for soon_bin-0.4.2-py3-none-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 9cfdd0a9a90589fc0b174916006f04fba493b516d3cd48c4fd736e51de45c2c8
MD5 fc53a421a79bfd8ea50e624ce555309a
BLAKE2b-256 9cccfe61ab805c51c42126336cc4ceab6b4d47e64eebd86e1272761489aaa3f9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for soon_bin-0.4.2-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 7221a73b746fbe5ed5e4a6108edd35eb341480230636246e25b4f87da669696d
MD5 313d1abe829ccf6d4de8fe5084af320e
BLAKE2b-256 1322b9892fa03684c8de28cf1cbb7e227905a6be0b4ebc84ac623f8739ca147e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for soon_bin-0.4.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 14b89e7a0a8de63e64041b89612ee70d6fb2831c8218245fd43cdf7f34619ec8
MD5 36d269e0e0fe36707cd92e308387e377
BLAKE2b-256 156a9a9b50ac4047f9af123d93e1044ebd0a923ef36c38b46e0fc96c40ce383b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for soon_bin-0.4.2-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 f1eab3b0fb26c577749b75617c92489e6e4764fa2e93161a8c88a77ca4a09e89
MD5 e6ffa2c30cec121cc0ead55cf50afc79
BLAKE2b-256 a961f6f19247217089d1d64fb8742d264cccd9d4767134a97b13de36843cfe3e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for soon_bin-0.4.2-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 8c3d4e07030019b00fe0d015e83772800514caf92dafead225df52e8efbdf42a
MD5 cfdbd4f4b13c9e44f3654a78a70f48d7
BLAKE2b-256 e1cf0fcf933804a3e8a3adcc9fa23eb0eee1f11d4c5c2c57fdc1551d610f4e68

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for soon_bin-0.4.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 ecd62d02c6d4f29618a9e254053ec5f7c0cf3569e83517cfed393ce3f398f917
MD5 b5935f7399c8805024d8d9e90e43b4f4
BLAKE2b-256 68afc61b501a16b2d882ad46b09ea5f9147a689e88f19986eba6cf05ab0acc97

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for soon_bin-0.4.2-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 37b6aa07a4f964602d09a8aa70f1c6f4c19cad1156cd542f5f64465c79d605d0
MD5 d8a3e82b4ba93335c5ac5da36ff27797
BLAKE2b-256 f0c5ca24430bc89d87b08183ea4d98be469bc51b763ccae8478fc0796791dd47

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for soon_bin-0.4.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 ee4243e59af77afa2441a86b68d3f48d1fb17aebffa54baa1ce9c46ad8a5babf
MD5 ad6bc3ff106ccee151e421b3decc5374
BLAKE2b-256 741133f1c086228d023d492c0bd0178c37edd17a733e0170bd7ee20ead368d9a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for soon_bin-0.4.2-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 235259562830301bc0bb8e17282c53443585878bf5d468f9c590730206e38f17
MD5 65eea5976478a7619dc9e8002c22c836
BLAKE2b-256 b6c2798fba7b05c61eeb86a00a450657dbc5d74c286e16a51c50345aff69fb14

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