AiT

module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2026 License: Apache-2.0

README

AiT

AiT is a cross-platform (Linux / macOS / Windows) AI-enhanced command-line toolbox for operations engineers—terminal and SSH workflows today, more tools over time.

First tool: aitssh — AI-enhanced SSH client (sessions, in-terminal AI, file transfer).

Full CLI reference: aitssh guide.

What you get

  • OpenSSH-compatible connect (-J, config Host aliases, ssh -G resolution)
  • Session bookmarks: --alias, session --load, session --switch
  • In-session !ait meta commands (suspend, chain hop, transfer)
  • Default AiT-managed remote prompt (AiT user@host:…>); set AIT_REMOTE_SYSTEM_PROMPT=1 for the native shell prompt
  • Experimental AI (!! / !ait ai / aitssh ai) — off by default; enable with ai.experimental.enabled, AIT_AI_EXPERIMENTAL=1, or --ai-experimental
  • !ait get / !ait put on the live SSH session, standalone aitssh get / put via SFTP
  • Optional --tmux to keep remote shells alive after disconnect
  • Local aitssh shell REPL (and optional AI REPL) with history and UTF-8 line editing

Examples

# 1) Bookmark a host and resume later (OpenSSH-style flags still work)
aitssh deploy@prod --alias prod
aitssh session --list
aitssh session --load prod

# 2) Jump host in one command (same as ssh -J; Host aliases resolve via ssh -G)
aitssh -J bastion app.internal

# 3) Enable experimental AI once, then use it locally or inside SSH
aitssh config init
aitssh config set ai.experimental.enabled true
# Inside an SSH session:
!!
# Ask in natural language; read-only commands run automatically; writes need confirmation

# 4) Transfer over the current session (single-arg defaults to ./basename)
!ait get ./build/app-linux-amd64
!ait put ./patch.tar.gz

# 5) tmux keep-alive: remote work survives disconnect
aitssh devhost --tmux
# Later: aitssh session --load devhost --tmux

# 6) One-shot local AI (non-interactive; requires experimental AI enabled)
aitssh ai ask "summarize this log pattern: connection reset"

Installation

Prerequisites: Go 1.25+; OpenSSH client (ssh) on PATH for default connect/load to resolve ~/.ssh/config.

Build from source (local build and verification):

git clone https://github.com/os-artificer/AiT.git
cd AiT
make build
./bin/aitssh --help

go install (requires Go 1.25+; ZMODEM support is vendored under pkg/third-party/ — no external github.com/xiwh/zmodem fetch):

go install github.com/os-artificer/AiT/cmd/aitssh@latest
aitssh --help

Ensure $(go env GOPATH)/bin is on your PATH.

Documentation

Document Path
Project structure docs/architecture.md
aitssh internals docs/tools/aitssh-internals.md
aitssh guide docs/tools/aitssh.md
Python E2E tests tests/README.md
Contributing CONTRIBUTING.md
Code layout AGENTS.md
Code of conduct CODE_OF_CONDUCT.md
Changelog CHANGELOG.md

Directories

Path Synopsis
cmd
aitssh command
internal
aissh
Package aissh implements the AiT aitssh CLI application entry.
Package aissh implements the AiT aitssh CLI application entry.
aissh/ai
Package ai builds the `aitssh ai` Cobra subtree (chat, provider, model) and the local/remote AI REPL runners injected into shell and SSH packages.
Package ai builds the `aitssh ai` Cobra subtree (chat, provider, model) and the local/remote AI REPL runners injected into shell and SSH packages.
aissh/ai/deps
Package deps holds shared dependencies for the aitssh ai command subtree.
Package deps holds shared dependencies for the aitssh ai command subtree.
aissh/ai/ollama
Package ollama builds the `aitssh ai ollama` Cobra subtree (status/setup/start/stop/disable).
Package ollama builds the `aitssh ai ollama` Cobra subtree (status/setup/start/stop/disable).
aissh/ai/ollama/subregistry
Package subregistry collects aitssh ai ollama subcommands registered from init hooks.
Package subregistry collects aitssh ai ollama subcommands registered from init hooks.
aissh/ai/provider
Package provider builds the `aitssh ai provider` Cobra subtree.
Package provider builds the `aitssh ai provider` Cobra subtree.
aissh/ai/provider/subregistry
Package subregistry collects aitssh ai provider subcommands registered from init hooks.
Package subregistry collects aitssh ai provider subcommands registered from init hooks.
aissh/ai/runner
Package runner holds shared one-shot AI command helpers (no subcommand imports).
Package runner holds shared one-shot AI command helpers (no subcommand imports).
aissh/ai/subregistry
Package subregistry collects aitssh ai subcommands registered from init hooks.
Package subregistry collects aitssh ai subcommands registered from init hooks.
aissh/config
Package config implements the `aitssh config` Cobra subtree (set/get/init/view/edit/validate).
Package config implements the `aitssh config` Cobra subtree (set/get/init/view/edit/validate).
aissh/config/shared
Package shared holds helpers shared by aitssh config subcommands.
Package shared holds helpers shared by aitssh config subcommands.
aissh/config/subregistry
Package subregistry collects aitssh config subcommands registered from init hooks.
Package subregistry collects aitssh config subcommands registered from init hooks.
aissh/registry
Package registry collects top-level aitssh subcommands registered from init hooks.
Package registry collects top-level aitssh subcommands registered from init hooks.
aissh/registry/all
Package all blank-imports every top-level command registrar (breaks import cycles with cli).
Package all blank-imports every top-level command registrar (breaks import cycles with cli).
aissh/registry/gen command
Command gen regenerates internal/aissh/registry/all/imports.go from top-level register.go packages.
Command gen regenerates internal/aissh/registry/all/imports.go from top-level register.go packages.
aissh/session
Package session implements the `aitssh session` Cobra command (list/load/suspend/switch/delete).
Package session implements the `aitssh session` Cobra command (list/load/suspend/switch/delete).
pkg/ai
Package ai is the public facade for AiT AI features.
Package ai is the public facade for AiT AI features.
pkg/ai/apitypes
Package apitypes holds shared AI DTOs used by client and eino without import cycles.
Package apitypes holds shared AI DTOs used by client and eino without import cycles.
pkg/ai/eino
Package eino wraps CloudWeGo Eino ChatModel for AiT AI routing (Phase 0+ refactor).
Package eino wraps CloudWeGo Eino ChatModel for AiT AI routing (Phase 0+ refactor).
pkg/ai/models
Package models declares the data row for `aitssh ai model list` and the receiver-free formatting helpers used to render it.
Package models declares the data row for `aitssh ai model list` and the receiver-free formatting helpers used to render it.
pkg/ai/provider
Package provider declares the public AI provider identifiers and user-visible errors (sentinel + Try-block hints) shared by the multi-provider router, agent loop, and CLI surface.
Package provider declares the public AI provider identifiers and user-visible errors (sentinel + Try-block hints) shared by the multi-provider router, agent loop, and CLI surface.
pkg/ai/router
Package router contains the receiver-free building blocks of the AiT AI multi-provider router: the failover Chain of Responsibility helpers (ResolveTryOrder, AggregateErrors, LogFailover, APIKeyHint, IsRetryable) and the tiered routing classifier (ClassifyPrompt) shared by the cloud and local-first paths.
Package router contains the receiver-free building blocks of the AiT AI multi-provider router: the failover Chain of Responsibility helpers (ResolveTryOrder, AggregateErrors, LogFailover, APIKeyHint, IsRetryable) and the tiered routing classifier (ClassifyPrompt) shared by the cloud and local-first paths.
pkg/aimode/agent
Package agent represents the AI agent loop's parsed actions and the local capture runner used to feed shell output back into the model.
Package agent represents the AI agent loop's parsed actions and the local capture runner used to feed shell output back into the model.
pkg/aimode/approve
Package approve provides command confirmation, pattern/session trust, and risk-aware policy for the AI mode REPL.
Package approve provides command confirmation, pattern/session trust, and risk-aware policy for the AI mode REPL.
pkg/aimode/chat
Package chat exposes the one-shot AI ask path that powers `aitssh ai ask <message>` and the `ask …` meta-REPL command.
Package chat exposes the one-shot AI ask path that powers `aitssh ai ask <message>` and the `ask …` meta-REPL command.
pkg/aimode/risk
Package risk classifies AI-mode commands by execution risk so callers can gate confirmation, denylist TUI programs, and apply pattern/session trust.
Package risk classifies AI-mode commands by execution risk so callers can gate confirmation, denylist TUI programs, and apply pattern/session trust.
pkg/clihints
Package clihints holds shared errhint Try-block example command lines for the aitssh CLI.
Package clihints holds shared errhint Try-block example command lines for the aitssh CLI.
pkg/cliroute
Package cliroute centralizes aitssh argv routing (top-level SSH default, REPL connect, meta chain).
Package cliroute centralizes aitssh argv routing (top-level SSH default, REPL connect, meta chain).
pkg/helpdoc
Package helpdoc provides shared login-style CLI help layout and Cobra bind helpers.
Package helpdoc provides shared login-style CLI help layout and Cobra bind helpers.
pkg/pathsafe
Package pathsafe validates strings that will be embedded in remote shell commands.
Package pathsafe validates strings that will be embedded in remote shell commands.
pkg/replcmd
Package replcmd holds shared REPL verb names used by shell and aimode (C24).
Package replcmd holds shared REPL verb names used by shell and aimode (C24).
pkg/ssh/client/dial
Package dial holds receiver-free helpers shared by the SSH dialer in the parent ssh/client package: jump-host parsing, ProxyCommand stdio wiring, and SSH private-key loading.
Package dial holds receiver-free helpers shared by the SSH dialer in the parent ssh/client package: jump-host parsing, ProxyCommand stdio wiring, and SSH private-key loading.
pkg/ssh/client/hostkeys
Package hostkeys manages SSH known_hosts verification callbacks and file I/O.
Package hostkeys manages SSH known_hosts verification callbacks and file I/O.
pkg/ssh/client/localmode
Package localmode runs the !ait local PTY shell that an SSH user can spawn without dropping their remote connection.
Package localmode runs the !ait local PTY shell that an SSH user can spawn without dropping their remote connection.
pkg/ssh/client/prompt
Package prompt provides AiT's display prompt strings and the shell setup fragments needed to install them on a remote PTY.
Package prompt provides AiT's display prompt strings and the shell setup fragments needed to install them on a remote PTY.
pkg/ssh/client/pty
Package pty hosts the PTY-side helpers used by an interactive SSH session: the single-goroutine stdin Reader that routes bytes between SSH forwarding and the local AI REPL, a one-byte-per-channel ReplReader, and the cross- platform terminal resize watcher.
Package pty hosts the PTY-side helpers used by an interactive SSH session: the single-goroutine stdin Reader that routes bytes between SSH forwarding and the local AI REPL, a one-byte-per-channel ReplReader, and the cross- platform terminal resize watcher.
pkg/ssh/client/scrollback
Package scrollback contains receiver-free helpers that compute new output captured from the remote PTY scrollback buffer.
Package scrollback contains receiver-free helpers that compute new output captured from the remote PTY scrollback buffer.
pkg/ssh/client/transfer
Package transfer holds receiver-free helpers for the in-session !ait get / !ait put meta commands: meta-line argv parsing and the user-visible usage hint.
Package transfer holds receiver-free helpers for the in-session !ait get / !ait put meta commands: meta-line argv parsing and the user-visible usage hint.
pkg/ssh/stricthostkey
Package stricthostkey normalizes OpenSSH StrictHostKeyChecking option values.
Package stricthostkey normalizes OpenSSH StrictHostKeyChecking option values.
pkg/subregistry
Package subregistry provides a generic Cobra subcommand registry for nested CLI parents.
Package subregistry provides a generic Cobra subcommand registry for nested CLI parents.
pkg/terminal/crlf
Package crlf provides an io.Writer adapter that translates LF to CRLF so shell/meta output renders correctly on raw TTYs and remote PTYs.
Package crlf provides an io.Writer adapter that translates LF to CRLF so shell/meta output renders correctly on raw TTYs and remote PTYs.
pkg/terminal/history
Package history implements the bash-style REPL input history model used by `aitssh shell` and `aitssh ai`: bounded in-memory ring, optional file backing (load/append/write/reload), reverse search, and the `history` command.
Package history implements the bash-style REPL input history model used by `aitssh shell` and `aitssh ai`: bounded in-memory ring, optional file backing (load/append/write/reload), reverse search, and the `history` command.
pkg/terminal/lineedit
Package lineedit implements the Emacs-style raw-TTY line editor used by `aitssh shell` and `aitssh ai`: ReadLine reads one edited line with history recall, Ctrl+R reverse search, kill keys, UTF-8 input, and Ctrl+L screen clear.
Package lineedit implements the Emacs-style raw-TTY line editor used by `aitssh shell` and `aitssh ai`: ReadLine reads one edited line with history recall, Ctrl+R reverse search, kill keys, UTF-8 input, and Ctrl+L screen clear.
pkg/terminal/screen
Package screen provides ANSI VT100 screen primitives such as clear-screen sequences shared by the local shell REPL and AI mode.
Package screen provides ANSI VT100 screen primitives such as clear-screen sequences shared by the local shell REPL and AI mode.
pkg/terminal/scrollback
Package scrollback implements a bounded ring buffer that captures terminal output for replay (`aitssh session --load`) and AI assist context.
Package scrollback implements a bounded ring buffer that captures terminal output for replay (`aitssh session --load`) and AI assist context.
pkg/toolname
Package toolname holds SSOT strings for the aitssh CLI tool name and meta prefix.
Package toolname holds SSOT strings for the aitssh CLI tool name and meta prefix.
pkg/transfer/route
Package route selects get/put backends (ZMODEM vs SFTP) for in-session transfer.
Package route selects get/put backends (ZMODEM vs SFTP) for in-session transfer.
pkg/transfer/zmodem
Package zmodem wraps the vendored xiwh ZMODEM stack for lrzsz-compatible PTY file transfer.
Package zmodem wraps the vendored xiwh ZMODEM stack for lrzsz-compatible PTY file transfer.
pkg/utf8tail
Package utf8tail provides UTF-8-safe suffix truncation by byte length.
Package utf8tail provides UTF-8-safe suffix truncation by byte length.
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL