Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

41 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

aicutad-cli

AI Coding Agent CLI - baca, tulis, edit file & jalankan command shell otonom lewat terminal.

Ditenagai gateway ai.cutad.web.id Β· OpenAI-compatible /v1

Version Node License Platform Deps

aicutad-cli TUI Demo

Apa itu?

aicutad-cli adalah AI coding agent yang jalan di terminal kamu. Bukan sekadar chat - ia baca file, tulis kode, edit file, dan jalankan command shell sendiri lewat agentic loop dengan function calling.

Kamu kasih tugas, agent bekerja otonom: baca β†’ tulis β†’ verifikasi β†’ lapor.

$ aicutad agent "buat file hello.js berisi console.log hello world"

  aicutad-cli agent mode Β· v0.4.6
  model: deepseek-ai/deepseek-v4-pro  dir: /root/project
  ────────────────────────────────────────────────────────────
  β€Ί buat file hello.js berisi console.log hello world
  ────────────────────────────────────────────────────────────

  β ‹ berpikir…
  πŸ“ Write (hello.js, 42 bytes)
  πŸ“ Write βœ“ (1 baris)
  πŸ“– Read (hello.js)
  πŸ“– Read βœ“ (2 baris)
  ⚑ Run (node hello.js)
  ⚑ Run βœ“ (2 baris)

  ────────────────────────────────────────────────────────────
  aicutad-cli selesai Β· 4 iterasi Β· 3 tools Β· 1.2s

  File hello.js berhasil dibuat & diverifikasi. Output: "Hello, World!"

Instalasi

npm install -g aicutad-cli

Atau dari source:

git clone https://github.com/cutad/aicutad-cli.git
cd aicutad-cli
npm install -g .

Persyaratan: Node.js β‰₯ 18 (disarankan β‰₯ 22)

Mulai Cepat

aicutad

Pertama kali jalankan, setup wizard premium muncul otomatis:

  1. Boot animation - bordered window, typewriter logo, system info
  2. Masukkan API key (input tersembunyi β€’β€’β€’β€’β€’β€’β€’β€’)
  3. Validasi koneksi ke gateway (animated spinner)
  4. Pilih model (arrow-key ↑/↓ selector, clean UI)
  5. Simpan konfigurasi ke ~/.cutad/auth.json
  6. Langsung masuk TUI full-screen immersive

Setelah setup, aicutad langsung buka TUI agent - ketik tugas apa pun, agent kerjakan.

Mode Agent

Setiap pesan di TUI = agent. Model selalu punya akses ke 6 tools:

Tool Icon Fungsi
read_file πŸ“– Baca isi file
write_file πŸ“ Buat / overwrite file
edit_file ✏️ Find-and-replace di file
list_files πŸ“‚ Daftar file & direktori
search_files πŸ” Cari teks (regex) di kode
run_command ⚑ Jalankan command shell
browse_page 🌐 Buka URL di headless Chromium & ekstrak teks
web_search πŸ”Ž Cari di Google, return 5 hasil teratas
screenshot πŸ“· Screenshot halaman web (PNG)

Alur agentic loop:

User: "buat file fibonacci.js"
  β†’ Model: write_file(fibonacci.js, ...)
  β†’ Model: read_file(fibonacci.js)          // verifikasi
  β†’ Model: run_command(node fibonacci.js)   // test
  β†’ Model: lapor hasil ke user

Model memutuskan sendiri tool apa yang dipakai, berapa kali, dan kapan selesai. Maks 20 iterasi untuk safety.

TUI Full-Screen

 aicutad-cli β”‚ AI Coding Agent CLI v0.4.6          19:20:35
 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 β”Œβ”€ you 19:20
 β”‚ ada apa di sini
 └─
 πŸ“‚ List /tmp/project …
 πŸ“‚ List βœ“ file hello.js, file utils.js
 πŸ“– Read /tmp/project/hello.js …
 πŸ“– Read βœ“ console.log('Hello, World!')
 β”Œβ”€ aicutad-cli 19:20
 β”‚ Di direktori ada 2 file: hello.js dan utils.js.
 β”‚ hello.js berisi console.log('Hello, World!').
 β”‚ Mau aku apain?
 └─
 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 ● β”‚ ready β”‚ deepseek-ai/deepseek-v4-pro β”‚ 6 pesan β”‚ 1,835 tok β”‚ $0.0010 β”‚ ctx 2% β”‚ cutad   /help
 you β€Ί

