Engineering in the terminal

mce. Your command line, amplified.

Bring selected text files and optional image attachments to an OpenAI-compatible Responses API for focused analysis, precise edits, and multi-turn agent work. Independent context and prompt reviews can help agents stay oriented; saved checkpoints support deliberate recovery.

View on GitHub

Workflows / Built around your project

One task. An agent that can adjust as it works.

Explore the agent guide

Use selected local text files and optional image attachments for focused answers, precise changes, or a multi-turn agent through an OpenAI-compatible Responses API. In agent mode, a controller coordinates tools and task state; optional context assist and prompt assist help it reassess working context and refine instructions as the session progresses.

01 / Agent mode

Delegate an outcome, not every individual step.

Native tools let the controller read files, make patches, run shell commands, call specialized workers, and maintain a task list across turns.

An example engineering brief

Identify one reproducible defect, make a focused fix, and run the relevant tests. Preserve the public interface.

  • Supply the essentials. Select key text files directly to pin them against routine expiry; the agent can load more as needed. Available file context refreshes from disk before later requests.
  • Make success checkable. State the intended behavior, constraints, and evidence you expect before accepting the result.
  • Plan when useful. Prepare a proposed next-step prompt, then review or edit it before the main request.

Agent mode requires native function-call support from both the endpoint and the selected model. Image attachments also require compatible image input.

Controller + tools

Read. Act. Inspect. Continue.

  1. Read & track

    Bring file evidence into working context and keep the task list aligned with the remaining work.

  2. Patch & execute

    Make precise file changes or run shell commands within the chosen approval and write policies.

  3. Delegate a subtask

    Ask patch, shell, or custom-schema workers for focused proposals while the controller coordinates the task.

  4. Inspect & continue

    Use command output and file evidence to guide follow-up work, with summaries supporting longer runs.

The controller chooses the next useful step; recorded tool results inform later turns. This is a working loop, not a fixed script.

02 / Independent assists

Reassess context. Adjust instructions in flight.

Self-adjusting support is opt-in: both reviewers start disabled. Schedule each independently by agent-turn count.

Controller request Independent reviews Later-turn guidance

Progress & context

Context assist

An independent reviewer compares current requirements with recorded outcomes, flags stalled progress, and returns guidance and requests for targeted context cleanup.

  • Remove selected stale turns while preserving their loaded file context, or remove selected unchanged files from working context.
  • Request a fresh summary, or clear one that has become obsolete.
  • Skip the next scheduled context review when appropriate.
  • Request context compaction only as a last resort.

Guidance, not validation. Eligible removals affect context, never files on disk. These removals leave newer turns and changed or newly loaded files in place; verify the guidance against current files, outputs, and tests.

Working instructions

Prompt assist

An independent reviewer can refine named working instructions for the active session without rewriting your reusable prompts.

  • Adjust controller, worker, tool-call, task-priority, summary, and reviewer instructions in memory.
  • Adjust selected worker-profile instructions and tool descriptions, with a short replacement history available to the reviewer.
  • Leave stored configuration, prompt-library files, and worker profiles unchanged.

Session-scoped. Agent runtime checkpoints preserve prompt adjustments and recent replacement history for resumption. Explicit prompt overrides supplied for the new run take precedence.

Independent cadence. Independent request settings.

Reviews run alongside controller requests, with successful results collected and applied before a later turn. Reuse the active request settings or select an independent configuration profile, reasoning effort, and model for either reviewer. Each reviewer's endpoint and model must support native function calls.

Named reviewer profiles resolve their own endpoint, credentials, token limits, pricing, and API-side storage rather than inheriting controller overrides; an API-key environment setting can still override stored keys. Reviews add API usage, carry any selected image attachments, and may truncate the serialized controller request to fit the reviewer's input limit.

Understand independent reviews

One possible rhythm

Every 8 turns
Context assist
Every 14 turns
Prompt assist

Illustrative intervals, not defaults. Enable only the reviews that suit the task and its budget.

03 / Focused workflows

Use the smallest workflow that fits.

Not every job needs an agent. Choose a focused workflow when one explanation, reviewed change, command sequence, or file-tree pass is enough.

Analysis & planning

Understand before changing.

Ask a focused question or investigate selected files. Planning prepares a proposed next-step prompt for review or editing before the main request.

Reuse instructions through the prompt library and inherited profiles instead of rebuilding every request.

Explore analysis and planning

Precise file changes

Inspect the diff. Choose the revision.

Propose line-based changes to existing or new text files, inspect unified diffs, and iterate through revisions before accepting the selected patch.

Standalone patches write suffixed copies by default. Reviewed changes normally use original paths unless copy output is selected; accepted edits can also be committed on a dedicated Git branch.

Explore patch workflows

Reviewed shell execution

Understand the command and its effects.

Turn an operational task into explained command proposals. Review or revise them, execute accepted commands, and use recorded output in follow-up turns.

Set per-command timeouts separately from API request limits. Shell commands can create only Unix sockets by default; check the network policy before allowing more.

Explore shell workflows

Recursive batch processing

Take a consistent task across a file tree.

Run extension-specific, wildcard, and shared instructions against filtered text files. Preview the selected paths before any model request, then process the chosen files in separate parallel requests.

Results are saved separately from source files. Saved progress supports resumption, and combined Markdown reports aid review; any selected image attachments accompany every per-file request.

Explore batch and context controls

04 / Controls & continuity

Keep longer work bounded and recoverable.

Pair delegation with a repeatable process for inputs, usage limits, snapshots, saved evidence, and verification.

  1. Before the run

    Define the boundaries.

    Confirm provider capabilities, relevant files, approval policy, permitted writes, and what a successful result must demonstrate.

  2. During the run

    Observe the work.

    Inspect tool results, task progress, summaries, and usage. Treat independent reviews as assistance, not proof of correctness.

  3. After the run

    Verify and preserve.

    Compare changes with requirements, run appropriate tests, and keep the session evidence needed for inspection or deliberate resumption.

Inputs, reusable prompts & worker rolesStart with the right material and repeatable instructions.
  • Compose focused text inputs. Read task instructions from files, standard input, or your editor; select context files directly or through file lists. Ordinary file context is text-only, and files above the configured size limit are skipped.
  • Attach images separately. Use an endpoint and model that support image input. Original image bytes are base64-encoded without resizing, conversion, or other image processing; text-file size limits do not apply to these attachments.
  • Separate shared settings from specialized roles. Prompt-library entries and inherited configuration profiles make instructions and provider settings reusable. Agent worker profiles separately define focused patch, shell, or custom-schema proposals.
  • Keep fresh context trusted. Optional context hooks run before each controller request and include successful standard output. They execute directly, outside tool-call approval and the shell tool's timeout and socket restrictions; wrapper containment still applies when used.
Context and profiles guide
Providers, output & budgetMatch capabilities and request limits to the task.
  • Check compatibility. Use a hosted or local OpenAI-compatible Responses API endpoint. Agents and independent reviewers need native function calls; patch, shell, and custom-schema proposals need compatible structured outputs. Image input also needs endpoint and model support.
  • Estimate, then observe. Estimate serialized text and tool-schema tokens without a model API request, then set limits and inspect provider-reported usage. Image tokens are not included in estimates or estimated input-limit checks. Text estimates can also differ from actual usage; monetary estimates require current pricing for each selected model.
  • Choose a response contract. Use text or supported text streaming for people, and JSON or schema-constrained output for tools. Agents and tree batches do not stream. Optional JSON repair assists parsing, not correctness.
  • Bound provider behavior. Set request timeouts and retry limits separately from command execution limits. Service tiers and explicit caching depend on provider support; disabling explicit caching does not disable automatic provider caching.
Request and output guide
Long-run context & optional snapshotsManage accumulated work and prepare recovery copies.
  • Keep current evidence. Available agent file context refreshes from disk before later requests. Automatic summaries support longer runs but remain compressed historical records, not proof that proposed actions ran.
  • Choose retention deliberately. Unpinned files and history expire by turn count. On a fresh agent run, directly selected files are pinned against routine expiry; file-list and profile inputs are not. Pins do not prevent token-pressure compaction or targeted context-assist removal.
  • Enable snapshots deliberately. Directory backups are off by default. When enabled, a startup snapshot is followed by interval checks before later request turns—not a continuous background timer.
  • Plan backup storage. Keep destinations outside all source directories and prepare their write grants before a contained run. Snapshots include hidden files and are not pruned by expired-session cleanup.
