Package Exports
- @polylogicai/polycode
- @polylogicai/polycode/bin/polycode.mjs
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@polylogicai/polycode) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
polycode
An agentic coding CLI. Runs on your machine with your keys. Every turn is appended to a SHA-256 chained session log on disk, so your history is auditable, replayable, and portable across machines.
Install
The fastest way to try polycode is with npx. It works on macOS, Linux, and Windows from any terminal:
npx @polylogicai/polycode@latestFor repeated use, install it globally:
npm install -g @polylogicai/polycode
polycodeQuick start
Set your Groq API key, then run polycode:
# macOS and Linux
export GROQ_API_KEY=gsk_...
npx @polylogicai/polycode@latest
# Windows PowerShell
$env:GROQ_API_KEY = "gsk_..."
npx @polylogicai/polycode@latestThat opens an interactive session. For one-shot mode, pass your prompt as an argument:
npx @polylogicai/polycode@latest "read README.md and summarize it in one sentence"A free Groq API key is available at console.groq.com.
Configuration
polycode reads configuration from environment variables and optionally from a ~/.polycode/secrets.env file (chmod 600 recommended).
| Variable | Purpose | Required |
|---|---|---|
GROQ_API_KEY |
Primary inference key for tool-use and reasoning | yes |
ANTHROPIC_API_KEY |
Optional high-quality tier for long sessions | no |
POLYCODE_MODEL |
Override the default model | no |
POLYCODE_CWD |
Override the working directory | no |
Usage
polycode runs a standard agentic loop: you ask, it thinks, it uses tools, it returns a result. Available tools are:
bashrun a shell command in the working directoryread_fileread a file relative to the working directorywrite_filewrite a file to the working directoryedit_filereplace a substring in a filegloblist files matching a patterngrepsearch for a regex in files
All tool calls are sandboxed to the working directory. polycode refuses any path that escapes it.
Session history
Every turn polycode takes is appended to a SHA-256 chained JSONL file at ~/.polycode/history/YYYY-MM-DD.jsonl. You own this file. You can:
- Read it to see exactly what the agent did
- Back it up by copying it
- Hand it to a teammate, who can replay the session on their machine
- Run
polycode --verifyto confirm the chain is intact
Slash commands
Inside the REPL:
/help show all commands
/clear clear the terminal
/history show the session history file path and row count
/verify verify session history integrity
/exit leave polycodeCommand-line flags
polycode interactive REPL
polycode "<prompt>" one-shot mode
polycode --version print version
polycode --help print help
polycode --history print session history status
polycode --verify verify session history integritySafety rules
polycode enforces a small set of non-negotiable safety rules out of the box:
- Shell commands referencing system paths (
/etc/passwd,~/.ssh, private key files) are refused - Code patterns that evaluate untrusted input are refused
- Tool output containing recognized secret patterns (AWS, GitHub, Stripe, Anthropic, Groq, PEM blocks) is redacted before it reaches the model or the terminal
Rules live in ~/.polycode/rules.yaml. You can add your own.
Requirements
- Node.js 20 or newer
- macOS, Linux, or Windows
- A Groq API key
Documentation and support
- Install and usage:
polylogicai.com/polycode - Issues and questions:
ajs10845@psu.edu
License
MIT. See LICENSE. Built by Polylogic AI.
polycode is inspired by Claude Code's public architecture at docs.claude.com. polycode is not affiliated with Anthropic. No Claude Code code or system prompts are copied.