Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@avcodes/mi

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@avcodes/mi - npm Package Compare versions

Comparing version
1.7.8
to
1.7.9
+3
-3
index.mjs

@@ -60,3 +60,3 @@ #!/usr/bin/env node

const ver = JSON.parse(readFileSync(`${DIR}package.json`, 'utf8')).version; if (['-v','--version'].some(f => process.argv.includes(f))) { console.log(ver); process.exit(0); } if (['-h','--help'].some(f => process.argv.includes(f))) { console.log(`mi ${ver}\n\nusage: mi [-p prompt] [-f file] [--sandbox] [-v]\n\nmodes:\n mi -p "prompt" one-shot\n echo "..." | mi pipe\n mi repl (/reset clears)\n\nflags:\n -p <prompt> run prompt and exit\n -f <file> attach file to context\n --sandbox run in docker\n -v, --version print version\n -h, --help show this help\n\nenv: OPENAI_API_KEY MODEL OPENAI_BASE_URL REASONING_EFFORT SYSTEM_PROMPT MI_HOME MI_IMAGE`); process.exit(0); }
const ver = JSON.parse(readFileSync(`${DIR}package.json`, 'utf8')).version; if (['-v','--version'].some(f => process.argv.includes(f))) { console.log(ver); process.exit(0); } if (['-h','--help'].some(f => process.argv.includes(f))) { console.log(`mi ${ver}\n\nusage: mi [-p prompt] [-f file] [--sandbox] [-v]\n\nmodes:\n mi -p "prompt" one-shot\n echo "..." | mi pipe\n mi repl (/reset, /new, /clear all reset history)\n\nflags:\n -p <prompt> run prompt and exit\n -f <file> attach file to context\n --sandbox run in docker\n -v, --version print version\n -h, --help show this help\n\nenv: OPENAI_API_KEY MODEL OPENAI_BASE_URL REASONING_EFFORT SYSTEM_PROMPT MI_HOME MI_IMAGE`); process.exit(0); }

@@ -76,4 +76,4 @@ // Append -f file contents, AGENTS.md (auto-ingested repo context), and skill summaries to system message.

// Ctrl-D (EOF) → clean exit; then loop: read input → run agent → repeat
// /reset: keep system prompt (index 0), drop all conversation history
// /reset (aliases: /new, /clear): keep system prompt (index 0), drop all conversation history
// Error recovery: pop the failed user message so the model never sees it
readLine.on('close', () => process.exit(0)); while (true) { const input = await promptUser('\n> '); if (input === '/reset') { history.splice(1); /* keep system prompt at [0] */ console.log(gray('✓ reset')); continue; } if (input.trim()) { history.push({ role: 'user', content: input }); process.stdout.write(`${gray('─────')}\n`); try { await run(history); } catch (error) { console.error(red(`✗ ${error.message}`)); history.pop(); } } }
readLine.on('close', () => process.exit(0)); while (true) { const input = await promptUser('\n> '); if (['/reset','/new','/clear'].includes(input)) { history.splice(1); /* keep system prompt at [0] */ console.log(gray('✓ reset')); continue; } if (input.trim()) { history.push({ role: 'user', content: input }); process.stdout.write(`${gray('─────')}\n`); try { await run(history); } catch (error) { console.error(red(`✗ ${error.message}`)); history.pop(); } } }
{
"name": "@avcodes/mi",
"version": "1.7.8",
"version": "1.7.9",
"description": "agentic coding in 30 loc. a loop, two tools, and an llm.",

@@ -5,0 +5,0 @@ "type": "module",

@@ -11,16 +11,16 @@ [![mi video](https://img.youtube.com/vi/JdMBn7FXilg/maxresdefault.jpg)](https://www.youtube.com/watch?v=JdMBn7FXilg)

- `goal` tool pursues a high-level goal by iterating subagents until a bash check command exits 0 — uses a progress file so iterations build on prior work (up to 128 by default)
- recursive agents: `delegate` and `goal` tools spawn sub-agents natively; any tool can also call `mi` as a child process
- self-extending: agent can write its own tools via the `self` skill
- `skill` tool loads markdown playbooks from `skills/` and `~/.agents/skills/` (auto-advertised in system prompt)
- bundled skills: `plan`, `tasks`, `delegate`, `explore`, `refactor`, `review`, `verify`, `debug`, `tdd`, `new-skill`, `self`
- modular tools: add new tools by dropping `.mjs` files in `tools/` (hot-loaded before each model call)
- self-extending: agent can write its own tools via the `self` skill
- recursive agents: `delegate` and `goal` tools spawn sub-agents natively; any tool can also call `mi` as a child process
- `--sandbox` mode: run inside a Docker container with PWD mounted — safe for destructive experiments. image ships with node, python, uv, git, GNU coreutils/grep/sed/awk/find, curl, jq, ssh, rsync, vim, less, procps, util-linux, bind-tools (dig), iputils (ping), tree
- automatic `AGENTS.md` ingestion from current directory for repo-specific context
- chat REPL with `/reset` (aliases: `/new`, `/clear`) and error recovery
- non-interactive mode with `-p 'prompt'` for scripting and CI
- stdin pipes: `echo "do this" | mi` or `cat file | mi`
- file context via `-f <file>` argument
- chat REPL with `/reset` command and error recovery
- streaming output (SSE) — tokens appear as they arrive
- graceful `SIGINT` handling for bash child processes
- optional `~/.mi/config.json` config file (env vars always override)
- `--sandbox` mode: run inside a Docker container with PWD mounted — safe for destructive experiments

@@ -44,3 +44,3 @@ ## install

```sh
# interactive repl (type /reset to clear history)
# interactive repl (type /reset, /new, or /clear to clear history)
OPENAI_API_KEY=sk-... mi

@@ -47,0 +47,0 @@

@@ -50,3 +50,3 @@ ---

- `mi` (REPL) · `mi -p '<prompt>'` (one-shot) · `mi -f <file>` (prepend file to system) · `mi --sandbox` (run in Docker) · `mi -v` (version) · `mi -h` (help). Stdin pipes work: `echo ... | mi`.
- REPL command: `/reset` clears history (keeps system prompt).
- REPL command: `/reset` clears history (keeps system prompt). Aliases: `/new`, `/clear`.
- Env vars and config: see the **Config** section above.

@@ -53,0 +53,0 @@