@sns-myagent/cli
v0.3.8
Published
SNS-MyAgent — BYOK coding agent CLI. Multi-agent + Telegram + self-learning memory. ~120MB binary, zero forced cost.
Downloads
1,793
Maintainers
Readme
snscoder is a personal, single-user AI coding agent CLI. Bring your own API key, talk to the agent, and it configures itself — MCP servers, memory backends, model switching, all through conversation. Forked from Pi Agent / oh-my-pi and stripped to a focused, local-first, terminal-first agent.
Table of Contents
- Features
- Tools
- Slash Commands
- Memory Backends
- Installation
- Quick Start
- Configuration
- CLI Reference
- MCP Integration
- Telegram
- Architecture
- Development
- Contributing
- Security
- License
- Credits
Features
| Feature | Source |
|---------|--------|
| 30 built-in tools | src/tools/builtin-names.ts |
| 157 built-in slash commands | src/slash-commands/builtin-registry.ts |
| Multi-provider LLM | OpenAI, Anthropic, Ollama, custom endpoints via @oh-my-pi/pi-ai |
| 7 memory backends | mnemopi (default), hindsight, mnemosyne, mem0, lcm, local, off — src/memory-backend/resolve.ts |
| MCP integration | 22 source files in src/mcp/ |
| Plan mode | src/plan-mode/ — agent plans before executing |
| Goal mode | Autonomous objective with token budget and lifecycle |
| Subagent delegation | src/task/ — spawn child agents for parallel work |
| Advisor | Second model reviews each turn and injects notes |
| Collaborative sessions | src/collab/ — host/join sessions via link or QR code |
| Skills & plugins | src/extensibility/ — markdown skills + plugin marketplace |
| Auto-learning | src/autolearn/ — agent learns from interactions |
| Browser automation | Puppeteer-based headless browser — src/tools/ browser tool |
| LSP integration | Language Server Protocol — src/lsp/ |
| Eval backends | Python, Ruby, Julia, JavaScript — src/eval/ |
| SSH remote execution | src/ssh/ |
| Text-to-speech | 10 files in src/tts/ |
| TinyLLM local inference | 7 files in src/tiny/ |
| Telegram bot | src/adapters/telegram/ — auto-boot with SNS_TELEGRAM_BOT_TOKEN |
| Debug Adapter Protocol | src/dap/ |
| Context compaction | Automatic context window management with multiple strategies |
| IRC | IRC tool for chat protocol interaction |
| Todo system | Markdown-based todo list with reminders |
Tools (30 Built-in)
All tool names come from src/tools/builtin-names.ts.
File & Code Operations
| Tool | Description |
|------|-------------|
| read | Read file contents with line ranges |
| write | Write / create / append to files |
| edit | Find-and-replace edits in files |
| find | Find files by name or pattern |
| search | Search file contents (regex) |
Shell & Execution
| Tool | Description |
|------|-------------|
| bash | Execute shell commands |
| eval | Evaluate code snippets (Python, JS, Ruby, Julia) |
| ssh | Execute commands on remote hosts via SSH |
Code Intelligence
| Tool | Description |
|------|-------------|
| ast_grep | AST-based code search |
| ast_edit | AST-aware code editing |
| lsp | Language Server Protocol operations |
| debug | Debugging assistance |
Web & Browser
Web & Browser
| Tool | Description |
|------|-------------|
| web_search | Web search via configured provider |
| search_tool_bm25 | BM25-based search tool |
| browser | Headless browser automation (Puppeteer) |
| inspect_image | Image analysis |
Memory & Learning
| Tool | Description |
|------|-------------|
| memory_edit | Edit memory entries |
| retain | Store information in memory |
| recall | Retrieve information from memory |
| reflect | Self-reflection on past actions |
| learn | Learn from interactions |
| manage_skill | Manage skill files |
Sessions & Tasks
| Tool | Description |
|------|-------------|
| task | Spawn subagent for delegated work |
| job | Manage background jobs |
| checkpoint | Save session checkpoint |
| rewind | Rewind to a previous checkpoint |
Communication & Other
| Tool | Description |
|------|-------------|
| irc | IRC chat protocol |
| todo | Markdown todo list management |
| github | GitHub operations (repos, issues, PRs) |
| ask | Ask clarifying questions |
Slash Commands
61 built-in commands from src/slash-commands/builtin-registry.ts. Most useful:
Session & Navigation
| Command | Description |
|---------|-------------|
| /compact | Compact conversation context |
| /context | Show context-window breakdown |
| /copy | Copy last response to clipboard |
| /export | Export session to file |
| /dump | Dump raw session transcript |
| /share | Share session via collab link |
| /reset | Reset session |
| /help | Show help |
Model & Provider
| Command | Description |
|---------|-------------|
| /model | Switch model for this session |
| /switch | Quick model switch (same as alt+p) |
| /fast [on\|off\|status] | Toggle priority service tier |
| /settings | Open settings menu |
| /setup | Open provider setup wizard |
Goals & Planning
| Command | Description |
|---------|-------------|
| /plan | Toggle plan mode |
| /plan-review | Review the active plan |
| /goal <set\|show\|pause\|resume\|drop\|budget> | Goal lifecycle management |
| /guided-goal | Guided goal walkthrough |
| /loop [count\|duration] | Toggle loop mode |
| /advisor [on\|off\|status\|dump] | Advisor subagent control |
Output & Collaboration
| Command | Description |
|---------|-------------|
| /collab [view\|status\|stop] | Host a live collab session |
| /join <link> | Join a collab session |
| /leave | Leave collab session |
| /todo <edit\|copy\|export\|import\|append\|start\|done\|drop> | Todo list management |
| /browser [headless\|visible] | Switch browser mode |
System
| Command | Description |
|---------|-------------|
| /mcp [reload] | MCP server status / reload |
| /ssh | Run command on remote host |
| /plugins | Show installed plugins |
| /marketplace | Open marketplace manager |
| /stats [--port] | Launch stats dashboard |
| /usage [show\|reset] | Token usage / rate-limit reset |
| /version | Show version |
| /changelog [full] | Show changelog entries |
| /debug | Toggle debug logging |
| /theme | Switch UI theme |
| /unpin | Unpin pinned context |
Memory Backends
Seven backends, configured via memory.backend in settings. Source: src/memory-backend/resolve.ts.
| Backend | Description | Source |
|---------|-------------|--------|
| mnemopi (default) | SQLite + vector embeddings + graph. Local, zero setup. | src/mnemopi/ (7 files) |
| hindsight | Remote memory backend | src/hindsight/ (5 files) |
| mnemosyne | Three-tier memory: episodic → semantic → procedural. Auto-consolidation. | src/memory-backend/mnemosyne-backend.ts |
| mem0 | Semantic facts with auto-extraction. Relevance + recency scoring. | src/memory-backend/mem0-backend.ts |
| lcm | Latent Context Memory. Delta encoding + multi-resolution. | src/memory-backend/lcm-backend.ts |
| local | Rollout summary pipeline | src/memory-backend/local-backend.ts |
| off | Memory disabled | src/memory-backend/off-backend.ts |
Cron Scheduler
Persistent background scheduler, SQLite-backed. Source: src/cron/.
/cron list # List all jobs
/cron add <name> <expr> <action> [args] # Add: action = prompt|shell|skill
/cron run <name> # Run immediately
/cron remove <name> # Delete
/cron status # Show scheduler status
/cron enable <name> # Enable
/cron disable <name> # DisableExample: /cron add backup "0 2 * * *" shell "git push" runs git push daily at 2 AM.
mnemopi Settings
| Key | Default | Description |
|-----|---------|-------------|
| mnemopi.dbPath | — | SQLite database path |
| mnemopi.bank | — | Memory bank |
| mnemopi.scoping | — | Scoping mode |
| mnemopi.embeddingVariant | — | Embedding model variant |
| mnemopi.autoRecall | — | Auto-recall on context load |
| mnemopi.autoRetain | — | Auto-retain after conversations |
| mnemopi.retainEveryNTurns | 4 | Turns between auto-retains |
| mnemopi.recallLimit | 8 | Max recall results |
| mnemopi.recallContextTurns | 3 | Context turns for recall |
| mnemopi.recallMaxQueryChars | 4000 | Max query characters |
| mnemopi.injectionTokenLimit | 5000 | Token budget for injected memories |
| mnemopi.debug | false | Debug logging |
Installation
Option 1: One-liner (Linux / macOS / WSL)
curl -fsSL https://raw.githubusercontent.com/Reihantt6/sns-myagent/main/install.sh | bashMulti-arch: detects Linux x64, Linux ARM64 (Termux/Android), macOS.
Option 2: npm (all platforms)
npm install -g @sns-myagent/cliWorks on Linux, macOS, Windows, WSL. Requires Node.js 18+. Prebuilt binary downloaded on install.
Option 3: Build from source
git clone https://github.com/Reihantt6/sns-myagent.git
cd sns-myagent
bun install # requires Bun >= 1.3.14
bun run build # produces bin/snscoder-linux-x64Option 4: Windows PowerShell
irm raw.githubusercontent.com/Reihantt6/sns-myagent/main/install.ps1 | iexUses npm under the hood. WSL also supported via Option 1 or 2.
Run from source (development)
bun run src/cli/entry.tsPlatform Support
| Platform | Method | |----------|--------| | Linux x64 | Binary, npm, curl, source | | Linux ARM64 (Termux/Android) | Binary, npm, curl, source | | macOS x64 | Binary (CI), npm, source | | macOS ARM64 (M1/M2/M3) | Binary (CI), npm, source | | Windows x64 | Binary (CI), npm, PowerShell installer, WSL | | Android (Termux) | Binary, curl installer |
Prebuilt binaries: GitHub Releases. Auto-built for all platforms on every v* tag via .github/workflows/build-release.yml.
Quick Start
1. Set an API key
export OPENAI_API_KEY="sk-..."
# or
export ANTHROPIC_API_KEY="sk-ant-..."2. Run
snscoderOr from source:
bun run src/cli/entry.ts3. Use it
> what files are in the current directory?
> search the web for "bun runtime benchmarks"
> create a TypeScript module that parses CSV files
> refactor src/utils.ts to use async/await4. Configure through conversation
> add MCP filesystem for /home/user/projects
> switch to anthropic with claude-sonnet
> load coding skillConfiguration
Config lives at .sns-myagent/config.json (JSON, not YAML). Source: src/config/loader.ts.
Key Config Categories
Settings use dot-separated paths. Full schema in src/config/settings-schema.ts.
{
// Model selection
"model.*": "...",
// Feature toggles
"advisor.enabled": true,
"bash.enabled": true,
"browser.enabled": true,
"browser.headless": true,
"checkpoint.enabled": true,
"compaction.enabled": true,
"debug.enabled": false,
"github.enabled": true,
"goal.enabled": true,
"todo.enabled": true,
// Eval backends
"eval.py": true,
"eval.js": true,
"eval.rb": true,
"eval.jl": true,
// Memory
"memory.backend": "mnemopi", // "mnemopi" | "hindsight" | "mnemosyne" | "mem0" | "lcm" | "local" | "off"
"hindsight.scoping": "...",
// MCP
"mcp.*": {},
// Session
"session.*": {},
// Theme
"theme.dark": "titanium",
// Compaction
"compaction.enabled": true,
"compaction.strategy": "...",
"compaction.thresholdPercent": 80,
"compaction.idleEnabled": true,
"compaction.idleTimeoutSeconds": 300,
// Todo
"todo.enabled": true,
"todo.reminders": true,
"todo.reminders.max": 5,
// Mnemopi (when memory.backend = "mnemopi")
"mnemopi.dbPath": "...",
"mnemopi.autoRecall": true,
"mnemopi.autoRetain": true,
"mnemopi.retainEveryNTurns": 4,
"mnemopi.recallLimit": 8
}Access in TUI via /settings or through conversation.
CLI Reference
snscoder # Interactive TUI mode
snscoder "prompt" # Single-prompt mode
snscoder telegram # Start Telegram adapter
snscoder --help # Show help
snscoder --version # Show versionMCP Integration
Connect Model Context Protocol servers for additional tools. 22 source files in src/mcp/.
Through Conversation
> add MCP filesystem for /home/user/projects
> add MCP githubThrough Config
Configure via /mcp or the settings panel. Servers are defined in the MCP config section.
Popular MCP Servers
| Server | Package |
|--------|---------|
| Filesystem | @modelcontextprotocol/server-filesystem |
| PostgreSQL | @modelcontextprotocol/server-postgres |
| GitHub | @modelcontextprotocol/server-github |
Telegram
Telegram bot adapter in src/adapters/telegram/ (4 files). Built on grammY.
Setup
- Create a bot via @BotFather on Telegram
- Set the token:
export SNS_TELEGRAM_BOT_TOKEN="your-bot-token-here"- Run snscoder — the bot auto-starts polling:
snscoderThe adapter starts automatically when SNS_TELEGRAM_BOT_TOKEN is set. Disable auto-start with:
export SNS_TELEGRAM_AUTOSTART=0Or start the Telegram adapter explicitly:
snscoder telegramArchitecture
sns-myagent/
├── src/
│ ├── cli/ # CLI entry point + commands
│ ├── config/ # Settings schema, loader, defaults
│ ├── tools/ # 30 built-in tools
│ ├── modes/ # Interactive mode, TUI, controllers
│ ├── session/ # Session management
│ ├── mcp/ # MCP integration (22 files)
│ ├── prompts/ # System prompts
│ ├── memory-backend/ # Memory backend resolver
│ ├── mnemopi/ # mnemopi backend (SQLite + vector + graph)
│ ├── hindsight/ # hindsight backend (remote memory)
│ ├── extensibility/ # Skills, plugins, marketplace
│ ├── capability/ # Skill system
│ ├── task/ # Subagent delegation
│ ├── plan-mode/ # Plan mode
│ ├── web/ # Web search, scrapers
│ ├── ssh/ # SSH tool
│ ├── lsp/ # LSP tool
│ ├── eval/ # Eval backends (Python, Ruby, Julia, JS)
│ ├── collab/ # Collaborative sessions
│ ├── autolearn/ # Auto-learning system
│ ├── adapters/
│ │ └── telegram/ # Telegram bot adapter
│ ├── tts/ # Text-to-speech (10 files)
│ ├── tiny/ # TinyLLM local inference (7 files)
│ ├── dap/ # Debug Adapter Protocol
│ ├── stt/ # Speech-to-text
│ ├── thinking/ # Thinking mode support
│ ├── ui/ # Terminal UI components
│ └── utils/ # Utilities
├── docs/ # Documentation
├── bin/ # Prebuilt binaries
├── scripts/ # Build + dev scripts
├── install.sh # Multi-arch installer
├── install.ps1 # Windows installer
└── package.jsonDevelopment
bun install # Install dependencies
bun run build # Build binary to bin/
bun run src/cli/entry.ts # Run from source
bun test # Run tests
bun run check # Biome check + type check
bun run lint # Biome lint
bun run fix # Auto-fix lint + formatContributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/my-change) - Commit with clear messages
- Push and open a Pull Request
Commit Convention
add: new feature or file
fix: bug fix
refactor: code restructuring
docs: documentation changes
test: test additions or changes
chore: maintenance tasksSecurity
See SECURITY.md for vulnerability reporting and security policies.
License
MIT — see LICENSE.
Implementation Status (v0.3.7)
What is actually wired and working in the source tree, verified 2026-06-30:
Tools (30 / 30) — src/tools/builtin-names.ts
All 30 tools are real implementations, not stubs.
Slash Commands (157) — src/slash-commands/builtin-registry.ts
157 commands registered. All callable via /<name> in interactive mode.
Memory Backends (7 / 7) — src/memory-backend/resolve.ts
| Backend | Status | Requires config |
|---------|--------|-----------------|
| mnemopi (default) | ✅ Works out of box | None — local SQLite + vector + graph |
| local | ✅ Works out of box | None — rollout summary pipeline |
| off | ✅ Works out of box | None — no-op |
| mnemosyne | ✅ Wired | mnemosyne Python daemon running locally |
| mem0 | ✅ Wired | MEM0_API_KEY (or self-hosted endpoint) |
| lcm | ✅ Wired | LCM_HOST (default 127.0.0.1:8500) |
| hindsight | ✅ Wired | HINDSIGHT_API_KEY or remote endpoint |
Set via memory.backend in ~/.sns-myagent/config.yaml. Default is mnemopi.
Telegram Adapter — src/adapters/telegram/
5 files (bot, handler, format, index, bridge). 10 slash commands wired: /start /help /chat /reset /status /memory /cron /model /code /review. File upload/download supported. Auto-boot when SNS_TELEGRAM_BOT_TOKEN is set.
Multi-Agent Orchestration — src/agents/
7 files. agents.yaml config, 3 ensemble strategies (consensus / critic / best-of-N), resilience (retry + circuit-breaker + timeout), 21 tests pass. CLI orchestrate <prompt> is wired but executor is stubbed (returns clear "not wired yet" message).
Terminal UI — src/tui/ + src/ui/
8 files. MY snsagent splash, ● prefix chat blocks, flat status bar, command palette, error display, memory toast. No gradient, no rounded boxes — flat list style. v0.3.6+ rebrand.
CI / CD
GitHub Actions runs 7-stage pipeline: typecheck, lint, build, test, diagnose, smoke, all-checks. 5 platform binaries (linux x64/arm64, macos x64/arm64, windows x64) auto-built on tag push. Docker multi-arch image auto-built and pushed to ghcr.io/reihantt6/sns-myagent.
Published
- npm:
npm install -g @sns-myagent/cli→ v0.3.7 - GitHub releases: 5 binaries per version
- Docker:
ghcr.io/reihantt6/sns-myagent:v0.3.7
Credits
Forked from Pi Agent / oh-my-pi by can1357. Stripped to a focused, single-user terminal agent with conversational configuration.
