Wiki / Reference

Command line#

portcode with no command opens the app. These are all the commands and global options, taken from the binary:

PortCode — port programs to Rust with evidence, using local or self-hosted LLMs (lakomoor.com/v1, Ollama, LM Studio, llama.cpp, vLLM…)

Usage: portcode [OPTIONS] [COMMAND]

Commands:
  chat         Interactive chat (default)
  sessions     List, show or delete the saved sessions of this project
  run          Run one prompt non-interactively
  models       List models served by a provider
  providers    Show configured and built-in providers
  doctor       Check providers, toolchain and optional engines
  update       Install the newest PortCode release (sha256-checked); `--check` only looks
  mcp          Serve PortCode's tools over MCP (stdio) for Claude Code or Codex; `--print-config` shows how to register it
  eval         Probe a model: chat, tool-calling, JSON validity, edit accuracy
  init         Create portcode.json in this directory
  auth         Store an API key (mode 0600)
  completions  Print shell completions (bash, zsh, fish, powershell, elvish)
  agents       List agents
  serve        Run a session you can drive from the browser (remote control); see docs/REMOTE.md
  remote       Manage remote-control keys
  engines      Reverse-engineering engines (Capstone, Unicorn, Ghidra, ImHex…): list, install, path
  skill        Skills: list, show, export
  port         Porting workbench (survey, pin, parity, scaffold, shot, site, ledger)
  tool         Run any built-in tool directly with JSON arguments
  help         Print this message or the help of the given subcommand(s)

Options:
  -m, --model <MODEL>       Model as provider/model, e.g. lakomoor/deepseek-chat or ollama/qwen3:14b
  -a, --agent <AGENT>       Agent: build, port, reverse, plan
      --show-reasoning      Show the model's reasoning stream
      --deep                Deep mode: may disassemble, decompile and emulate the original (you own it or may examine it)
      --clean-room          Clean-room mode (default): observe the original from outside only
  -r, --resume [<SESSION>]  Resume a saved session: pick from this project's history (no value), or give an id, a unique prefix or a number from `portcode sessions`
  -h, --help                Print help
  -V, --version             Print version

Common uses#

portcode                              # the app, in this folder
portcode -m ollama/qwen3:14b          # a local model
portcode -a port --deep               # the port agent, deep mode
portcode --resume                     # pick an earlier session
portcode run "list the TODOs"         # one prompt, no screen
portcode run -c "now fix the first"   # continue the latest session
portcode run -y "run the tests"       # approve everything for this run
echo "summarise README.md" | portcode run

run#

Runs one prompt without the screen and prints the answer. Options: -y approves every permission request (only in a sandbox or a trusted project), -c continues the latest session, --json emits JSON lines. The prompt can come from the arguments or from stdin.

sessions#

portcode sessions [list | show <n|id> | rm <n|id>]. See Sessions.

port#

The porting workbench on the command line: survey, pin, parity <golden> <port>, scaffold <name>, shot, site, render, page, ledger. They do what the tools of the same names do, without a model. See The port workflow.

tool#

portcode tool <name> '<json>' runs any built-in tool directly. See Tools.

engines#

portcode engines list|install <id…>|path. install core installs Capstone, Unicorn and LIEF; install all installs everything installable. See Engines.

auth, providers, models, doctor, eval#

portcode auth set <provider> stores a key. portcode providers shows configured and built-in providers. portcode models lists what a provider serves. portcode doctor checks the setup. portcode eval probes a model.

serve, remote, mcp#

portcode serve runs a session you can drive from a browser, portcode remote new|list|revoke manages pairing keys (see Remote control), and portcode mcp serves the tools over MCP (see Claude Code and Codex).

Edit this page on GitHub