Skip to content

Repository files navigation

YourAssistantCoder (yac)

A sandboxed, tracked, multi-model AI coding agent that lives inside your project and never leaves.


Install

pip install -r requirements.txt

Currently NO binaries are available to download.


Quickstart

# Use the TUI interface
yac
# Register your project
yac init myproject --path C:\myproject --model gpt
# Run the agent once
yac run "refactor auth.py so it hashes the token" --model gpt
# Or talk to it interactively (Rich REPL, same slash-commands as the TUI)
yac chat
# View what the agent did
yac log
# Roll back a file
yac rollback auth.py
# Check project status
yac status

Slash-commands

Available in both the Textual TUI and yac chat:

CommandWhat it does
/simpleWrite the simplest correct solution.
/proPolished output, em/en dashes allowed.
/buildBuild and/or run the code after writing it.
/researchUse web search to research first.
/diagnoseScan the whole codebase for common bugs.
/modelShow or switch which model you're talking to.
/git push | /git pull | /git clone <url> | /git add <path>Runs git directly through the shell-approval flow, no model round-trip.

In the TUI, typing / opens a filterable dropdown of these. In yac chat, typing / alone prints the same list as a table.


Models

FlagModelKey needed
--model claudeClaude (Anthropic)console.anthropic.com
--model gptGPT-5.4-miniplatform.openai.com
--model geminiGemini 2.0 Flash Liteaistudio.google.com
--model ollamaAny local Ollama modelnone, runs locally
--model deepseekDeepSeek-V3 / R1platform.deepseek.com
--model mistralCodestralconsole.mistral.ai

API keys are stored securely in your system keyring, never in plain text. Switch model and role per-project with yac edit-role MODEL ROLE.


How it works

PFPS (Python File Protection System)

Every project runs inside a sandbox. The agent cannot read or write files outside the project root. All file operations go through permission tokens with role-based expiry.

Owner -> no expiry, you manually stop it
Editor -> token expires after 90 seconds
Viewer -> token expires after 60 seconds

AMS (Action Monitoring System)

Every operation the agent performs is logged to .YAC/.PFPS/ams/session.log. Suspicious patterns (delete then recreate, runaway rewrites) trigger a user prompt before continuing.

File Tracking

Like git, PFPS tracks every insert and delete on every file. You can roll back any file to before the agent touched it.

Skills

.YAC/.SKILLS holds the agent's default behavioral guide, copied in full from src/SKILLS/ when you run yac init. This is where working style, coding conventions, git workflow, and build-toolchain detection live, and it's meant to be edited per-project. Ships with:

SkillCovers
DEFAULT.mdCapabilities, slash-commands, working style. Human-written code, no em/en dashes by default.
CODE_STYLE.mdWorked examples of that coding convention.
GIT_WORKFLOW.mdCommit message style, safe shell usage for git operations.
BUILD_TOOLCHAIN.mdHow to detect a project's build system and invoke it correctly.

Memory and history

Two more folders under .YAC give the agent continuity across sessions:

  • .AI_HIST is written automatically at the end of every session, a short log of what was asked and what got done. The agent reads recent entries back in so it knows what "we" were doing if you refer back to earlier work.
  • .AI_MEM is agent-curated, not automatic. The agent writes to it only when you ask it to remember something, or when it decides a project fact is worth keeping (a decision, a convention, something to avoid), and reads it back at the start of every session.

ErrorExecution

The agent can test code it writes. Output and errors feed back to it automatically. After 3 consecutive failures it prompts you to give it a "nap", resetting its context and retrying fresh.

Write Lock

If you open a file the agent is editing, the agent pauses automatically and waits for you to finish. Your edits are never overwritten.


Project structure

YourAssistantCoder/
├-- yac.py # CLI entry point (init, run, chat, log, status, rollback, edit-role)
├-- agent.py # Agent loop, model dispatch, tool dispatch, memory/history wiring
├-- model_router.py # Claude / GPT / Gemini / Ollama / DeepSeek / Mistral adapters
├-- commands.py # Slash-command definitions shared by the TUI and yac chat
├-- pfps.py # Sandbox, chunker, git-like tracker, write locks, skills, memory, history
├-- ams.py # CheckOut, UseTool, SpecialUse, Working/WorkingStop
├-- error_execution.py # Live code execution with nap system
├-- permissions.py # Token roles, expiry, scopes
├-- notify.py # OS notifications (Windows toast, Linux wall/notify-send)
├-- console.py # Rich terminal interface
├-- tui.py # Textual TUI
├-- SKILLS/ # Bundled default skills, copied into every new project
└-- requirements.txt

TUI

YourAssistantCoder has a TUI interface made with Textual. Init a project, talk with your agent like a chatbot interface.

Heres some reference images to see the TUI in action:

InitTimeInitSelectTalkInterface

License

GPLv3 - build whatever you want with it, but keep it open-source.

About

This is a AI Agent tool that takes a API Token and saves it in your keyring, and allows the model to directly code on your PC.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages