Introducing BAST: Open-Source AI-Powered Terminal Assistant
A free, open-source CLI that turns natural language into shell commands with optional enterprise security. Built with Go, Bubble Tea, and Claude.

Introducing BAST: Open-Source AI-Powered Terminal Assistant
Shell commands are hard to remember. There are thousands of flags, tools, and combinations, and most of us end up searching Stack Overflow or asking ChatGPT in a browser tab, then copying commands back into the terminal.
Meanwhile, existing AI terminal tools send everything to the cloud unprotected. Your shell history, file contents, error logs, all of it flying over the wire with zero security guardrails.
Today we are open-sourcing BAST, a terminal assistant that solves both problems. Natural language to shell commands, with security built in from day one.
Quick Start
Install with a single command:
curl -fsSL https://raw.githubusercontent.com/bastio-ai/bast/main/scripts/install.sh | shThen run the setup wizard:
bast initThe wizard walks you through two options:
- Bastio Gateway (recommended) - Enterprise security, PII redaction, observability, 100K free requests/month
- Direct Connection - Connect straight to Anthropic with no middleware
Either way, you are up and running in under a minute.
Core Commands
BAST has three core commands that cover the most common terminal workflows.
bast run - Natural Language to Commands
Launch the TUI and describe what you want in plain English:
bast run
> find all go files modified in the last week
find . -name "*.go" -mtime -7
> what is using port 8080?
lsof -i :8080
> list running docker containers with memory usage
docker stats --no-streamYou get a beautiful Bubble Tea interface with command preview, one-key execution, and the option to edit before running. Press Enter to run, e to edit, c to copy, or ? to get an explanation.
bast explain - Understand Any Command
Not sure what a command does? Ask BAST:
bast explain "tar -xzvf archive.tar.gz"Even better, pipe command output directly for analysis:
kubectl get pods | bast explain
docker ps | bast explain "any failing?"
cat error.log | bast explain "why is it crashing"bast fix - AI-Powered Error Recovery
When a command fails, just run bast fix. It reads your last command from shell history, analyzes the error, and suggests a corrected command:
$ ls /nonexistent
ls: /nonexistent: No such file or directory
$ bast fix
Analyzing: ls /nonexistent
Suggested fix: ls /
The directory /nonexistent doesn't exist. Did you mean the root directory?Shell Integration
This is where BAST really shines. Add the shell hook to your profile:
# Add to ~/.zshrc or ~/.bashrc
eval "$(bast hook zsh)" # or bashNow you get two keyboard shortcuts available anywhere in your terminal:
- Ctrl+A - Launch the BAST TUI instantly from any prompt
- Ctrl+E - Explain the command you have typed (without executing it)
The hook also captures your shell context: last command, exit status, and output. This gives BAST much better suggestions because it knows what you just did.
Context Awareness
BAST does not generate commands in a vacuum. It automatically collects context from your environment:
- Shell history - Recent commands and their exit statuses
- Git state - Current branch, staged files, merge status, ahead/behind
- Working directory - Where you are in the filesystem
- OS info - Platform, architecture, available tools
This means when you ask "commit my changes with a good message," BAST sees your branch name, staged files, and recent commits to craft an appropriate commit message. When you are in the middle of a merge conflict, it knows and adjusts its suggestions accordingly.
File Context with @syntax
Reference files directly in your queries using the @ prefix:
$ bast run
> explain the auth flow in @internal/auth/handler.go
> find security issues in @gateway/guard_endpoints.go
> refactor @cmd/init.go to be more modularBAST reads the file contents and includes them in the AI request, giving you targeted analysis without leaving your terminal.
Agentic Mode
For complex multi-step tasks, prefix your query with /agent:
$ bast run
> /agent find all TODO comments in go files and summarize them
Tool Calls:
run_command {"command": "grep -r 'TODO' --include='*.go' ."}
internal/ai/anthropic.go:// TODO: add streaming support
internal/tools/loader.go:// TODO: validate script permissions
Response:
Found 2 TODO comments in the codebase:
1. internal/ai/anthropic.go - Add streaming support for responses
2. internal/tools/loader.go - Validate script permissions before executionAgent mode has built-in tools for running commands, reading files, listing directories, writing files, searching code, and getting git summaries. You can also add your own custom plugins as YAML files in ~/.config/bast/tools/.
Security Built In
Dangerous Command Protection
BAST detects destructive commands and requires explicit confirmation before executing:
rm -rf,dd,mkfs,formatgit push --force,git reset --hard,git branch -Dgit push origin main/master
You see a clear warning and must type yes to proceed.
File Access Restrictions
In agent mode, file operations are restricted to the current working directory. Sensitive files like .env, credentials, and key files are blocked from being read by the AI.
Optional Bastio Integration
Connect to the Bastio Gateway and you get enterprise-grade security scanning on every request, at no cost for the first 100K requests per month:
- PII Redaction - Emails, phone numbers, SSNs, credit cards automatically filtered before they reach the LLM
- Secret Scanning - API keys, tokens, and passwords blocked from leaving your terminal
- Jailbreak Prevention - Prompt manipulation attempts detected and stopped
- Observability - Full request traces, cost tracking, and security event dashboard
All of this happens transparently. Your workflow does not change.
Custom Plugins
Extend BAST with your own tools by dropping YAML files in ~/.config/bast/tools/:
# ~/.config/bast/tools/deploy.yaml
name: deploy
description: Deploy to staging or production environment
command: ./deploy.sh $ENVIRONMENT
parameters:
- name: environment
type: string
description: Target environment (staging/production)
required: true
enum: ["staging", "production"]
timeout: 300The AI can now call your custom tools during agent mode, bringing your deployment scripts, database operations, and CI/CD workflows into the conversation.
Free Tier with Bastio
When you connect BAST to the Bastio Gateway, you get 100,000 requests per month for free. No credit card required. That includes:
- Full security scanning (PII, secrets, jailbreak, bot detection)
- Request traces and session grouping
- Cost and usage analytics
- Security event dashboard
For individual developers, this is more than enough. If your team needs higher limits, we have paid plans that scale with you.
Open Source and Contributing
BAST is MIT licensed and available on GitHub. We built it with Go, Cobra, Bubble Tea, and the Anthropic SDK. Contributions are welcome.
git clone https://github.com/bastio-ai/bast.git
cd bast
go build .
go test ./...Whether you want to add new plugins, improve the TUI, or integrate with other AI providers, we would love your help.
Get Started
- Install BAST:
curl -fsSL https://raw.githubusercontent.com/bastio-ai/bast/main/scripts/install.sh | sh - Run the setup wizard:
bast init - Add shell integration:
eval "$(bast hook zsh)" - Press Ctrl+A and start talking to your terminal
Check out the GitHub repository for documentation, issues, and contribution guidelines.
If you want the full security suite, sign up for a free Bastio account and connect your CLI in under a minute.
Questions or feedback? Open an issue on GitHub or reach out at support@bastio.com.
Enjoyed this article? Share it!