A minimal agent CLI with provider abstraction, tool calling, and system prompt assembly.
Project description
tiiny-cli
tiiny-cli is a minimal agent runtime inspired by the architecture of hermes-agent, but intentionally scoped down to four core parts:
- agent loop
- provider abstraction
- tool calling
- system prompt construction
The goal of this first cut is to give you a small, readable foundation that you can extend without carrying the full complexity of Hermes.
What is included
- A session-oriented
Agentloop - OpenAI-compatible provider adapter
- Tool registry with JSON-schema tool definitions
- Toolset-based filtering for session-scoped tool surfaces
- Minimal built-in tools for local development
- Minimal built-in tools for local development, including webpage fetch
- Skill discovery, loading, and management tools
- Hermes-style SOUL.md, AGENT.md, USER.md, and MEMORY.md support
- Layered system prompt builder
- JSON-backed session persistence with stable system prompt caching
- Streaming assistant output and live tool progress in the CLI
- CLI entrypoint for one-shot and interactive use
Quick start
cd tiiny-cli
python -m venv .venv
source .venv/bin/activate
pip install -e .
export OPENAI_API_KEY=your_key
export OPENAI_API_URL=http://127.0.0.1:8000/v1
export TIINY_MODEL=gpt-4.1-mini
tiiny "List the files in the current directory"
Interactive mode:
tiiny
Configuration mode:
tiiny config
Running plain tiiny starts a fresh auto-generated session by default. Use --session <name> if you want to continue an existing session.
Inside interactive mode you can use:
/newto start a fresh session with an auto-generated name/new my-sessionto switch to a specific new session name/tasksto list active background shell tasks/stopor/stop allto stop all active background shell tasks launched by this tiiny process/stop <task_id>to stop one active background shell task
Use a named session to preserve history across runs:
tiiny --session backend "inspect the current project"
tiiny --session backend "now summarize what you found"
Restrict the tool surface to specific toolsets:
tiiny --list-toolsets
tiiny --enable-toolset filesystem "read the README and summarize it"
tiiny --disable-toolset terminal "inspect the project structure safely"
Use tiiny config to manage persistent agent files and Tiiny home:
tiiny config
tiiny config home
tiiny config soul
tiiny config agent
tiiny config user
tiiny config memory
tiiny config lets you:
- change the base
tiiny-homedirectory - edit the contents of
SOUL.md - edit the contents of
AGENT.md - edit the contents of
USER.md - edit the contents of
MEMORY.md
The CLI streams assistant text as it is generated and prints tool activity in between iterations, so interactive runs feel closer to Hermes instead of waiting for one final block response.
Interactive input uses prompt_toolkit, which gives much better editing behavior for Chinese and other wide-character input than plain input().
Skills are stored under ~/.tiiny/skills by default. Once the skills toolset is enabled, the agent can:
- list skills with
skills_list - load a skill with
skill_view - create or update skills with
skill_manage
Tiiny also supports Hermes-style persona and memory files:
~/.tiiny/SOUL.md: persistent agent identity and high-level behavior~/.tiiny/AGENT.md: stable operating instructions for future sessions~/.tiiny/USER.md: stable user preferences and workflow habits~/.tiiny/MEMORY.md: durable project/environment facts and conventions
On first startup, Tiiny bootstraps these files automatically if they do not exist yet.
The active tiiny-home directory is stored in ~/.tiiny/config.json unless you override it with TIINY_HOME.
Environment variables
OPENAI_API_KEY: API key for the OpenAI-compatible providerOPENAI_API_URL: Preferred base URL variable for local or self-hosted OpenAI-compatible endpointsOPENAI_BASE_URL: Optional custom OpenAI-compatible base URLTIINY_ENABLE_THINKING: Whether to sendextra_body.chat_template_kwargs.enable_thinkingon model calls, defaulttrueTIINY_MODEL: Model name, defaultgpt-4.1-miniTIINY_MAX_ITERATIONS: Agent loop cap, default12TIINY_SYSTEM_PROMPT: Optional extra stable system prompt contentTIINY_EPHEMERAL_SYSTEM_PROMPT: Optional per-run ephemeral prompt suffixTIINY_ENABLED_TOOLSETS: Comma-separated allowlist, for examplefilesystem,terminalTIINY_DISABLED_TOOLSETS: Comma-separated denylistTIINY_SESSION_HOME: Session storage directory, default<tiiny_home>/sessionsTIINY_SKILL_HOME: Skill storage directory, default<tiiny_home>/skillsTIINY_HOME: Base Tiiny home directory, default~/.tiinyTIINY_SOUL_PATH: Advanced override forSOUL.md, default<tiiny_home>/SOUL.mdTIINY_AGENT_PATH: Advanced override forAGENT.md, default<tiiny_home>/AGENT.mdTIINY_USER_PATH: Advanced override forUSER.md, default<tiiny_home>/USER.mdTIINY_MEMORY_PATH: Advanced override forMEMORY.md, default<tiiny_home>/MEMORY.mdTIINY_WEB_SEARCH_URL: Override the default web search service endpoint
Architecture
CLI
-> Agent
-> SessionStore
-> SkillStore
-> MemoryStore
-> PromptBuilder
-> Provider
-> ToolRegistry
-> Built-in tool handlers
Key files:
src/tiiny_cli/agent.py: main loopsrc/tiiny_cli/session.py: JSON-backed session persistencesrc/tiiny_cli/memory.py: SOUL.md, AGENT.md, USER.md, MEMORY.md storage and frozen prompt snapshotssrc/tiiny_cli/skills.py: local skill storage, metadata parsing, and prompt integrationsrc/tiiny_cli/prompt_builder.py: system prompt assemblysrc/tiiny_cli/providers/openai_compatible.py: provider adaptersrc/tiiny_cli/tools/registry.py: schema registry and dispatchsrc/tiiny_cli/tools/builtin.py: starter toolssrc/tiiny_cli/tools/memory.py: persistent memory toolsrc/tiiny_cli/tools/skills.py: skill tools
Built-in toolsets
filesystem:list_directory,read_file,write_fileterminal:run_command,bash,process,detect_browserweb:web_search,fetch_webpagememory:memoryskills:skills_list,skill_view,skill_manage
Web Search And Fetch
Tiiny includes Hermes-inspired web search and fetch tools:
web_search: query the configured search service and return candidate URLsfetch_webpage: fetch one or more public HTTP(S) pages, extract readable text, and optionally focus the result with aquery
Recommended flow:
- call
web_searchfirst to discover relevant URLs - call
fetch_webpageon the most relevant results to inspect page content
Example:
Use web_search with:
{
"query": "OpenAI latest research",
"topk": 5
}
Then use fetch_webpage with:
{
"urls": ["https://example.com"],
"query": "domain reserved example"
}
The tool blocks localhost and private-network addresses to avoid unsafe internal fetches.
The search endpoint defaults to http://34.212.123.29:8002/api/retrieve and can be overridden with TIINY_WEB_SEARCH_URL.
Browser Detection
Tiiny includes a Hermes-inspired browser detection helper:
detect_browser: detect Chrome-family browsers across macOS, Windows, and Linux
Use it when a workflow depends on a local browser being installed. This avoids false negatives from Linux-only checks like which google-chrome on macOS.
SOUL And Memory Files
On first startup, Tiiny bootstraps the following files under ~/.tiiny by default:
SOUL.md: top-level identityAGENT.md: durable operating instructionsUSER.md: user preferences and working styleMEMORY.md: durable facts about the environment or project
If you already have older files under ~/.tiiny/memories/, Tiiny migrates them to the tiiny-home root automatically on startup.
If SOUL.md exists, Tiiny uses it as the top-level identity layer instead of the built-in default identity string.
AGENT.md, USER.md, and MEMORY.md are loaded as a frozen snapshot at session start and injected into the system prompt. Mid-session writes through the memory tool update the files on disk immediately, but they do not rewrite the current session prompt; the new snapshot is picked up the next time a fresh session starts.
Example layout:
~/.tiiny/
SOUL.md
AGENT.md
USER.md
MEMORY.md
Skill layout
Each skill lives in its own directory and contains a required SKILL.md.
~/.tiiny/skills/
my-skill/
SKILL.md
references/
templates/
scripts/
assets/
Minimal SKILL.md format:
---
name: my-skill
description: Short explanation of when to use this skill.
---
# My Skill
Step-by-step instructions go here.
Notes
This is a starter architecture, not a production-hardening pass. The current built-in tools include file reads, file writes, directory listing, and shell command execution, so you should review and tighten permissions before wider use.
Live CLI behavior
- Assistant text is streamed token-by-token when the provider supports OpenAI-compatible streaming.
- Tool calls are shown in a structured live activity feed with clearer visual separation.
- A lightweight spinner keeps the CLI feeling active between model/tool events.
- The
bashtool is the direct shell-facing alias for terminal work;run_commandremains available as a more generic name. bashandrun_commandcan takebackground=true.- The
processtool canlist,status,wait,stop, andstop_allbackground tasks. /tasks,/stop all, and/stop <task_id>control those background tasks from the interactive CLI.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tiiny_sdk-0.2.0.tar.gz.
File metadata
- Download URL: tiiny_sdk-0.2.0.tar.gz
- Upload date:
- Size: 72.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b728caf3eb69a7d3360e51d7f82f19f45a4ca235bffb70de7c5ff48e74523579
|
|
| MD5 |
3de686a5222635f7a79e5f8c9734121f
|
|
| BLAKE2b-256 |
ba2d17aa499a19fcbb9cd3809e051ab6b496f35507dda19f00f77e27a395950a
|
File details
Details for the file tiiny_sdk-0.2.0-py3-none-any.whl.
File metadata
- Download URL: tiiny_sdk-0.2.0-py3-none-any.whl
- Upload date:
- Size: 79.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b270f84d54cde0143c3ff036669032ca82cb406e33f1d1979604d611831d614f
|
|
| MD5 |
04f3b5522829d9a430877d63f494fe38
|
|
| BLAKE2b-256 |
a26bc92257f1db5e94ae0b5557b5d160608f502f3db6caab403331bca08c7ede
|