๐Ÿ“š OpsTerm Documentation

Welcome to the OpsTerm documentation! Here you'll understand how OpsTerm works, the technologies it uses, and why it's designed the way it is.


๐Ÿ“– Document Index

Document Description Also available in
๐Ÿ“ Architecture & System Design How OpsTerm works โ€” the flow from user typing a command to execution ๐Ÿ‡ฎ๐Ÿ‡ฉ Bahasa Indonesia
๐Ÿ”ง Tech Stack Technologies used โ€” languages, libraries, protocols, formats ๐Ÿ‡ฎ๐Ÿ‡ฉ Bahasa Indonesia
๐Ÿค” Design Decisions Why it's designed this way โ€” rationale behind every technical decision ๐Ÿ‡ฎ๐Ÿ‡ฉ Bahasa Indonesia
๐ŸŽฏ Features All features โ€” complete list with usage examples and use-case matrix ๐Ÿ‡ฎ๐Ÿ‡ฉ Bahasa Indonesia
๐Ÿ“Š Architecture Diagram Excalidraw diagram โ€” open at excalidraw.com โ€”
๐Ÿ–ผ๏ธ Architecture Diagram (PNG) Image version โ€” view directly without opening Excalidraw โ€”

๐Ÿš€ Quick Overview

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                  USER LAPTOP                         โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚  $ ai ssh vps-utama                           โ”‚  โ”‚
โ”‚  โ”‚  $ ai "how to check disk"                     โ”‚  โ”‚
โ”‚  โ”‚  $ docker ps | ai "error?"                    โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ”‚                  โ”‚                                   โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚           OpsTerm (bin/ai)                     โ”‚  โ”‚
โ”‚  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚  โ”‚
โ”‚  โ”‚  โ”‚ AI      โ”‚ โ”‚ SSH    โ”‚ โ”‚ SCP    โ”‚ โ”‚Vault โ”‚  โ”‚  โ”‚
โ”‚  โ”‚  โ”‚ Client  โ”‚ โ”‚ Runner โ”‚ โ”‚ Transferโ”‚ โ”‚      โ”‚  โ”‚  โ”‚
โ”‚  โ”‚  โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”ฌโ”€โ”€โ”€โ”˜  โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ”‚          โ”‚          โ”‚          โ”‚         โ”‚           โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
           โ”‚          โ”‚          โ”‚         โ”‚
     โ”Œโ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
     โ”‚AI API  โ”‚ โ”‚SSH     โ”‚ โ”‚Server  โ”‚ โ”‚Local File  โ”‚
     โ”‚Providerโ”‚ โ”‚ Server โ”‚ โ”‚Filesys โ”‚ โ”‚System      โ”‚
     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Core principle: OpsTerm runs on your local laptop. The AI lives in your terminal, not on the remote server. So when you SSH into any server, the AI is still available.


๐Ÿ“ Project Structure

~/opsterm/
โ”œโ”€โ”€ bin/
โ”‚   โ””โ”€โ”€ ai                    โ† Main script (single file, ~1500 lines)
โ”œโ”€โ”€ completions/
โ”‚   โ”œโ”€โ”€ opsterm.bash          โ† Bash tab completion
โ”‚   โ””โ”€โ”€ opsterm.zsh           โ† Zsh tab completion
โ”œโ”€โ”€ zsh/
โ”‚   โ””โ”€โ”€ opsterm.plugin.zsh    โ† Zsh shell integration plugin
โ”œโ”€โ”€ docs/                     โ† This documentation
โ”‚   โ”œโ”€โ”€ en/                   โ† English documentation
โ”‚   โ”‚   โ”œโ”€โ”€ README.md         โ† Index
โ”‚   โ”‚   โ”œโ”€โ”€ architecture.md   โ† Architecture & system design
โ”‚   โ”‚   โ”œโ”€โ”€ tech-stack.md     โ† Tech stack details
โ”‚   โ”‚   โ”œโ”€โ”€ design-decisions.mdโ† Design rationale
โ”‚   โ”‚   โ””โ”€โ”€ features.md       โ† All features
โ”‚   โ”œโ”€โ”€ id/                   โ† Indonesian documentation
โ”‚   โ”‚   โ”œโ”€โ”€ README.md         โ† Index
โ”‚   โ”‚   โ”œโ”€โ”€ architecture.md   โ† Arsitektur & system design
โ”‚   โ”‚   โ”œโ”€โ”€ tech-stack.md     โ† Tech stack
โ”‚   โ”‚   โ”œโ”€โ”€ design-decisions.mdโ† Design decisions
โ”‚   โ”‚   โ””โ”€โ”€ features.md       โ† Fitur lengkap
โ”‚   โ”œโ”€โ”€ ops-term-architecture.excalidraw โ† Excalidraw diagram
โ”‚   โ””โ”€โ”€ ops-term-architecture.png        โ† PNG architecture diagram
โ”œโ”€โ”€ setup.sh                  โ† Install script
โ”œโ”€โ”€ README.md                 โ† English README
โ”œโ”€โ”€ README.id.md              โ† Indonesian README
โ””โ”€โ”€ .gitignore

User config (gitignored, stored at ~/.ai-workflows/):

~/.ai-workflows/
โ”œโ”€โ”€ config.yaml       โ† AI provider settings
โ”œโ”€โ”€ servers.yaml      โ† Server list + proxy config
โ”œโ”€โ”€ workflows.yaml    โ† Workflow definitions
โ”œโ”€โ”€ vault.json        โ† Encrypted credentials
โ”œโ”€โ”€ history.db        โ† SQLite history
โ””โ”€โ”€ last_*.txt        โ† Last command output

๐Ÿง  Design Philosophy

  1. Zero dependencies โ€” just Python 3 stdlib, no pip install needed (except vault encryption)
  2. Single file โ€” bin/ai can be copied to any server and run immediately
  3. Local-first โ€” AI runs on your local terminal, not on the server. SSH without losing AI access
  4. Config as code โ€” server & workflow configs use YAML, version-control friendly
  5. Progressive disclosure โ€” simple features are easy to use, complex features are available when needed

  1. ๐Ÿ“ Architecture & System Design โ€” understand the workflow flow
  2. ๐Ÿ”ง Tech Stack โ€” technologies used
  3. ๐Ÿค” Design Decisions โ€” why these choices were made
  4. ๐Ÿ“Š Architecture Diagram โ€” visual overview (open at excalidraw.com)

Next: ๐Ÿ“ Architecture & System Design โ†’