Long-running workflow guide
Saved sessions & diagnosticsInspect evidence and return to a completed turn. Saved sessions & diagnosticsInspect evidence and recover saved work.
  • Keep the evidence. Task-based session state retains context, responses, validated patch manifests, diffs, and shell output independently of local logging, including declined patch proposals. Inspect a saved patch against current files before applying it.
  • Resume deliberately. Continue in a new linked session. Agents can recover from available runtime checkpoints, including interrupted turns, restoring task and context state, prompt adjustments, and reviewer scheduling. Recorded context-file checksums are verified by default; inspect actual file and command effects before continuing, and keep referenced source sessions.
  • Diagnose with care. Model discovery, request statistics, local logs, and optional execution traces help investigate behavior. Logs, state, backups, and traces may contain sensitive information; inspect them before sharing.
  • Separate storage policies. Local logging, saved state, and provider-side storage have distinct controls. Disabling local logs neither removes saved state nor determines provider retention.
Saved-session guide

Engineering assistance, grounded in your project.

Use mce to investigate code, prepare focused changes, review operational commands, or coordinate multi-step tasks. Reusable prompts, shared configuration profiles, and saved sessions support a consistent process from initial analysis to reviewed results.

Explore mce use cases

Get started

From install to first request.

Install mce, configure your provider, and run an analysis task.

Requires Linux, Git, Python 3.10+ with pip and curses, Make, and an OpenAI-compatible Responses API endpoint. The containment wrapper and contained shell execution also need systemd-run and a running systemd user manager; optional shell tracing needs strace.

  1. Install from source

    git clone https://github.com/Southland-Systems/mince.git
    cd mince
    make install

    This creates a per-user Python environment. Keep your user-local launcher directory on your shell's search path and retain the checkout for future updates.

  2. Configure shared settings

    mce --init

    Set the API base URL, credentials, and model in the shared config profile. Tab/arrows navigate, Enter edits, F2 or Ctrl+S saves, and ? opens help. Presets inherit these settings. After saving, use model discovery to inspect the models available from your provider.

  3. Run your first task

    mce -p task -t "Summarize this project" \
      -f README.md

    Run this in the cloned checkout. For another project, change to its directory and replace README.md with the relevant text files.

Selected text and attached images go to your provider; share only authorized material. Image input needs a compatible endpoint and model. Agents run tools automatically unless agent review is selected—noninteractive operation alone does not prevent execution. Agents and independent reviewers need native function calls; patch, shell, and schema workflows need compatible structured outputs.

Workflow guide

Understand how the work proceeds.

Learn how context, review, and execution fit together. Use the repository reference when you need exact commands or configuration details.

A bounded task, with relevant context.

mce combines your task description with selected text files and optional image attachments and sends the request to your configured provider. A focused set of inputs makes it easier to assess whether the response addresses the actual problem.

  1. Confirm provider compatibility. Check both the endpoint and model for the intended work. Image input needs image support; structured file or shell proposals need compatible structured outputs; agents and independent reviewers need native function calls.
  2. State a verifiable outcome. Explain what needs to change, what must remain stable, and how you will check the result. Include the files that establish the relevant behavior.
  3. Choose the level of delegation. Use analysis for explanations, reviewed patches for file changes, or a shell workflow for explained command proposals and revisions. Choose an agent when the task needs several coordinated tool-assisted steps.
  4. Inspect before relying on the result. Compare the response with the source, examine proposed edits or commands, and run appropriate tests. A plausible explanation is not evidence that a change is correct.

Planning can prepare a proposed next-step prompt before the main request. Review or edit that plan when the task is broad or its constraints need clarification.

Built in the open

Contribute to the project.

Help improve mce with reproducible bug reports, documentation corrections, or focused code contributions.

Source on GitHub

Review the implementation, installation notes, and complete usage reference.

Report an issue

Describe expected and actual behavior, the relevant environment, and a minimal reproduction.

Codeberg mirror

Access a mirrored copy of the project source.

Share only sanitized excerpts. Reports and diagnostic artifacts should not include credentials, proprietary files, or unrelated personal information.