Reference
Public entry point
TryIt.main — Function
main(args::AbstractVector{<:AbstractString})
Process-level entry point. Parses args, dispatches to the appropriate subcommand, and calls exit with the resolved exit code. Intended to be invoked from the shell function emitted by tryit init (see emit_shell_init).
EARS coverage: UB6.
Exit statuses
TryIt.Core.ExitCode — Module
Process exit statuses.
A dedicated module rather than loose constants: the names stay out of TryIt, ExitCode.<TAB> completes, and ExitCode.T gives call sites something to dispatch on.
The values are the wire format — a shell reads them from $? — so they are pinned explicitly rather than left to declaration order.
| Value | Code | Meaning |
|---|---|---|
SUCCESS | 0 | Completed normally. |
FAILURE | 1 | The operation failed (fetch, UN11). |
PERMISSION | 2 | TRY_PATH not creatable or writable (UN1). |
USAGE | 64 | EX_USAGE: bad slug, subcommand, or non-TTY |
| run with no positional slug (UN4). | ||
NOT_FOUND | 127 | A required dependency is absent from PATH |
(git, UN5). | ||
SIGINT | 130 | 128 + SIGINT: Ctrl-C (UN7). |
FAILURE is deliberately distinct from NOT_FOUND: overloading 127 for an HTTP 404 would give scripts a status code that means two different things. clone sidesteps the question entirely by propagating git's own exit code (UN3).
exit takes an Integer, and an @enum is not one, so process-level callers convert explicitly: exit(Int(ExitCode.PERMISSION)).
EARS coverage: UB6, UN1, UN4, UN5, UN7, UN11.
Exports
Shell integration
TryIt.emit_shell_init — Function
emit_shell_init(io::IO)
emit_shell_init(
io::IO,
positional::Union{Nothing, AbstractString}
)
Write the POSIX-shell tryit function definition to io.
The emitted text, when sourced by bash (≥ 4.0) or zsh (≥ 5.0), sets up a function that invokes the Julia CLI and evals its stdout so cd actually changes the caller's working directory.
positional, when non-nothing, is hard-coded into the function as TRY_PATH for the call. When nothing, the function sets nothing at all and leaves resolution to _resolve_tries_root: the caller's environment, then tries_path in the configuration file, then $HOME/work/tries.
Everything the emitted function sends through eval comes from stdout, so subcommands whose stdout is output rather than a command — --help, --version, path, list — are run directly instead of being captured.
When running as a compiled PackageCompiler app (see _APP_MODE), the emitted function calls the tryit executable directly instead of booting julia.
EARS coverage: UB4, ED13, UN9.
Internal layering
TryIt.Core — Module
The UI-free layer: slugs, paths, git, lifecycle, panels, settings.
A submodule rather than a package for now, but a real boundary: it lists no UI dependency, and test/spec/test_core_boundary.jl fails if one appears. That constraint is load-bearing, not stylistic — see the CHANGELOG entry on juliac --trim.
Promotion to a TryItCore package is mechanical from here; it is deferred until a trimmed binary is actually achievable.
TryIt.Core.SelectorState — Type
mutable struct SelectorStateMutable state backing the try selector, independent of any frontend.
Holds every piece of state the event loop needs. Output (the cd command) is NOT written from within the reducer — the TUI captures stdout while the app is running, so the decision is recorded here and cli_main emits the shell command after the loop returns.
Wrapped by SelectorSession, which adds the frontend-specific handles and forwards property access here, so session.filter and session.state.filter are the same slot.
EARS coverage: ED1, ED2, ED3, ED4, ED12, SD1, UN7.
Fields
root::TryIt.Core.TriesPath: Resolved tries root.
all_tries::Vector{TryIt.Core.Try}: Snapshot of every try at selector-open time, mtime-desc.
filter::String: Current filter string; empty matches everything.
cursor::Int64: 1-based cursor intovisible.0whenvisibleis empty.
visible::Vector{TryIt.Core.Try}: Filter-applied projection ofall_tries.
exit_action::Symbol: Decision taken when the event loop exits::none,:cd,:quit,:interrupted,:usage_error,:clone,:fetch.
exit_path::String: Absolute path to emit withcdwhenexit_action == :cd.
exit_url::String: URL to hand tocloneorfetchwhenexit_actionis one of those. Kept apart fromexit_path, which is always a local path — one field meaning two different things is how acdinto a URL eventually happens.
done::Bool: Set totrueto terminate the event loop.
viewport_top::Int64: Index intovisibleof the top-most rendered row (SD3).0whenvisibleis empty.
terminal_size::Tuple{Int64, Int64}: Current terminal dimensions(rows, cols); refreshed on every redraw.
mode::Symbol: Sub-mode::normal(default),:rename(Ctrl-R), or:choose(open-or-create prompt). SD2-masked in:rename.
choice::Symbol: Highlighted action while in:choose::openor:create.
notice::String: Transient message shown in the help bar. The TUI redirects stderr for the whole session, sodiagoutput from inside the reducer is invisible — failures have to be surfaced in-frame.
date_choice::Symbol: Which dateCtrl-Pwill apply while in:datepick::mtimeor:today.
anim_index::Int64: Cursor into the background name table while in:animation.
anim_before::String: Animation active when the picker opened, restored if cancelled.
opacity_index::Int64: Cursor into the opacity name table while in:opacity.
opacity_before::Float64: Opacity active when the picker opened, restored if cancelled.
doc_index::Int64: Cursor into the documentation pages while in:docs.
doc_offset::Int64: Scroll offset within the current docs page.
theme_index::Int64: Cursor into the frontend's theme table while in:theme.
theme_before::String: Theme active when the picker opened, restored if it is cancelled.
rename_buf::String: Input line contents while in:rename. Empty otherwise.
marked_for_delete::Set{String}: Absolute paths flagged for delete on selector exit (ED9 / ED10).
badge_cache::Dict{String, Vector{Symbol}}: Badge cache keyed by try path. Populated lazily;detect_badgestouches the filesystem and the view runs every frame.
preview_path::String: Path thepreviewfield currently describes. Empty when none.
preview::Vector{TryIt.Core.PreviewEntry}: Directory listing of the selected try, for the preview panel.
disk::Union{Nothing, TryIt.Core.DiskStats}: Filesystem stats for the tries root.nothingwhen unavailable.
tick::Int64: Frame counter driving the background animation. There is no tick event; the view runs every frame and advances this itself.
show_fps::Bool: Whether to draw the frames-per-second readout. Read once at open fromconfigured_show_fps.
fps::TryIt.Core.FpsMeter: Rolling frame-rate estimate, advanced once per rendered frame whenshow_fpsis set.
Notes
TryIt does not expose a Julia library API until a future major release. The only supported public entry point is the CLI command surface documented on the Getting Started page. Everything else in src/ is an implementation detail and subject to change without notice in 0.x releases.