Fitur TUI v0.4.6

  • Boot animation premium - bordered window, typewriter logo, multi-step progress
  • Full-screen immersive - alternate buffer, fokus hanya ke aicutad-cli
  • Zero-glitch rendering - absolute positioning (no \n scroll), in-place updates untuk input/spinner/clock
  • Cost tracking live - token count + biaya ($0.0010) tampil di status bar real-time
  • Context window indicator - ctx 15% dengan color coding (dim/yellow/red)
  • Context window management - auto-summarize pesan lama saat context >80%
  • Typing animation - AI response muncul char-by-char
  • Interactive help modal - arrow ↑/↓ navigasi, Enter pilih command, Esc tutup
  • Interactive model picker - arrow keys, modal overlay
  • Input history - ↑/↓ arrows recall pesan sebelumnya (saat input kosong = scroll pesan)
  • Keyboard shortcuts - Ctrl+L clear, Ctrl+S save, Tab autocomplete
  • Modal overlays - help, models, sessions, agents (centered bordered, glitch-free)
  • Live clock - HH:MM:SS di header
  • Markdown rendering - code blocks, bold, italic, headers, lists, blockquotes
  • Message timestamps - HH:MM per message
  • Compact tool display - inline 1-baris dengan icon + color + status
  • Status bar - colored indicator (🟒 ready Β· 🟑 bekerja Β· πŸ”΄ error Β· πŸ”΅ scroll)
  • Spinner animation - braille dots, 100ms smooth (in-place, no redraw)

Keyboard Shortcuts

Key Fungsi
↑ / ↓ Scroll pesan (input kosong) / History navigasi (input ada) / Modal navigasi
Tab Autocomplete command
Ctrl+L Clear screen
Ctrl+S Save session
Ctrl+C Keluar
Esc Tutup modal
Enter Kirim pesan / Pilih item di modal

Command di TUI

Command Fungsi
/help Bantuan (interactive modal - ↑/↓ navigasi, Enter pilih)
/models Pilih model (interactive modal picker)
/model <name> Ganti model langsung
/agents Daftar subagent (modal overlay)
/sessions Daftar session tersimpan (modal overlay)
/save Simpan session
/clear Bersihkan layar
/exit Keluar

Command Line

# Agent otonom (CLI mode - output ke terminal)
aicutad agent "buat file utils.js berisi fungsi fibonacci"
aicutad agent "fix bug di app.js" --model deepseek-ai/deepseek-v4-pro --dir /path/to/project

# TUI full-screen (default)
aicutad

# Chat satu kali
aicutad chat "jelaskan apa itu closure"

# Chat interaktif (REPL)
aicutad chat

# Manajemen
aicutad login      # setup wizard premium
aicutad status     # cek status login + jumlah model
aicutad models     # daftar model dari gateway
aicutad agents     # daftar subagent
aicutad sessions   # daftar session tersimpan
aicutad mcp --list # daftar MCP server
aicutad logout     # hapus kredensial

Subagent

8 subagent bawaan untuk tugas spesifik:

Agent Role Deskripsi
cutad-build orchestrator Implementasi fitur, bugfix, refactor
cutad-architect architect Desain sistem, ADR, dekomposisi komponen
cutad-review reviewer Code review multi-aspek (security, perf, API)
cutad-debug debugger Root-cause debugging 4 fase
cutad-plan planner Rencana implementasi terstruktur
cutad-search researcher Riset evidence-first dengan citations
cutad-fe frontend Frontend UI/UX (React, Vue, Svelte, CSS)
cutad-droid android Native Android (Kotlin, Compose, Room, Hilt)

Session Management

Percakapan otomatis tersimpan di ~/.cutad/sessions/:

aicutad sessions          # daftar semua session

Di TUI: /save untuk simpan manual, /sessions untuk lihat daftar.

MCP Support

aicutad-cli mendukung Model Context Protocol untuk extend tools:

aicutad mcp --list                    # daftar MCP server
aicutad mcp --add <name>              # tambah MCP server
aicutad mcp --connect <name>          # connect & list tools
aicutad mcp --remove <name>           # hapus MCP server

Config MCP disimpan di ~/.cutad/mcp.json.

Konfigurasi

Disimpan di ~/.cutad/:

~/.cutad/
β”œβ”€β”€ auth.json         # API key, model, gateway
β”œβ”€β”€ sessions/         # riwayat percakapan
β”œβ”€β”€ providers.json    # multi-gateway config
β”œβ”€β”€ mcp.json          # MCP server config
└── plugins.json      # plugin config

auth.json:

{
  "apiKey": "cag_...",
  "baseUrl": "https://ai.cutad.web.id/v1",
  "site": "https://ai.cutad.web.id",
  "model": "deepseek-ai/deepseek-v4-pro"
}

Environment variables (override, untuk CI/non-interaktif):

Env Fungsi
CUTAD_API_KEY API key (skip prompt input)
CUTAD_MODEL Model default (skip selector)
CUTAD_BASE Base URL gateway
# Login non-interaktif (CI/CD)
CUTAD_API_KEY=cag_... CUTAD_MODEL=deepseek-ai/deepseek-v4-pro aicutad login

Struktur Project

aicutad-cli/
β”œβ”€β”€ bin/
β”‚   └── cutad.mjs              # entrypoint (Commander, 8 subcommands)
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ tui/
β”‚   β”‚   └── App.mjs            # TUI native full-screen (ANSI, v0.4.6)
β”‚   β”œβ”€β”€ agent/
β”‚   β”‚   β”œβ”€β”€ tools.mjs          # 9 tool definitions (function calling)
β”‚   β”‚   β”œβ”€β”€ executor.mjs       # eksekusi tool (read/write/edit/run/browse)
β”‚   β”‚   β”œβ”€β”€ loop.mjs           # agentic loop (model ↔ tool, max 20 iter)
β”‚   β”‚   β”œβ”€β”€ context.mjs        # context window management (auto-summarize)
β”‚   β”‚   β”œβ”€β”€ cost.mjs           # cost tracking (token usage per session)
β”‚   β”‚   β”œβ”€β”€ browser.mjs        # headless Chromium (Puppeteer)
β”‚   β”‚   β”œβ”€β”€ run.mjs            # CLI entrypoint agent mode
β”‚   β”‚   └── index.mjs          # 8 subagent + delegate parallel/chain
β”‚   β”œβ”€β”€ session/
β”‚   β”‚   └── index.mjs          # save/load/list/export/import
β”‚   β”œβ”€β”€ mcp/
β”‚   β”‚   └── index.mjs          # MCP client (connect, list tools, call)
β”‚   β”œβ”€β”€ provider/
β”‚   β”‚   └── index.mjs          # multi-gateway config & switching
β”‚   β”œβ”€β”€ plugin/
β”‚   β”‚   └── index.mjs          # load external modules
β”‚   β”œβ”€β”€ api.mjs                # gateway komunikasi (models + chat)
β”‚   β”œβ”€β”€ chat.mjs               # REPL + TUI launcher
β”‚   β”œβ”€β”€ commands.mjs           # login wizard premium / status / logout
β”‚   β”œβ”€β”€ config.mjs             # baca/tulis auth
β”‚   β”œβ”€β”€ constants.mjs          # URL & konstanta
β”‚   β”œβ”€β”€ models.mjs             # daftar model
β”‚   β”œβ”€β”€ prompt.mjs             # masked input + arrow selector (glitch-free)
β”‚   └── ui.mjs                 # UI toolkit (banner, panel, spinner)
β”œβ”€β”€ .github/workflows/
β”‚   β”œβ”€β”€ ci.yml                 # CI test (Node 18/20/22)
β”‚   └── publish.yml            # Auto-publish to npm on release
β”œβ”€β”€ .gitignore
β”œβ”€β”€ package.json
└── README.md

Teknologi

  • Runtime: Node.js β‰₯ 18 (ESM, zero native deps)
  • Gateway: ai.cutad.web.id (OpenAI-compatible /v1)
  • Function calling: OpenAI tools API (tools + tool_choice: auto)
  • TUI: Native ANSI control codes (no React/Ink dependency)
  • Rendering: Absolute positioning (zero-scroll) + in-place updates untuk input/spinner/clock
  • Dependencies: commander (CLI), picocolors (color), @modelcontextprotocol/sdk (MCP), puppeteer (browser)
  • Package size: 46.7 KB (4 deps)

Roadmap

Done (v0.4.6)

  • Published to npm - npm install -g aicutad-cli βœ…
  • TUI full-screen immersive (alternate buffer)
  • Boot animation premium (bordered window, typewriter, multi-step)
  • Agentic loop dengan function calling (9 tools)
  • Context window management - auto-summarize old messages (>80% threshold)
  • Cost tracking - token usage & estimasi biaya per session, tampil di status bar
  • Context window indicator - ctx 15% live di status bar dengan color coding
  • Headless browser tools - Chromium (browse, search, screenshot)
  • Zero-glitch rendering - absolute positioning (no \n scroll), in-place updates
  • Interactive help modal - arrow ↑/↓ navigasi, Enter pilih command
  • Scroll messages - arrow ↑/↓ saat input kosong untuk scroll percakapan
  • Typing animation (AI response char-by-char)
  • Interactive model picker (modal overlay, arrow keys)
  • Input history (↑/↓ arrows)
  • Keyboard shortcuts (Ctrl+L, Ctrl+S, Tab autocomplete)
  • Modal overlays (help, models, sessions, agents - glitch-free)
  • Live clock di header
  • Markdown rendering (code blocks, bold, italic, headers, lists)
  • Message timestamps
  • Session management (save/load/list)
  • 8 subagent + delegate parallel/chain
  • MCP client support
  • Multi-provider config
  • Plugin system
  • First-run wizard premium
  • CI/CD (GitHub Actions)
  • Login wizard dengan animated spinner & progress bar

Next Priority

  • Streaming response (SSE) - TUI shows answer token-by-token
  • GitHub PR integration - auto create branch, commit, push, open PR

Future

  • Headless server + web interface
  • Diff viewer in TUI (show file changes before apply)
  • Multi-file editing in single tool call
  • Voice input (TTS/STT integration)
  • Custom tool plugins (user-defined tools)
  • Model-specific routing (different models for different tasks)

License

MIT Β© cutad

About

AI CUTAD CLI - AI coding agent CLI premium untuk gateway ai.cutad.web.id (OpenAI-compatible v1)

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages